--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/a2ps/patches/sheets.map.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,52 @@
+*** a2ps-4.13/sheets/sheets.map.orig Wed May 12 15:37:37 2004
+--- a2ps-4.13/sheets/sheets.map Wed May 12 15:48:45 2004
+***************
+*** 237,242 ****
+--- 237,243 ----
+ # GIF Images
+ gif: /*.gif/i
+ <GIF image*>
++ <GIF file*>
+
+ # Haskell programs
+ haskell:
+***************
+*** 326,331 ****
+--- 327,333 ----
+ # PDF documents
+ pdf: /*.pdf/i
+ <PDF document*>
++ <* (PDF) *>
+
+ # Perl files
+ perl: /*.p[ml]/
+***************
+*** 338,343 ****
+--- 340,346 ----
+ # PNG files
+ png: /*.png/i
+ <PNG image*>
++ <PNG file*>
+
+ # Portable Object (Gettext)
+ po: /*.po/
+***************
+*** 474,481 ****
+ <*vtcl*>
+
+ # TIFF images
+! tiff: /.tif/i /.tiff/i
+ <TIFF image*>
+
+ # tk files
+ tk: /*.tk/
+--- 477,485 ----
+ <*vtcl*>
+
+ # TIFF images
+! tiff: /*.tif/i /*.tiff/i
+ <TIFF image*>
++ <TIFF file*>
+
+ # tk files
+ tk: /*.tk/
--- a/components/a2ps/sheets.map.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-*** a2ps-4.13/sheets/sheets.map.orig Wed May 12 15:37:37 2004
---- a2ps-4.13/sheets/sheets.map Wed May 12 15:48:45 2004
-***************
-*** 237,242 ****
---- 237,243 ----
- # GIF Images
- gif: /*.gif/i
- <GIF image*>
-+ <GIF file*>
-
- # Haskell programs
- haskell:
-***************
-*** 326,331 ****
---- 327,333 ----
- # PDF documents
- pdf: /*.pdf/i
- <PDF document*>
-+ <* (PDF) *>
-
- # Perl files
- perl: /*.p[ml]/
-***************
-*** 338,343 ****
---- 340,346 ----
- # PNG files
- png: /*.png/i
- <PNG image*>
-+ <PNG file*>
-
- # Portable Object (Gettext)
- po: /*.po/
-***************
-*** 474,481 ****
- <*vtcl*>
-
- # TIFF images
-! tiff: /.tif/i /.tiff/i
- <TIFF image*>
-
- # tk files
- tk: /*.tk/
---- 477,485 ----
- <*vtcl*>
-
- # TIFF images
-! tiff: /*.tif/i /*.tiff/i
- <TIFF image*>
-+ <TIFF file*>
-
- # tk files
- tk: /*.tk/
--- a/components/bash/bash41-001.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
- BASH PATCH REPORT
- =================
-
-Bash-Release: 4.1
-Patch-ID: bash41-001
-
-Bug-Reported-by: Yann Rouillard <[email protected]>
-Bug-Reference-ID: <[email protected]>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-01/msg00018.html
-
-Bug-Description:
-
-A prototype for vsnprintf was incorrect, and caused compilation failures
-on systems that did not have a suitable vsnprintf, but had a declaration in
-one of the system header files.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/builtins/printf.def 2009-11-20 15:31:23.000000000 -0500
---- builtins/printf.def 2010-01-07 08:50:06.000000000 -0500
-***************
-*** 173,177 ****
-
- #if !HAVE_VSNPRINTF
-! extern int vsnprintf __P((char *, size_t, const char *, ...)) __attribute__((__format__ (printf, 3, 4)));
- #endif
-
---- 173,177 ----
-
- #if !HAVE_VSNPRINTF
-! extern int vsnprintf __P((char *, size_t, const char *, va_list)) __attribute__((__format__ (printf, 3, 0)));
- #endif
-
-*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
-***************
-*** 26,30 ****
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 0
-
- #endif /* _PATCHLEVEL_H_ */
---- 26,30 ----
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 1
-
- #endif /* _PATCHLEVEL_H_ */
--- a/components/bash/bash41-002.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
- BASH PATCH REPORT
- =================
-
-Bash-Release: 4.1
-Patch-ID: bash41-002
-
-Bug-Reported-by: [email protected]
-Bug-Reference-ID: <[email protected]>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-01/msg00017.html
-
-Bug-Description:
-
-Bash-4.1/Readline-6.1 introduced a hook function that allows applications
-to rewrite or modify filenames read from the file system before comparing
-them with a word to be completed. The converted filename, if it matches,
-needs to be inserted into the line buffer, replacing the original contents.
-
-This fixes a completion bug on Mac OS X involving filenames containing
-UTF-8 characters.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/lib/readline/complete.c 2009-11-29 18:39:30.000000000 -0500
---- lib/readline/complete.c 2010-01-06 08:30:23.000000000 -0500
-***************
-*** 2139,2143 ****
- if (filename_len == 0)
- {
-! if (_rl_match_hidden_files == 0 && HIDDEN_FILE (entry->d_name))
- continue;
-
---- 2139,2143 ----
- if (filename_len == 0)
- {
-! if (_rl_match_hidden_files == 0 && HIDDEN_FILE (convfn))
- continue;
-
-***************
-*** 2220,2224 ****
- }
-
-! strcpy (temp + dirlen, entry->d_name);
- }
- else
---- 2220,2224 ----
- }
-
-! strcpy (temp + dirlen, convfn);
- }
- else
-*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
-***************
-*** 26,30 ****
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 1
-
- #endif /* _PATCHLEVEL_H_ */
---- 26,30 ----
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 2
-
- #endif /* _PATCHLEVEL_H_ */
--- a/components/bash/bash41-003.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
- BASH PATCH REPORT
- =================
-
-Bash-Release: 4.1
-Patch-ID: bash41-003
-
-Bug-Reported-by: [email protected]
-Bug-Reference-ID: <[email protected]>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-01/msg00135.html
-
-Bug-Description:
-
-If command completion is attempted on a word with a quoted globbing
-character (e.g., `*' or `?'), bash can reference a NULL pointer and
-dump core.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/bashline.c 2009-10-24 14:10:19.000000000 -0400
---- bashline.c 2010-01-30 21:53:49.000000000 -0500
-***************
-*** 1681,1685 ****
- characters in the common prefix are bad) will ever be returned on
- regular completion. */
-! if (glob_pattern_p (hint))
- {
- if (state == 0)
---- 1681,1685 ----
- characters in the common prefix are bad) will ever be returned on
- regular completion. */
-! if (globpat)
- {
- if (state == 0)
-*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
-***************
-*** 26,30 ****
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 2
-
- #endif /* _PATCHLEVEL_H_ */
---- 26,30 ----
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 3
-
- #endif /* _PATCHLEVEL_H_ */
--- a/components/bash/bash41-004.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
- BASH PATCH REPORT
- =================
-
-Bash-Release: 4.1
-Patch-ID: bash41-004
-
-Bug-Reported-by: Crestez Dan Leonard <[email protected]>
-Bug-Reference-ID: <1265592839.30682.21.camel@deskbox>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-02/msg00034.html
-
-Bug-Description:
-
-When running in Posix mode and executing a shell function without local
-variables, bash will not propagate a variable in a special builtin's temporary
-environment to have global scope.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/variables.c 2009-11-03 14:13:58.000000000 -0500
---- variables.c 2010-02-08 17:36:18.000000000 -0500
-***************
-*** 3809,3812 ****
---- 3809,3817 ----
- if (tempvar_p (var) && (posixly_correct || (var->attributes & att_propagate)))
- {
-+ /* Make sure we have a hash table to store the variable in while it is
-+ being propagated down to the global variables table. Create one if
-+ we have to */
-+ if ((vc_isfuncenv (shell_variables) || vc_istempenv (shell_variables)) && shell_variables->table == 0)
-+ shell_variables->table = hash_create (0);
- /* XXX - should we set v->context here? */
- v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0);
-*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
-***************
-*** 26,30 ****
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 3
-
- #endif /* _PATCHLEVEL_H_ */
---- 26,30 ----
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 4
-
- #endif /* _PATCHLEVEL_H_ */
--- a/components/bash/bash41-005.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
- BASH PATCH REPORT
- =================
-
-Bash-Release: 4.1
-Patch-ID: bash41-005
-
-Bug-Reported-by: [email protected]
-Bug-Reference-ID: <[email protected]>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-02/msg00132.html
-
-Bug-Description:
-
-When the `read' builtin times out after the timeout specified with -t is
-exceeded, it does not reset the flags that tell signal handlers to process
-signals immediately instead of deferring their handling. This can result
-in unsafe functions being called from signal handlers, which can cause bash
-to hang or dump core.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/builtins/read.def 2009-10-08 11:35:46.000000000 -0400
---- builtins/read.def 2010-03-17 17:35:39.000000000 -0400
-***************
-*** 616,621 ****
- zsyncfd (fd);
-
-- interrupt_immediately--;
-- terminate_immediately--;
- discard_unwind_frame ("read_builtin");
-
---- 616,619 ----
-***************
-*** 624,627 ****
---- 622,628 ----
- assign_vars:
-
-+ interrupt_immediately--;
-+ terminate_immediately--;
-+
- #if defined (ARRAY_VARS)
- /* If -a was given, take the string read, break it into a list of words,
-*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
-***************
-*** 26,30 ****
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 4
-
- #endif /* _PATCHLEVEL_H_ */
---- 26,30 ----
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 5
-
- #endif /* _PATCHLEVEL_H_ */
--- a/components/bash/bash41-006.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
- BASH PATCH REPORT
- =================
-
-Bash-Release: 4.1
-Patch-ID: bash41-006
-
-Bug-Reported-by: Mike Frysinger <[email protected]>
-Bug-Reference-ID: <[email protected]>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-03/msg00063.html
-
-Bug-Description:
-
-Bash did not correctly print/reproduce here documents attached to commands
-inside compound commands such as for and while. This affected the
-execution of such commands inside a shell function when the function
-definition is saved and later restored using `.' or `eval'.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/print_cmd.c 2009-09-16 15:32:26.000000000 -0400
---- print_cmd.c 2010-03-22 21:15:30.000000000 -0400
-***************
-*** 114,117 ****
---- 114,123 ----
- #define CHECK_XTRACE_FP xtrace_fp = (xtrace_fp ? xtrace_fp : stderr)
-
-+ #define PRINT_DEFERRED_HEREDOCS(x) \
-+ do { \
-+ if (deferred_heredocs) \
-+ print_deferred_heredocs (x); \
-+ } while (0)
-+
- /* Non-zero means the stuff being printed is inside of a function def. */
- static int inside_function_def;
-***************
-*** 561,571 ****
- {
- print_for_command_head (for_command);
--
- cprintf (";");
- newline ("do\n");
- indentation += indentation_amount;
- make_command_string_internal (for_command->action);
- semicolon ();
- indentation -= indentation_amount;
- newline ("done");
- }
---- 566,578 ----
- {
- print_for_command_head (for_command);
- cprintf (";");
- newline ("do\n");
-+
- indentation += indentation_amount;
- make_command_string_internal (for_command->action);
-+ PRINT_DEFERRED_HEREDOCS ("");
- semicolon ();
- indentation -= indentation_amount;
-+
- newline ("done");
- }
-*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
-***************
-*** 26,30 ****
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 5
-
- #endif /* _PATCHLEVEL_H_ */
---- 26,30 ----
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 6
-
- #endif /* _PATCHLEVEL_H_ */
--- a/components/bash/bash41-007.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
- BASH PATCH REPORT
- =================
-
-Bash-Release: 4.1
-Patch-ID: bash41-007
-
-Bug-Reported-by: Rob Robason <[email protected]>
-Bug-Reference-ID: <[email protected]>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-03/msg00089.html
-
-Bug-Description:
-
-A typo caused bash to not honor a precision specification in a printf
-format.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/builtins/printf.def 2010-01-18 10:50:22.000000000 -0500
---- builtins/printf.def 2010-03-25 09:40:56.000000000 -0400
-***************
-*** 118,122 ****
- nw = vflag ? vbprintf (f, fieldwidth, func) : printf (f, fieldwidth, func); \
- else if (have_precision) \
-! nw = vflag ? vbprintf (f, precision, func) : printf (f, fieldwidth, func); \
- else \
- nw = vflag ? vbprintf (f, func) : printf (f, func); \
---- 118,122 ----
- nw = vflag ? vbprintf (f, fieldwidth, func) : printf (f, fieldwidth, func); \
- else if (have_precision) \
-! nw = vflag ? vbprintf (f, precision, func) : printf (f, precision, func); \
- else \
- nw = vflag ? vbprintf (f, func) : printf (f, func); \
-*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
-***************
-*** 26,30 ****
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 6
-
- #endif /* _PATCHLEVEL_H_ */
---- 26,30 ----
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 7
-
- #endif /* _PATCHLEVEL_H_ */
--- a/components/bash/bash41-008.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
- BASH PATCH REPORT
- =================
-
-Bash-Release: 4.1
-Patch-ID: bash41-008
-
-Bug-Reported-by: Dennis van Dok <[email protected]>
-Bug-Reference-ID: <[email protected]>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-04/msg00038.html
-
-Bug-Description:
-
-When declaring an associative array and implicitly assigning a value
-to element "0", bash does not correctly allocate memory, leading to
-a segmentation violation when that element or the array itself is
-unset.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/builtins/declare.def 2009-11-25 19:42:00.000000000 -0500
---- builtins/declare.def 2010-05-30 18:25:21.000000000 -0400
-***************
-*** 513,517 ****
- /* let bind_{array,assoc}_variable take care of this. */
- if (assoc_p (var))
-! bind_assoc_variable (var, name, "0", value, aflags);
- else
- bind_array_variable (name, 0, value, aflags);
---- 519,523 ----
- /* let bind_{array,assoc}_variable take care of this. */
- if (assoc_p (var))
-! bind_assoc_variable (var, name, savestring ("0"), value, aflags);
- else
- bind_array_variable (name, 0, value, aflags);
-*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
-***************
-*** 26,30 ****
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 7
-
- #endif /* _PATCHLEVEL_H_ */
---- 26,30 ----
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 8
-
- #endif /* _PATCHLEVEL_H_ */
--- a/components/bash/bash41-009.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
- BASH PATCH REPORT
- =================
-
-Bash-Release: 4.1
-Patch-ID: bash41-009
-
-Bug-Reported-by: Tomas Trnka <[email protected]>
-Bug-Reference-ID: <[email protected]>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-03/msg00090.html
-
-Bug-Description:
-
-An arriving SIGCHLD will interrupt `slow' system calls such as write(2) to
-or read(2) from a terminal. This results in an error message and truncated
-input or output.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/sig.c Fri Aug 14 16:31:52 2009
---- sig.c Fri Mar 26 22:34:11 2010
-***************
-*** 655,660 ****
---- 655,663 ----
- act.sa_flags |= SA_INTERRUPT; /* XXX */
- else
- act.sa_flags |= SA_RESTART; /* XXX */
-+ #else
-+ if (sig == SIGCHLD)
-+ act.sa_flags |= SA_RESTART;
- #endif
- sigemptyset (&act.sa_mask);
- sigemptyset (&oact.sa_mask);
-*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
-***************
-*** 26,30 ****
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 8
-
- #endif /* _PATCHLEVEL_H_ */
---- 26,30 ----
- looks for to find the patch level (for the sccs version string). */
-
-! #define PATCHLEVEL 9
-
- #endif /* _PATCHLEVEL_H_ */
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash41-001.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,48 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.1
+Patch-ID: bash41-001
+
+Bug-Reported-by: Yann Rouillard <[email protected]>
+Bug-Reference-ID: <[email protected]>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-01/msg00018.html
+
+Bug-Description:
+
+A prototype for vsnprintf was incorrect, and caused compilation failures
+on systems that did not have a suitable vsnprintf, but had a declaration in
+one of the system header files.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.1-patched/builtins/printf.def 2009-11-20 15:31:23.000000000 -0500
+--- builtins/printf.def 2010-01-07 08:50:06.000000000 -0500
+***************
+*** 173,177 ****
+
+ #if !HAVE_VSNPRINTF
+! extern int vsnprintf __P((char *, size_t, const char *, ...)) __attribute__((__format__ (printf, 3, 4)));
+ #endif
+
+--- 173,177 ----
+
+ #if !HAVE_VSNPRINTF
+! extern int vsnprintf __P((char *, size_t, const char *, va_list)) __attribute__((__format__ (printf, 3, 0)));
+ #endif
+
+*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
+--- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 0
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 1
+
+ #endif /* _PATCHLEVEL_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash41-002.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,65 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.1
+Patch-ID: bash41-002
+
+Bug-Reported-by: [email protected]
+Bug-Reference-ID: <[email protected]>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-01/msg00017.html
+
+Bug-Description:
+
+Bash-4.1/Readline-6.1 introduced a hook function that allows applications
+to rewrite or modify filenames read from the file system before comparing
+them with a word to be completed. The converted filename, if it matches,
+needs to be inserted into the line buffer, replacing the original contents.
+
+This fixes a completion bug on Mac OS X involving filenames containing
+UTF-8 characters.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.1-patched/lib/readline/complete.c 2009-11-29 18:39:30.000000000 -0500
+--- lib/readline/complete.c 2010-01-06 08:30:23.000000000 -0500
+***************
+*** 2139,2143 ****
+ if (filename_len == 0)
+ {
+! if (_rl_match_hidden_files == 0 && HIDDEN_FILE (entry->d_name))
+ continue;
+
+--- 2139,2143 ----
+ if (filename_len == 0)
+ {
+! if (_rl_match_hidden_files == 0 && HIDDEN_FILE (convfn))
+ continue;
+
+***************
+*** 2220,2224 ****
+ }
+
+! strcpy (temp + dirlen, entry->d_name);
+ }
+ else
+--- 2220,2224 ----
+ }
+
+! strcpy (temp + dirlen, convfn);
+ }
+ else
+*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
+--- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 1
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 2
+
+ #endif /* _PATCHLEVEL_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash41-003.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,48 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.1
+Patch-ID: bash41-003
+
+Bug-Reported-by: [email protected]
+Bug-Reference-ID: <[email protected]>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-01/msg00135.html
+
+Bug-Description:
+
+If command completion is attempted on a word with a quoted globbing
+character (e.g., `*' or `?'), bash can reference a NULL pointer and
+dump core.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.1-patched/bashline.c 2009-10-24 14:10:19.000000000 -0400
+--- bashline.c 2010-01-30 21:53:49.000000000 -0500
+***************
+*** 1681,1685 ****
+ characters in the common prefix are bad) will ever be returned on
+ regular completion. */
+! if (glob_pattern_p (hint))
+ {
+ if (state == 0)
+--- 1681,1685 ----
+ characters in the common prefix are bad) will ever be returned on
+ regular completion. */
+! if (globpat)
+ {
+ if (state == 0)
+*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
+--- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 2
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 3
+
+ #endif /* _PATCHLEVEL_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash41-004.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,47 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.1
+Patch-ID: bash41-004
+
+Bug-Reported-by: Crestez Dan Leonard <[email protected]>
+Bug-Reference-ID: <1265592839.30682.21.camel@deskbox>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-02/msg00034.html
+
+Bug-Description:
+
+When running in Posix mode and executing a shell function without local
+variables, bash will not propagate a variable in a special builtin's temporary
+environment to have global scope.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.1-patched/variables.c 2009-11-03 14:13:58.000000000 -0500
+--- variables.c 2010-02-08 17:36:18.000000000 -0500
+***************
+*** 3809,3812 ****
+--- 3809,3817 ----
+ if (tempvar_p (var) && (posixly_correct || (var->attributes & att_propagate)))
+ {
++ /* Make sure we have a hash table to store the variable in while it is
++ being propagated down to the global variables table. Create one if
++ we have to */
++ if ((vc_isfuncenv (shell_variables) || vc_istempenv (shell_variables)) && shell_variables->table == 0)
++ shell_variables->table = hash_create (0);
+ /* XXX - should we set v->context here? */
+ v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0);
+*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
+--- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 3
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 4
+
+ #endif /* _PATCHLEVEL_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash41-005.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,56 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.1
+Patch-ID: bash41-005
+
+Bug-Reported-by: [email protected]
+Bug-Reference-ID: <[email protected]>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-02/msg00132.html
+
+Bug-Description:
+
+When the `read' builtin times out after the timeout specified with -t is
+exceeded, it does not reset the flags that tell signal handlers to process
+signals immediately instead of deferring their handling. This can result
+in unsafe functions being called from signal handlers, which can cause bash
+to hang or dump core.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.1-patched/builtins/read.def 2009-10-08 11:35:46.000000000 -0400
+--- builtins/read.def 2010-03-17 17:35:39.000000000 -0400
+***************
+*** 616,621 ****
+ zsyncfd (fd);
+
+- interrupt_immediately--;
+- terminate_immediately--;
+ discard_unwind_frame ("read_builtin");
+
+--- 616,619 ----
+***************
+*** 624,627 ****
+--- 622,628 ----
+ assign_vars:
+
++ interrupt_immediately--;
++ terminate_immediately--;
++
+ #if defined (ARRAY_VARS)
+ /* If -a was given, take the string read, break it into a list of words,
+*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
+--- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 4
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 5
+
+ #endif /* _PATCHLEVEL_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash41-006.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,76 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.1
+Patch-ID: bash41-006
+
+Bug-Reported-by: Mike Frysinger <[email protected]>
+Bug-Reference-ID: <[email protected]>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-03/msg00063.html
+
+Bug-Description:
+
+Bash did not correctly print/reproduce here documents attached to commands
+inside compound commands such as for and while. This affected the
+execution of such commands inside a shell function when the function
+definition is saved and later restored using `.' or `eval'.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.1-patched/print_cmd.c 2009-09-16 15:32:26.000000000 -0400
+--- print_cmd.c 2010-03-22 21:15:30.000000000 -0400
+***************
+*** 114,117 ****
+--- 114,123 ----
+ #define CHECK_XTRACE_FP xtrace_fp = (xtrace_fp ? xtrace_fp : stderr)
+
++ #define PRINT_DEFERRED_HEREDOCS(x) \
++ do { \
++ if (deferred_heredocs) \
++ print_deferred_heredocs (x); \
++ } while (0)
++
+ /* Non-zero means the stuff being printed is inside of a function def. */
+ static int inside_function_def;
+***************
+*** 561,571 ****
+ {
+ print_for_command_head (for_command);
+-
+ cprintf (";");
+ newline ("do\n");
+ indentation += indentation_amount;
+ make_command_string_internal (for_command->action);
+ semicolon ();
+ indentation -= indentation_amount;
+ newline ("done");
+ }
+--- 566,578 ----
+ {
+ print_for_command_head (for_command);
+ cprintf (";");
+ newline ("do\n");
++
+ indentation += indentation_amount;
+ make_command_string_internal (for_command->action);
++ PRINT_DEFERRED_HEREDOCS ("");
+ semicolon ();
+ indentation -= indentation_amount;
++
+ newline ("done");
+ }
+*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
+--- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 5
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 6
+
+ #endif /* _PATCHLEVEL_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash41-007.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,47 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.1
+Patch-ID: bash41-007
+
+Bug-Reported-by: Rob Robason <[email protected]>
+Bug-Reference-ID: <[email protected]>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-03/msg00089.html
+
+Bug-Description:
+
+A typo caused bash to not honor a precision specification in a printf
+format.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.1-patched/builtins/printf.def 2010-01-18 10:50:22.000000000 -0500
+--- builtins/printf.def 2010-03-25 09:40:56.000000000 -0400
+***************
+*** 118,122 ****
+ nw = vflag ? vbprintf (f, fieldwidth, func) : printf (f, fieldwidth, func); \
+ else if (have_precision) \
+! nw = vflag ? vbprintf (f, precision, func) : printf (f, fieldwidth, func); \
+ else \
+ nw = vflag ? vbprintf (f, func) : printf (f, func); \
+--- 118,122 ----
+ nw = vflag ? vbprintf (f, fieldwidth, func) : printf (f, fieldwidth, func); \
+ else if (have_precision) \
+! nw = vflag ? vbprintf (f, precision, func) : printf (f, precision, func); \
+ else \
+ nw = vflag ? vbprintf (f, func) : printf (f, func); \
+*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
+--- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 6
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 7
+
+ #endif /* _PATCHLEVEL_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash41-008.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,49 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.1
+Patch-ID: bash41-008
+
+Bug-Reported-by: Dennis van Dok <[email protected]>
+Bug-Reference-ID: <[email protected]>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-04/msg00038.html
+
+Bug-Description:
+
+When declaring an associative array and implicitly assigning a value
+to element "0", bash does not correctly allocate memory, leading to
+a segmentation violation when that element or the array itself is
+unset.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.1-patched/builtins/declare.def 2009-11-25 19:42:00.000000000 -0500
+--- builtins/declare.def 2010-05-30 18:25:21.000000000 -0400
+***************
+*** 513,517 ****
+ /* let bind_{array,assoc}_variable take care of this. */
+ if (assoc_p (var))
+! bind_assoc_variable (var, name, "0", value, aflags);
+ else
+ bind_array_variable (name, 0, value, aflags);
+--- 519,523 ----
+ /* let bind_{array,assoc}_variable take care of this. */
+ if (assoc_p (var))
+! bind_assoc_variable (var, name, savestring ("0"), value, aflags);
+ else
+ bind_array_variable (name, 0, value, aflags);
+*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
+--- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 7
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 8
+
+ #endif /* _PATCHLEVEL_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash41-009.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,48 @@
+ BASH PATCH REPORT
+ =================
+
+Bash-Release: 4.1
+Patch-ID: bash41-009
+
+Bug-Reported-by: Tomas Trnka <[email protected]>
+Bug-Reference-ID: <[email protected]>
+Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-03/msg00090.html
+
+Bug-Description:
+
+An arriving SIGCHLD will interrupt `slow' system calls such as write(2) to
+or read(2) from a terminal. This results in an error message and truncated
+input or output.
+
+Patch (apply with `patch -p0'):
+
+*** ../bash-4.1-patched/sig.c Fri Aug 14 16:31:52 2009
+--- sig.c Fri Mar 26 22:34:11 2010
+***************
+*** 655,660 ****
+--- 655,663 ----
+ act.sa_flags |= SA_INTERRUPT; /* XXX */
+ else
+ act.sa_flags |= SA_RESTART; /* XXX */
++ #else
++ if (sig == SIGCHLD)
++ act.sa_flags |= SA_RESTART;
+ #endif
+ sigemptyset (&act.sa_mask);
+ sigemptyset (&oact.sa_mask);
+*** ../bash-4.1-patched/patchlevel.h 2009-10-01 16:39:22.000000000 -0400
+--- patchlevel.h 2010-01-14 09:38:08.000000000 -0500
+***************
+*** 26,30 ****
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 8
+
+ #endif /* _PATCHLEVEL_H_ */
+--- 26,30 ----
+ looks for to find the patch level (for the sccs version string). */
+
+! #define PATCHLEVEL 9
+
+ #endif /* _PATCHLEVEL_H_ */
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-000.config.h.in.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,11 @@
+--- config.h.in 2009-08-18 20:34:36.000000000 -0700
++++ config.h.in 2010-09-01 10:21:00.756734104 -0700
+@@ -21,6 +21,8 @@
+ #ifndef _CONFIG_H_
+ #define _CONFIG_H_
+
++#include "config-top.h"
++
+ /* Configuration feature settings controllable by autoconf. */
+
+ /* Define JOB_CONTROL if your operating system supports
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-001.config-top.h.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,37 @@
+--- config-top.h 2009-12-22 12:29:39.000000000 -0800
++++ config-top.h 2010-09-01 10:24:03.070928602 -0700
+@@ -54,14 +54,14 @@
+ /* The default value of the PATH variable. */
+ #ifndef DEFAULT_PATH_VALUE
+ #define DEFAULT_PATH_VALUE \
+- "/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:."
++ "/usr/gnu/bin:/bin:/usr/bin:/sbin:/usr/sbin:."
+ #endif
+
+ /* The value for PATH when invoking `command -p'. This is only used when
+ the Posix.2 confstr () function, or CS_PATH define are not present. */
+ #ifndef STANDARD_UTILS_PATH
+ #define STANDARD_UTILS_PATH \
+- "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc"
++ "/usr/gnu/bin:/bin:/usr/bin:/sbin:/usr/sbin:/etc:/etc/bash"
+ #endif
+
+ /* Default primary and secondary prompt strings. */
+@@ -75,14 +75,14 @@
+ #define KSH_COMPATIBLE_SELECT
+
+ /* System-wide .bashrc file for interactive shells. */
+-/* #define SYS_BASHRC "/etc/bash.bashrc" */
++#define SYS_BASHRC "/etc/bash/bashrc"
+
+ /* System-wide .bash_logout for login shells. */
+-/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
++#define SYS_BASH_LOGOUT "/etc/bash/bash_logout"
+
+ /* Define this to make non-interactive shells begun with argv[0][0] == '-'
+ run the startup files when not in posix mode. */
+-/* #define NON_INTERACTIVE_LOGIN_SHELLS */
++#define NON_INTERACTIVE_LOGIN_SHELLS 1
+
+ /* Define this if you want bash to try to check whether it's being run by
+ sshd and source the .bashrc if so (like the rshd behavior). This checks
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-002.Makefile.in.3.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,35 @@
+--- Makefile.in 2009-12-30 10:05:40.000000000 -0800
++++ Makefile.in 2011-02-04 16:31:01.659698136 -0800
+@@ -137,7 +137,7 @@
+ STATIC_LD = @STATIC_LD@
+ LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
+
+-SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OSTYPE='"$(OS)"' -DCONF_MACHTYPE='"$(MACHTYPE)"' -DCONF_VENDOR='"$(VENDOR)"' $(LOCALE_DEFS)
++SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OSTYPE='"$(OS)"' -DCONF_MACHTYPE='"$(MACHTYPE)"' -DCONF_VENDOR='"$(VENDOR)"' $(LOCALE_DEFS) $(CFLAGS)
+
+ BASE_CCFLAGS = $(PROFILE_FLAGS) $(SYSTEM_FLAGS) $(LOCAL_DEFS) \
+ $(DEFS) $(LOCAL_CFLAGS) $(INCLUDES)
+@@ -535,7 +535,7 @@
+
+ $(Program): .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP)
+ $(RM) $@
+- $(PURIFY) $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS)
++ $(PURIFY) $(CC) $(CFLAGS) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS) $(LD_OPTIONS) -s
+ ls -l $(Program)
+ -$(SIZE) $(Program)
+
+@@ -549,10 +549,10 @@
+ @echo
+
+ bashbug: $(SUPPORT_SRC)bashbug.sh config.h Makefile $(VERSPROG)
+- @sed -e "s%!MACHINE!%$(Machine)%" -e "s%!OS!%$(OS)%" \
+- -e "s%!CFLAGS!%$(CCFLAGS)%" -e "s%!CC!%$(CC)%" \
+- -e "s%!RELEASE!%$(Version)%" -e "s%!PATCHLEVEL!%$(PatchLevel)%" \
+- -e "s%!MACHTYPE!%$(MACHTYPE)%" -e "s%!RELSTATUS!%$(RELSTATUS)%" \
++ @sed -e "s^!MACHINE!^$(Machine)^" -e "s^!OS!^$(OS)^" \
++ -e "s^!CFLAGS!^$(CCFLAGS)^" -e "s^!CC!^$(CC)^" \
++ -e "s^!RELEASE!^$(Version)^" -e "s^!PATCHLEVEL!^$(PatchLevel)^" \
++ -e "s^!MACHTYPE!^$(MACHTYPE)^" -e "s^!RELSTATUS!^$(RELSTATUS)^" \
+ $(SUPPORT_SRC)bashbug.sh > $@
+ @chmod a+rx bashbug
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-003.glob.c.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,13 @@
+--- lib/glob/glob.c 2009-11-14 15:39:30.000000000 -0800
++++ lib/glob/glob.c 2010-09-01 10:28:10.161379481 -0700
+@@ -34,6 +34,10 @@
+ # include <unistd.h>
+ #endif
+
++#if defined (HAVE_ALLOCA) && defined (HAVE_ALLOCA_H)
++# include <alloca.h>
++#endif
++
+ #include "bashansi.h"
+ #include "posixdir.h"
+ #include "posixstat.h"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-004.snprintf.c.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,11 @@
+--- lib/sh/snprintf.c 2008-08-12 12:02:14.000000000 -0400
++++ lib/sh/snprintf.c 2009-08-10 15:16:30.000000000 -0400
+@@ -116,6 +116,8 @@
+ # include <locale.h>
+ #endif
+
++#include <math.h>
++
+ #include "stdc.h"
+ #include <shmbutil.h>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-005.variables.c.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,17 @@
+--- variables.c 2009-01-04 14:32:46.000000000 -0500
++++ variables.c 2009-08-15 14:53:56.426776000 -0400
+@@ -402,14 +402,10 @@
+ /* Now make our own defaults in case the vars that we think are
+ important are missing. */
+ temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE);
+-#if 0
+ set_auto_export (temp_var); /* XXX */
+-#endif
+
+ temp_var = set_if_not ("TERM", "dumb");
+-#if 0
+ set_auto_export (temp_var); /* XXX */
+-#endif
+
+ #if defined (__QNX__)
+ /* set node id -- don't import it from the environment */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-006.signames.c.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,17 @@
+--- support/signames.c 2008-08-13 08:31:48.000000000 -0400
++++ support/signames.c 2009-08-15 16:40:01.729682000 -0400
+@@ -212,6 +212,14 @@
+ signal_names[SIGXRES] = "SIGXRES";
+ #endif
+
++#if defined (SIGJVM1) /* Solaris Java Virtual Machine 1 */
++ signal_names[SIGJVM1] = "SIGJVM1";
++#endif
++
++#if defined (SIGJVM2) /* Solaris Java Virtual Machine 2 */
++ signal_names[SIGJVM2] = "SIGJVM2";
++#endif
++
+ /* HP-UX */
+ #if defined (SIGDIL) /* DIL signal (?) */
+ signal_names[SIGDIL] = "SIGDIL";
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-007.rlprivate.h.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,21 @@
+--- lib/readline/rlprivate.h 2009-01-22 21:56:49.000000000 -0500
++++ lib/readline/rlprivate.h 2009-08-16 10:55:56.178609000 -0400
+@@ -23,6 +23,18 @@
+ #if !defined (_RL_PRIVATE_H_)
+ #define _RL_PRIVATE_H_
+
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#if defined(HANDLE_MULTIBYTE)
++
++#include <limits.h>
++#include <wchar.h>
++#include <wctype.h>
++
++#endif /* HANDLE_MULTIBYTE */
++
+ #include "rlconf.h" /* for VISIBLE_STATS */
+ #include "rlstdc.h"
+ #include "posixjmp.h" /* defines procenv_t */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-008.xmbsrtowcs.c.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,11 @@
+--- lib/glob/xmbsrtowcs.c 2008-08-12 10:17:54.000000000 -0400
++++ lib/glob/xmbsrtowcs.c 2009-08-10 15:46:18.000000000 -0400
+@@ -30,7 +30,7 @@
+ #if HANDLE_MULTIBYTE
+
+ #ifndef FREE
+-# define FREE(x) do { if (x) free (x); } while (0)
++# define FREE(x) do { if (x) free (x); x = 0; } while (0)
+ #endif
+ /* On some locales (ex. ja_JP.sjis), mbsrtowc doesn't convert 0x5c to U<0x5c>.
+ So, this function is made for converting 0x5c to U<0x5c>. */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-009.configure.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,321 @@
+--- configure 2009-12-29 05:34:51.000000000 -0800
++++ configure 2010-09-01 10:45:06.225859891 -0700
+@@ -1,4 +1,4 @@
+-#! /bin/sh
++#! /bin/bash
+ # From configure.in for Bash 4.1, version 4.019.
+ # Guess values for system-dependent variables and create Makefiles.
+ # Generated by GNU Autoconf 2.63 for bash 4.1-release.
+@@ -13,6 +13,8 @@
+ ## M4sh Initialization. ##
+ ## --------------------- ##
+
++export LD_OPTIONS="-lc -lm -lgen -lsocket -lnsl -lresolv -z ignore"
++
+ # Be more Bourne compatible
+ DUALCASE=1; export DUALCASE # for MKS sh
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+@@ -592,7 +594,7 @@
+ subdirs=
+ MFLAGS=
+ MAKEFLAGS=
+-SHELL=${CONFIG_SHELL-/bin/sh}
++SHELL=${CONFIG_SHELL-/bin/bash}
+
+ # Identity of this package.
+ PACKAGE_NAME='bash'
+@@ -3500,7 +3502,7 @@
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+- CFLAGS="-g"
++ CFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -3579,7 +3581,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_c_werror_flag=$ac_save_c_werror_flag
+- CFLAGS="-g"
++ CFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -3638,7 +3640,7 @@
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+- CFLAGS="-g"
++ CFLAGS=""
+ fi
+ else
+ if test "$GCC" = yes; then
+@@ -5092,7 +5094,7 @@
+
+ if test -z "$CC_FOR_BUILD"; then
+ if test "x$cross_compiling" = "xno"; then
+- CC_FOR_BUILD='$(CC)'
++ CC_FOR_BUILD='$(CC) $(CPPFLAGS) $(CFLAGS)'
+ else
+ CC_FOR_BUILD=gcc
+ fi
+@@ -5100,7 +5102,7 @@
+
+
+
+-test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
++test -z "$CFLAGS" && CFLAGS="${CFLAGS}" auto_cflags=1
+
+ test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2"
+
+@@ -5132,7 +5134,7 @@
+ LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""}
+ fi
+
+-test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="-g"
++test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD=""
+
+
+
+@@ -5257,9 +5259,14 @@
+ int
+ main ()
+ {
++#if defined(sun) || defined(__sun) || defined(__sun__)
++#error "we want to use libcurses."
++return 255;
++#else
+ return tgetent ();
+ ;
+ return 0;
++#endif
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+@@ -6164,7 +6171,7 @@
+ $as_echo_n "(cached) " >&6
+ else
+ cat >conftest.make <<\_ACEOF
+-SHELL = /bin/sh
++SHELL = /bin/bash
+ all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+ _ACEOF
+@@ -6190,7 +6197,7 @@
+
+ case "$host_os" in
+ opennt*|interix*) MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;;
+-*) MAKE_SHELL=/bin/sh ;;
++*) MAKE_SHELL=/bin/bash ;;
+ esac
+
+
+@@ -7177,7 +7184,7 @@
+ # Prepare PATH_SEPARATOR.
+ # The user is always right.
+ if test "${PATH_SEPARATOR+set}" != set; then
+- echo "#! /bin/sh" >conf$$.sh
++ echo "#! /bin/bash" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+@@ -7191,7 +7198,7 @@
+ # Find out how to test for executable files. Don't use a zero-byte file,
+ # as systems may use methods other than mode bits to determine executability.
+ cat >conf$$.file <<_ASEOF
+-#! /bin/sh
++#! /bin/bash
+ exit 0
+ _ASEOF
+ chmod +x conf$$.file
+@@ -7288,7 +7295,7 @@
+ # Prepare PATH_SEPARATOR.
+ # The user is always right.
+ if test "${PATH_SEPARATOR+set}" != set; then
+- echo "#! /bin/sh" >conf$$.sh
++ echo "#! /bin/bash" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+@@ -7302,7 +7309,7 @@
+ # Find out how to test for executable files. Don't use a zero-byte file,
+ # as systems may use methods other than mode bits to determine executability.
+ cat >conf$$.file <<_ASEOF
+-#! /bin/sh
++#! /bin/bash
+ exit 0
+ _ASEOF
+ chmod +x conf$$.file
+@@ -7359,7 +7366,7 @@
+ # Prepare PATH_SEPARATOR.
+ # The user is always right.
+ if test "${PATH_SEPARATOR+set}" != set; then
+- echo "#! /bin/sh" >conf$$.sh
++ echo "#! /bin/bash" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+@@ -7373,7 +7380,7 @@
+ # Find out how to test for executable files. Don't use a zero-byte file,
+ # as systems may use methods other than mode bits to determine executability.
+ cat >conf$$.file <<_ASEOF
+-#! /bin/sh
++#! /bin/bash
+ exit 0
+ _ASEOF
+ chmod +x conf$$.file
+@@ -8992,7 +8999,7 @@
+ # Prepare PATH_SEPARATOR.
+ # The user is always right.
+ if test "${PATH_SEPARATOR+set}" != set; then
+- echo "#! /bin/sh" >conf$$.sh
++ echo "#! /bin/bash" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+@@ -9102,7 +9109,7 @@
+ else
+
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+- ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
++ ${CONFIG_SHELL-/bin/bash} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+@@ -13042,39 +13049,18 @@
+ /* end confdefs.h. */
+ /* Define isinf to an innocuous variant, in case <limits.h> declares isinf.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+-#define isinf innocuous_isinf
+-
+-/* System header to define __stub macros and hopefully few prototypes,
+- which can conflict with char isinf (); below.
+- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+- <limits.h> exists even on freestanding compilers. */
+-
+-#ifdef __STDC__
+-# include <limits.h>
+-#else
+-# include <assert.h>
+-#endif
+-
+-#undef isinf
+-
++#include <math.h>
+ /* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-char isinf ();
+ /* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+-#if defined __stub_isinf || defined __stub___isinf
+-choke me
+-#endif
+
+ int
+ main ()
+ {
+-return isinf ();
++return isinf(0.0);
+ ;
+ return 0;
+ }
+@@ -13134,39 +13120,26 @@
+ /* end confdefs.h. */
+ /* Define isnan to an innocuous variant, in case <limits.h> declares isnan.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+-#define isnan innocuous_isnan
+
+ /* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char isnan (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+-#ifdef __STDC__
+-# include <limits.h>
+-#else
+-# include <assert.h>
+-#endif
+-
+-#undef isnan
++#include <math.h>
+
+ /* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-char isnan ();
++
+ /* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+-#if defined __stub_isnan || defined __stub___isnan
+-choke me
+-#endif
+
+ int
+ main ()
+ {
+-return isnan ();
++return isnan(0.0);
+ ;
+ return 0;
+ }
+@@ -25521,7 +25494,7 @@
+ exit 69
+ ' >conftest
+ chmod u+x conftest
+-(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null 2>&1)
++(SHELL=/bin/bash; export SHELL; ./conftest >/dev/null 2>&1)
+ if test $? -ne 69; then
+ ac_cv_sys_interpreter=yes
+ else
+@@ -30117,9 +30090,14 @@
+ int
+ main ()
+ {
++#if defined(sun) || defined(__sun) || defined(__sun__)
++#error "we want to use libcurses"
++return 255;
++#else
+ return tgetent ();
+ ;
+ return 0;
++#endif
+ }
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+@@ -30302,7 +30280,7 @@
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lcurses $LIBS"
++LIBS="/usr/lib/libcurses.so.1 $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -30468,7 +30446,7 @@
+ TERMCAP_LIB=
+ TERMCAP_DEP=
+ else
+-TERMCAP_LIB=-lcurses
++TERMCAP_LIB=/usr/lib/libcurses.so.1
+ TERMCAP_DEP=
+ fi
+
+@@ -30676,7 +30654,7 @@
+ then
+ { $as_echo "$as_me:$LINENO: checking shared object configuration for loadable builtins" >&5
+ $as_echo_n "checking shared object configuration for loadable builtins... " >&6; }
+- eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"`
++ eval `${CONFIG_SHELL-/bin/bash} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"`
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-010.input.c.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,13 @@
+--- lib/readline/input.c 2009-04-19 10:12:03.000000000 -0700
++++ lib/readline/input.c 2010-09-01 10:46:23.386144948 -0700
+@@ -51,6 +51,10 @@
+ # include <sys/ioctl.h>
+ #endif
+
++#if defined(SOLARIS)
++# include <sys/filio.h>
++#endif
++
+ #include <stdio.h>
+ #include <errno.h>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-011.input_avail.c.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,13 @@
+--- lib/sh/input_avail.c 2009-04-19 10:01:14.000000000 -0700
++++ lib/sh/input_avail.c 2010-09-01 10:47:30.418016819 -0700
+@@ -45,6 +45,10 @@
+ # include <sys/ioctl.h>
+ #endif
+
++#if defined(SOLARIS)
++# include <sys/filio.h> /* Solaris FIONREAD */
++#endif
++
+ #include <stdio.h>
+ #include <errno.h>
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-012.rlconf.h.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,11 @@
+--- lib/readline/rlconf.h 2009-01-04 11:32:33.000000000 -0800
++++ lib/readline/rlconf.h 2010-09-01 10:48:13.018894232 -0700
+@@ -39,7 +39,7 @@
+ #define DEFAULT_INPUTRC "~/.inputrc"
+
+ /* The ultimate last-ditch filenname for an init file -- system-wide. */
+-#define SYS_INPUTRC "/etc/inputrc"
++#define SYS_INPUTRC "/etc/bash/inputrc"
+
+ /* If defined, expand tabs to spaces. */
+ #define DISPLAY_TABS
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-013.bashref.info.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,22 @@
+--- doc/bashref.info 2009-12-29 12:59:33.000000000 -0800
++++ doc/bashref.info 2010-09-01 10:49:49.070499702 -0700
+@@ -6387,7 +6387,7 @@
+ directory. The name of this file is taken from the value of the shell
+ variable `INPUTRC'. If that variable is unset, the default is
+ `~/.inputrc'. If that file does not exist or cannot be read, the
+-ultimate default is `/etc/inputrc'.
++ultimate default is `/etc/bash/inputrc'.
+
+ When a program which uses the Readline library starts up, the init
+ file is read, and the key bindings are set.
+@@ -6812,8 +6812,8 @@
+ `$include'
+ This directive takes a single filename as an argument and reads
+ commands and bindings from that file. For example, the following
+- directive reads from `/etc/inputrc':
+- $include /etc/inputrc
++ directive reads from `/etc/bash/inputrc':
++ $include /etc/bash/inputrc
+
+
+ File: bashref.info, Node: Sample Init File, Prev: Conditional Init Constructs, Up: Readline Init File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-014.bash.man.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,16 @@
+--- doc/bash.1 2009-12-30 10:01:31.000000000 -0800
++++ doc/bash.1 2010-09-01 10:50:49.912191287 -0700
+@@ -5235,11 +5235,11 @@
+ .IP \fB$include\fP
+ This directive takes a single filename as an argument and reads commands
+ and bindings from that file. For example, the following directive
+-would read \fI/etc/inputrc\fP:
++would read \fI/etc/bash/inputrc\fP:
+ .sp 1
+ .RS
+ .nf
+-\fB$include\fP \^ \fI/etc/inputrc\fP
++\fB$include\fP \^ \fI/etc/bash/inputrc\fP
+ .fi
+ .RE
+ .SS Searching
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-015.rbash.man.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,13 @@
+--- doc/rbash.1 2008-08-12 06:24:51.000000000 -0700
++++ doc/rbash.1 2010-09-01 10:52:04.397206373 -0700
+@@ -1,8 +1,8 @@
+-.TH RBASH 1 "2004 Apr 20" "GNU Bash-4.0"
++.TH RBASH 1 "2004 Apr 20" "GNU Bash-4.1"
+ .SH NAME
+ rbash \- restricted bash, see \fBbash\fR(1)
+ .SH RESTRICTED SHELL
+ .nr zY 1
+-.so bash.1
++.so /usr/share/man/man1/bash.1
+ .SH SEE ALSO
+ bash(1)
--- a/components/bash/solaris-000.config.h.in.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- config.h.in 2009-08-18 20:34:36.000000000 -0700
-+++ config.h.in 2010-09-01 10:21:00.756734104 -0700
-@@ -21,6 +21,8 @@
- #ifndef _CONFIG_H_
- #define _CONFIG_H_
-
-+#include "config-top.h"
-+
- /* Configuration feature settings controllable by autoconf. */
-
- /* Define JOB_CONTROL if your operating system supports
--- a/components/bash/solaris-001.config-top.h.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
---- config-top.h 2009-12-22 12:29:39.000000000 -0800
-+++ config-top.h 2010-09-01 10:24:03.070928602 -0700
-@@ -54,14 +54,14 @@
- /* The default value of the PATH variable. */
- #ifndef DEFAULT_PATH_VALUE
- #define DEFAULT_PATH_VALUE \
-- "/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:."
-+ "/usr/gnu/bin:/bin:/usr/bin:/sbin:/usr/sbin:."
- #endif
-
- /* The value for PATH when invoking `command -p'. This is only used when
- the Posix.2 confstr () function, or CS_PATH define are not present. */
- #ifndef STANDARD_UTILS_PATH
- #define STANDARD_UTILS_PATH \
-- "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc"
-+ "/usr/gnu/bin:/bin:/usr/bin:/sbin:/usr/sbin:/etc:/etc/bash"
- #endif
-
- /* Default primary and secondary prompt strings. */
-@@ -75,14 +75,14 @@
- #define KSH_COMPATIBLE_SELECT
-
- /* System-wide .bashrc file for interactive shells. */
--/* #define SYS_BASHRC "/etc/bash.bashrc" */
-+#define SYS_BASHRC "/etc/bash/bashrc"
-
- /* System-wide .bash_logout for login shells. */
--/* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */
-+#define SYS_BASH_LOGOUT "/etc/bash/bash_logout"
-
- /* Define this to make non-interactive shells begun with argv[0][0] == '-'
- run the startup files when not in posix mode. */
--/* #define NON_INTERACTIVE_LOGIN_SHELLS */
-+#define NON_INTERACTIVE_LOGIN_SHELLS 1
-
- /* Define this if you want bash to try to check whether it's being run by
- sshd and source the .bashrc if so (like the rshd behavior). This checks
--- a/components/bash/solaris-002.Makefile.in.3.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
---- Makefile.in 2009-12-30 10:05:40.000000000 -0800
-+++ Makefile.in 2011-02-04 16:31:01.659698136 -0800
-@@ -137,7 +137,7 @@
- STATIC_LD = @STATIC_LD@
- LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
-
--SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OSTYPE='"$(OS)"' -DCONF_MACHTYPE='"$(MACHTYPE)"' -DCONF_VENDOR='"$(VENDOR)"' $(LOCALE_DEFS)
-+SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OSTYPE='"$(OS)"' -DCONF_MACHTYPE='"$(MACHTYPE)"' -DCONF_VENDOR='"$(VENDOR)"' $(LOCALE_DEFS) $(CFLAGS)
-
- BASE_CCFLAGS = $(PROFILE_FLAGS) $(SYSTEM_FLAGS) $(LOCAL_DEFS) \
- $(DEFS) $(LOCAL_CFLAGS) $(INCLUDES)
-@@ -535,7 +535,7 @@
-
- $(Program): .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP)
- $(RM) $@
-- $(PURIFY) $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS)
-+ $(PURIFY) $(CC) $(CFLAGS) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS) $(LD_OPTIONS) -s
- ls -l $(Program)
- -$(SIZE) $(Program)
-
-@@ -549,10 +549,10 @@
- @echo
-
- bashbug: $(SUPPORT_SRC)bashbug.sh config.h Makefile $(VERSPROG)
-- @sed -e "s%!MACHINE!%$(Machine)%" -e "s%!OS!%$(OS)%" \
-- -e "s%!CFLAGS!%$(CCFLAGS)%" -e "s%!CC!%$(CC)%" \
-- -e "s%!RELEASE!%$(Version)%" -e "s%!PATCHLEVEL!%$(PatchLevel)%" \
-- -e "s%!MACHTYPE!%$(MACHTYPE)%" -e "s%!RELSTATUS!%$(RELSTATUS)%" \
-+ @sed -e "s^!MACHINE!^$(Machine)^" -e "s^!OS!^$(OS)^" \
-+ -e "s^!CFLAGS!^$(CCFLAGS)^" -e "s^!CC!^$(CC)^" \
-+ -e "s^!RELEASE!^$(Version)^" -e "s^!PATCHLEVEL!^$(PatchLevel)^" \
-+ -e "s^!MACHTYPE!^$(MACHTYPE)^" -e "s^!RELSTATUS!^$(RELSTATUS)^" \
- $(SUPPORT_SRC)bashbug.sh > $@
- @chmod a+rx bashbug
-
--- a/components/bash/solaris-003.glob.c.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
---- lib/glob/glob.c 2009-11-14 15:39:30.000000000 -0800
-+++ lib/glob/glob.c 2010-09-01 10:28:10.161379481 -0700
-@@ -34,6 +34,10 @@
- # include <unistd.h>
- #endif
-
-+#if defined (HAVE_ALLOCA) && defined (HAVE_ALLOCA_H)
-+# include <alloca.h>
-+#endif
-+
- #include "bashansi.h"
- #include "posixdir.h"
- #include "posixstat.h"
--- a/components/bash/solaris-004.snprintf.c.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- lib/sh/snprintf.c 2008-08-12 12:02:14.000000000 -0400
-+++ lib/sh/snprintf.c 2009-08-10 15:16:30.000000000 -0400
-@@ -116,6 +116,8 @@
- # include <locale.h>
- #endif
-
-+#include <math.h>
-+
- #include "stdc.h"
- #include <shmbutil.h>
-
--- a/components/bash/solaris-005.variables.c.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
---- variables.c 2009-01-04 14:32:46.000000000 -0500
-+++ variables.c 2009-08-15 14:53:56.426776000 -0400
-@@ -402,14 +402,10 @@
- /* Now make our own defaults in case the vars that we think are
- important are missing. */
- temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE);
--#if 0
- set_auto_export (temp_var); /* XXX */
--#endif
-
- temp_var = set_if_not ("TERM", "dumb");
--#if 0
- set_auto_export (temp_var); /* XXX */
--#endif
-
- #if defined (__QNX__)
- /* set node id -- don't import it from the environment */
--- a/components/bash/solaris-006.signames.c.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
---- support/signames.c 2008-08-13 08:31:48.000000000 -0400
-+++ support/signames.c 2009-08-15 16:40:01.729682000 -0400
-@@ -212,6 +212,14 @@
- signal_names[SIGXRES] = "SIGXRES";
- #endif
-
-+#if defined (SIGJVM1) /* Solaris Java Virtual Machine 1 */
-+ signal_names[SIGJVM1] = "SIGJVM1";
-+#endif
-+
-+#if defined (SIGJVM2) /* Solaris Java Virtual Machine 2 */
-+ signal_names[SIGJVM2] = "SIGJVM2";
-+#endif
-+
- /* HP-UX */
- #if defined (SIGDIL) /* DIL signal (?) */
- signal_names[SIGDIL] = "SIGDIL";
--- a/components/bash/solaris-007.rlprivate.h.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
---- lib/readline/rlprivate.h 2009-01-22 21:56:49.000000000 -0500
-+++ lib/readline/rlprivate.h 2009-08-16 10:55:56.178609000 -0400
-@@ -23,6 +23,18 @@
- #if !defined (_RL_PRIVATE_H_)
- #define _RL_PRIVATE_H_
-
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#if defined(HANDLE_MULTIBYTE)
-+
-+#include <limits.h>
-+#include <wchar.h>
-+#include <wctype.h>
-+
-+#endif /* HANDLE_MULTIBYTE */
-+
- #include "rlconf.h" /* for VISIBLE_STATS */
- #include "rlstdc.h"
- #include "posixjmp.h" /* defines procenv_t */
--- a/components/bash/solaris-008.xmbsrtowcs.c.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- lib/glob/xmbsrtowcs.c 2008-08-12 10:17:54.000000000 -0400
-+++ lib/glob/xmbsrtowcs.c 2009-08-10 15:46:18.000000000 -0400
-@@ -30,7 +30,7 @@
- #if HANDLE_MULTIBYTE
-
- #ifndef FREE
--# define FREE(x) do { if (x) free (x); } while (0)
-+# define FREE(x) do { if (x) free (x); x = 0; } while (0)
- #endif
- /* On some locales (ex. ja_JP.sjis), mbsrtowc doesn't convert 0x5c to U<0x5c>.
- So, this function is made for converting 0x5c to U<0x5c>. */
--- a/components/bash/solaris-009.configure.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,321 +0,0 @@
---- configure 2009-12-29 05:34:51.000000000 -0800
-+++ configure 2010-09-01 10:45:06.225859891 -0700
-@@ -1,4 +1,4 @@
--#! /bin/sh
-+#! /bin/bash
- # From configure.in for Bash 4.1, version 4.019.
- # Guess values for system-dependent variables and create Makefiles.
- # Generated by GNU Autoconf 2.63 for bash 4.1-release.
-@@ -13,6 +13,8 @@
- ## M4sh Initialization. ##
- ## --------------------- ##
-
-+export LD_OPTIONS="-lc -lm -lgen -lsocket -lnsl -lresolv -z ignore"
-+
- # Be more Bourne compatible
- DUALCASE=1; export DUALCASE # for MKS sh
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
-@@ -592,7 +594,7 @@
- subdirs=
- MFLAGS=
- MAKEFLAGS=
--SHELL=${CONFIG_SHELL-/bin/sh}
-+SHELL=${CONFIG_SHELL-/bin/bash}
-
- # Identity of this package.
- PACKAGE_NAME='bash'
-@@ -3500,7 +3502,7 @@
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
-- CFLAGS="-g"
-+ CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
- _ACEOF
-@@ -3579,7 +3581,7 @@
- sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_c_werror_flag=$ac_save_c_werror_flag
-- CFLAGS="-g"
-+ CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
- _ACEOF
-@@ -3638,7 +3640,7 @@
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
-- CFLAGS="-g"
-+ CFLAGS=""
- fi
- else
- if test "$GCC" = yes; then
-@@ -5092,7 +5094,7 @@
-
- if test -z "$CC_FOR_BUILD"; then
- if test "x$cross_compiling" = "xno"; then
-- CC_FOR_BUILD='$(CC)'
-+ CC_FOR_BUILD='$(CC) $(CPPFLAGS) $(CFLAGS)'
- else
- CC_FOR_BUILD=gcc
- fi
-@@ -5100,7 +5102,7 @@
-
-
-
--test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
-+test -z "$CFLAGS" && CFLAGS="${CFLAGS}" auto_cflags=1
-
- test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2"
-
-@@ -5132,7 +5134,7 @@
- LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""}
- fi
-
--test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="-g"
-+test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD=""
-
-
-
-@@ -5257,9 +5259,14 @@
- int
- main ()
- {
-+#if defined(sun) || defined(__sun) || defined(__sun__)
-+#error "we want to use libcurses."
-+return 255;
-+#else
- return tgetent ();
- ;
- return 0;
-+#endif
- }
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
-@@ -6164,7 +6171,7 @@
- $as_echo_n "(cached) " >&6
- else
- cat >conftest.make <<\_ACEOF
--SHELL = /bin/sh
-+SHELL = /bin/bash
- all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
- _ACEOF
-@@ -6190,7 +6197,7 @@
-
- case "$host_os" in
- opennt*|interix*) MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;;
--*) MAKE_SHELL=/bin/sh ;;
-+*) MAKE_SHELL=/bin/bash ;;
- esac
-
-
-@@ -7177,7 +7184,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
-- echo "#! /bin/sh" >conf$$.sh
-+ echo "#! /bin/bash" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-@@ -7191,7 +7198,7 @@
- # Find out how to test for executable files. Don't use a zero-byte file,
- # as systems may use methods other than mode bits to determine executability.
- cat >conf$$.file <<_ASEOF
--#! /bin/sh
-+#! /bin/bash
- exit 0
- _ASEOF
- chmod +x conf$$.file
-@@ -7288,7 +7295,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
-- echo "#! /bin/sh" >conf$$.sh
-+ echo "#! /bin/bash" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-@@ -7302,7 +7309,7 @@
- # Find out how to test for executable files. Don't use a zero-byte file,
- # as systems may use methods other than mode bits to determine executability.
- cat >conf$$.file <<_ASEOF
--#! /bin/sh
-+#! /bin/bash
- exit 0
- _ASEOF
- chmod +x conf$$.file
-@@ -7359,7 +7366,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
-- echo "#! /bin/sh" >conf$$.sh
-+ echo "#! /bin/bash" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-@@ -7373,7 +7380,7 @@
- # Find out how to test for executable files. Don't use a zero-byte file,
- # as systems may use methods other than mode bits to determine executability.
- cat >conf$$.file <<_ASEOF
--#! /bin/sh
-+#! /bin/bash
- exit 0
- _ASEOF
- chmod +x conf$$.file
-@@ -8992,7 +8999,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
-- echo "#! /bin/sh" >conf$$.sh
-+ echo "#! /bin/bash" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-@@ -9102,7 +9109,7 @@
- else
-
- CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
-- ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
-+ ${CONFIG_SHELL-/bin/bash} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
- . ./conftest.sh
- rm -f ./conftest.sh
- acl_cv_rpath=done
-@@ -13042,39 +13049,18 @@
- /* end confdefs.h. */
- /* Define isinf to an innocuous variant, in case <limits.h> declares isinf.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
--#define isinf innocuous_isinf
--
--/* System header to define __stub macros and hopefully few prototypes,
-- which can conflict with char isinf (); below.
-- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-- <limits.h> exists even on freestanding compilers. */
--
--#ifdef __STDC__
--# include <limits.h>
--#else
--# include <assert.h>
--#endif
--
--#undef isinf
--
-+#include <math.h>
- /* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
--#ifdef __cplusplus
--extern "C"
--#endif
--char isinf ();
- /* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
--#if defined __stub_isinf || defined __stub___isinf
--choke me
--#endif
-
- int
- main ()
- {
--return isinf ();
-+return isinf(0.0);
- ;
- return 0;
- }
-@@ -13134,39 +13120,26 @@
- /* end confdefs.h. */
- /* Define isnan to an innocuous variant, in case <limits.h> declares isnan.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
--#define isnan innocuous_isnan
-
- /* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char isnan (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
--#ifdef __STDC__
--# include <limits.h>
--#else
--# include <assert.h>
--#endif
--
--#undef isnan
-+#include <math.h>
-
- /* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
--#ifdef __cplusplus
--extern "C"
--#endif
--char isnan ();
-+
- /* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
--#if defined __stub_isnan || defined __stub___isnan
--choke me
--#endif
-
- int
- main ()
- {
--return isnan ();
-+return isnan(0.0);
- ;
- return 0;
- }
-@@ -25521,7 +25494,7 @@
- exit 69
- ' >conftest
- chmod u+x conftest
--(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null 2>&1)
-+(SHELL=/bin/bash; export SHELL; ./conftest >/dev/null 2>&1)
- if test $? -ne 69; then
- ac_cv_sys_interpreter=yes
- else
-@@ -30117,9 +30090,14 @@
- int
- main ()
- {
-+#if defined(sun) || defined(__sun) || defined(__sun__)
-+#error "we want to use libcurses"
-+return 255;
-+#else
- return tgetent ();
- ;
- return 0;
-+#endif
- }
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
-@@ -30302,7 +30280,7 @@
- $as_echo_n "(cached) " >&6
- else
- ac_check_lib_save_LIBS=$LIBS
--LIBS="-lcurses $LIBS"
-+LIBS="/usr/lib/libcurses.so.1 $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
- _ACEOF
-@@ -30468,7 +30446,7 @@
- TERMCAP_LIB=
- TERMCAP_DEP=
- else
--TERMCAP_LIB=-lcurses
-+TERMCAP_LIB=/usr/lib/libcurses.so.1
- TERMCAP_DEP=
- fi
-
-@@ -30676,7 +30654,7 @@
- then
- { $as_echo "$as_me:$LINENO: checking shared object configuration for loadable builtins" >&5
- $as_echo_n "checking shared object configuration for loadable builtins... " >&6; }
-- eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"`
-+ eval `${CONFIG_SHELL-/bin/bash} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"`
-
-
-
--- a/components/bash/solaris-010.input.c.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
---- lib/readline/input.c 2009-04-19 10:12:03.000000000 -0700
-+++ lib/readline/input.c 2010-09-01 10:46:23.386144948 -0700
-@@ -51,6 +51,10 @@
- # include <sys/ioctl.h>
- #endif
-
-+#if defined(SOLARIS)
-+# include <sys/filio.h>
-+#endif
-+
- #include <stdio.h>
- #include <errno.h>
-
--- a/components/bash/solaris-011.input_avail.c.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
---- lib/sh/input_avail.c 2009-04-19 10:01:14.000000000 -0700
-+++ lib/sh/input_avail.c 2010-09-01 10:47:30.418016819 -0700
-@@ -45,6 +45,10 @@
- # include <sys/ioctl.h>
- #endif
-
-+#if defined(SOLARIS)
-+# include <sys/filio.h> /* Solaris FIONREAD */
-+#endif
-+
- #include <stdio.h>
- #include <errno.h>
-
--- a/components/bash/solaris-012.rlconf.h.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- lib/readline/rlconf.h 2009-01-04 11:32:33.000000000 -0800
-+++ lib/readline/rlconf.h 2010-09-01 10:48:13.018894232 -0700
-@@ -39,7 +39,7 @@
- #define DEFAULT_INPUTRC "~/.inputrc"
-
- /* The ultimate last-ditch filenname for an init file -- system-wide. */
--#define SYS_INPUTRC "/etc/inputrc"
-+#define SYS_INPUTRC "/etc/bash/inputrc"
-
- /* If defined, expand tabs to spaces. */
- #define DISPLAY_TABS
--- a/components/bash/solaris-013.bashref.info.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
---- doc/bashref.info 2009-12-29 12:59:33.000000000 -0800
-+++ doc/bashref.info 2010-09-01 10:49:49.070499702 -0700
-@@ -6387,7 +6387,7 @@
- directory. The name of this file is taken from the value of the shell
- variable `INPUTRC'. If that variable is unset, the default is
- `~/.inputrc'. If that file does not exist or cannot be read, the
--ultimate default is `/etc/inputrc'.
-+ultimate default is `/etc/bash/inputrc'.
-
- When a program which uses the Readline library starts up, the init
- file is read, and the key bindings are set.
-@@ -6812,8 +6812,8 @@
- `$include'
- This directive takes a single filename as an argument and reads
- commands and bindings from that file. For example, the following
-- directive reads from `/etc/inputrc':
-- $include /etc/inputrc
-+ directive reads from `/etc/bash/inputrc':
-+ $include /etc/bash/inputrc
-
-
- File: bashref.info, Node: Sample Init File, Prev: Conditional Init Constructs, Up: Readline Init File
--- a/components/bash/solaris-014.bash.man.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
---- doc/bash.1 2009-12-30 10:01:31.000000000 -0800
-+++ doc/bash.1 2010-09-01 10:50:49.912191287 -0700
-@@ -5235,11 +5235,11 @@
- .IP \fB$include\fP
- This directive takes a single filename as an argument and reads commands
- and bindings from that file. For example, the following directive
--would read \fI/etc/inputrc\fP:
-+would read \fI/etc/bash/inputrc\fP:
- .sp 1
- .RS
- .nf
--\fB$include\fP \^ \fI/etc/inputrc\fP
-+\fB$include\fP \^ \fI/etc/bash/inputrc\fP
- .fi
- .RE
- .SS Searching
--- a/components/bash/solaris-015.rbash.man.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
---- doc/rbash.1 2008-08-12 06:24:51.000000000 -0700
-+++ doc/rbash.1 2010-09-01 10:52:04.397206373 -0700
-@@ -1,8 +1,8 @@
--.TH RBASH 1 "2004 Apr 20" "GNU Bash-4.0"
-+.TH RBASH 1 "2004 Apr 20" "GNU Bash-4.1"
- .SH NAME
- rbash \- restricted bash, see \fBbash\fR(1)
- .SH RESTRICTED SHELL
- .nr zY 1
--.so bash.1
-+.so /usr/share/man/man1/bash.1
- .SH SEE ALSO
- bash(1)
--- a/components/bzip2/Makefile.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,118 +0,0 @@
---- bzip2-1.0.6/Makefile.orig Wed Jan 12 13:53:06 2011
-+++ bzip2-1.0.6/Makefile Thu Jan 13 13:01:30 2011
-@@ -33,34 +33,33 @@
- randtable.o \
- compress.o \
- decompress.o \
-- bzlib.o
-+ bzlib.o \
-+ oldapi.o
-
--all: libbz2.a bzip2 bzip2recover test
-+all: libbz2.so bzip2 bzip2recover test
-
--bzip2: libbz2.a bzip2.o
-+bzip2: libbz2.so bzip2.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
-
- bzip2recover: bzip2recover.o
- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
-
--libbz2.a: $(OBJS)
-- rm -f libbz2.a
-- $(AR) cq libbz2.a $(OBJS)
-- @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
-- -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
-- echo $(RANLIB) libbz2.a ; \
-- $(RANLIB) libbz2.a ; \
-- fi
-+libbz2.so: $(OBJS)
-+ rm -f libbz2.so libbz2.so.1
-+ $(CC) $(CFLAGS) -G -h libbz2.so.1 -o libbz2.so.1 \
-+ -z defs -z text -zcombreloc $(OBJS) -M ../../mapfile -L. \
-+ -lc
-+ ln -s libbz2.so.1 libbz2.so
-
- check: test
- test: bzip2
- @cat words1
-- ./bzip2 -1 < sample1.ref > sample1.rb2
-- ./bzip2 -2 < sample2.ref > sample2.rb2
-- ./bzip2 -3 < sample3.ref > sample3.rb2
-- ./bzip2 -d < sample1.bz2 > sample1.tst
-- ./bzip2 -d < sample2.bz2 > sample2.tst
-- ./bzip2 -ds < sample3.bz2 > sample3.tst
-+ env LD_LIBRARY_PATH=. ./bzip2 -1 < sample1.ref > sample1.rb2
-+ env LD_LIBRARY_PATH=. ./bzip2 -2 < sample2.ref > sample2.rb2
-+ env LD_LIBRARY_PATH=. ./bzip2 -3 < sample3.ref > sample3.rb2
-+ env LD_LIBRARY_PATH=. ./bzip2 -d < sample1.bz2 > sample1.tst
-+ env LD_LIBRARY_PATH=. ./bzip2 -d < sample2.bz2 > sample2.tst
-+ env LD_LIBRARY_PATH=. ./bzip2 -ds < sample3.bz2 > sample3.tst
- cmp sample1.bz2 sample1.rb2
- cmp sample2.bz2 sample2.rb2
- cmp sample3.bz2 sample3.rb2
-@@ -72,8 +71,8 @@
- install: bzip2 bzip2recover
- if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
- if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
-- if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
-- if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
-+ if ( test ! -d $(PREFIX)/share/man ) ; then mkdir -p $(PREFIX)/share/man ; fi
-+ if ( test ! -d $(PREFIX)/share/man/man1 ) ; then mkdir -p $(PREFIX)/share/man/man1 ; fi
- if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
- cp -f bzip2 $(PREFIX)/bin/bzip2
- cp -f bzip2 $(PREFIX)/bin/bunzip2
-@@ -83,30 +82,28 @@
- chmod a+x $(PREFIX)/bin/bunzip2
- chmod a+x $(PREFIX)/bin/bzcat
- chmod a+x $(PREFIX)/bin/bzip2recover
-- cp -f bzip2.1 $(PREFIX)/man/man1
-- chmod a+r $(PREFIX)/man/man1/bzip2.1
-+ cp -f bzip2.1 $(PREFIX)/share/man/man1
-+ chmod a+r $(PREFIX)/share/man/man1/bzip2.1
- cp -f bzlib.h $(PREFIX)/include
- chmod a+r $(PREFIX)/include/bzlib.h
-- cp -f libbz2.a $(PREFIX)/lib
-- chmod a+r $(PREFIX)/lib/libbz2.a
- cp -f bzgrep $(PREFIX)/bin/bzgrep
-- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
-- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
-+ ln -s -f ./bzgrep $(PREFIX)/bin/bzegrep
-+ ln -s -f ./bzgrep $(PREFIX)/bin/bzfgrep
- chmod a+x $(PREFIX)/bin/bzgrep
- cp -f bzmore $(PREFIX)/bin/bzmore
-- ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
-+ ln -s -f ./bzmore $(PREFIX)/bin/bzless
- chmod a+x $(PREFIX)/bin/bzmore
- cp -f bzdiff $(PREFIX)/bin/bzdiff
-- ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
-+ ln -s -f ./bzdiff $(PREFIX)/bin/bzcmp
- chmod a+x $(PREFIX)/bin/bzdiff
-- cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
-- chmod a+r $(PREFIX)/man/man1/bzgrep.1
-- chmod a+r $(PREFIX)/man/man1/bzmore.1
-- chmod a+r $(PREFIX)/man/man1/bzdiff.1
-- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
-- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
-- echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
-- echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
-+ cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/share/man/man1
-+ chmod a+r $(PREFIX)/share/man/man1/bzgrep.1
-+ chmod a+r $(PREFIX)/share/man/man1/bzmore.1
-+ chmod a+r $(PREFIX)/share/man/man1/bzdiff.1
-+ echo ".so man1/bzgrep.1" > $(PREFIX)/share/man/man1/bzegrep.1
-+ echo ".so man1/bzgrep.1" > $(PREFIX)/share/man/man1/bzfgrep.1
-+ echo ".so man1/bzmore.1" > $(PREFIX)/share/man/man1/bzless.1
-+ echo ".so man1/bzdiff.1" > $(PREFIX)/share/man/man1/bzcmp.1
-
- clean:
- rm -f *.o libbz2.a bzip2 bzip2recover \
-@@ -132,6 +129,8 @@
- $(CC) $(CFLAGS) -c bzip2.c
- bzip2recover.o: bzip2recover.c
- $(CC) $(CFLAGS) -c bzip2recover.c
-+oldapi.o: oldapi.c
-+ $(CC) $(CFLAGS) -c oldapi.c
-
-
- distclean: clean
--- a/components/bzip2/bzip2.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
---- bzip2-1.0.5/bzip2.c.orig 2008-11-28 05:47:09.537546000 -0800
-+++ bzip2-1.0.5/bzip2.c 2008-11-28 05:50:37.075934000 -0800
-@@ -221,6 +221,7 @@
- static void copyFileName ( Char*, Char* );
- static void* myMalloc ( Int32 );
- static void applySavedFileAttrToOutputFile ( IntNative fd );
-+static void applySavedTimeInfoToOutputFile ( Char *dstName );
-
-
-
-@@ -368,6 +369,7 @@
- if (zStream != stdout) {
- Int32 fd = fileno ( zStream );
- if (fd < 0) goto errhandler_io;
-+ applySavedTimeInfoToOutputFile ( outName );
- applySavedFileAttrToOutputFile ( fd );
- ret = fclose ( zStream );
- outputHandleJustInCase = NULL;
-@@ -481,17 +483,18 @@
-
- closeok:
- if (ferror(zStream)) goto errhandler_io;
-+ ret = fflush ( stream );
-+ if (ret != 0) goto errhandler_io;
- if (stream != stdout) {
- Int32 fd = fileno ( stream );
- if (fd < 0) goto errhandler_io;
-+ applySavedTimeInfoToOutputFile ( outName );
- applySavedFileAttrToOutputFile ( fd );
- }
- ret = fclose ( zStream );
- if (ret == EOF) goto errhandler_io;
-
- if (ferror(stream)) goto errhandler_io;
-- ret = fflush ( stream );
-- if (ret != 0) goto errhandler_io;
- if (stream != stdout) {
- ret = fclose ( stream );
- outputHandleJustInCase = NULL;
-@@ -1297,7 +1300,6 @@
-
- /*--- If there was an I/O error, we won't get here. ---*/
- if ( srcMode == SM_F2F ) {
-- applySavedTimeInfoToOutputFile ( outName );
- deleteOutputOnInterrupt = False;
- if ( !keepInputFiles ) {
- IntNative retVal = remove ( inName );
-@@ -1475,7 +1477,6 @@
- /*--- If there was an I/O error, we won't get here. ---*/
- if ( magicNumberOK ) {
- if ( srcMode == SM_F2F ) {
-- applySavedTimeInfoToOutputFile ( outName );
- deleteOutputOnInterrupt = False;
- if ( !keepInputFiles ) {
- IntNative retVal = remove ( inName );
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bzip2/patches/Makefile.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,118 @@
+--- bzip2-1.0.6/Makefile.orig Wed Jan 12 13:53:06 2011
++++ bzip2-1.0.6/Makefile Thu Jan 13 13:01:30 2011
+@@ -33,34 +33,33 @@
+ randtable.o \
+ compress.o \
+ decompress.o \
+- bzlib.o
++ bzlib.o \
++ oldapi.o
+
+-all: libbz2.a bzip2 bzip2recover test
++all: libbz2.so bzip2 bzip2recover test
+
+-bzip2: libbz2.a bzip2.o
++bzip2: libbz2.so bzip2.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
+
+ bzip2recover: bzip2recover.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
+
+-libbz2.a: $(OBJS)
+- rm -f libbz2.a
+- $(AR) cq libbz2.a $(OBJS)
+- @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
+- -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
+- echo $(RANLIB) libbz2.a ; \
+- $(RANLIB) libbz2.a ; \
+- fi
++libbz2.so: $(OBJS)
++ rm -f libbz2.so libbz2.so.1
++ $(CC) $(CFLAGS) -G -h libbz2.so.1 -o libbz2.so.1 \
++ -z defs -z text -zcombreloc $(OBJS) -M ../../mapfile -L. \
++ -lc
++ ln -s libbz2.so.1 libbz2.so
+
+ check: test
+ test: bzip2
+ @cat words1
+- ./bzip2 -1 < sample1.ref > sample1.rb2
+- ./bzip2 -2 < sample2.ref > sample2.rb2
+- ./bzip2 -3 < sample3.ref > sample3.rb2
+- ./bzip2 -d < sample1.bz2 > sample1.tst
+- ./bzip2 -d < sample2.bz2 > sample2.tst
+- ./bzip2 -ds < sample3.bz2 > sample3.tst
++ env LD_LIBRARY_PATH=. ./bzip2 -1 < sample1.ref > sample1.rb2
++ env LD_LIBRARY_PATH=. ./bzip2 -2 < sample2.ref > sample2.rb2
++ env LD_LIBRARY_PATH=. ./bzip2 -3 < sample3.ref > sample3.rb2
++ env LD_LIBRARY_PATH=. ./bzip2 -d < sample1.bz2 > sample1.tst
++ env LD_LIBRARY_PATH=. ./bzip2 -d < sample2.bz2 > sample2.tst
++ env LD_LIBRARY_PATH=. ./bzip2 -ds < sample3.bz2 > sample3.tst
+ cmp sample1.bz2 sample1.rb2
+ cmp sample2.bz2 sample2.rb2
+ cmp sample3.bz2 sample3.rb2
+@@ -72,8 +71,8 @@
+ install: bzip2 bzip2recover
+ if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
+ if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
+- if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
+- if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
++ if ( test ! -d $(PREFIX)/share/man ) ; then mkdir -p $(PREFIX)/share/man ; fi
++ if ( test ! -d $(PREFIX)/share/man/man1 ) ; then mkdir -p $(PREFIX)/share/man/man1 ; fi
+ if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
+ cp -f bzip2 $(PREFIX)/bin/bzip2
+ cp -f bzip2 $(PREFIX)/bin/bunzip2
+@@ -83,30 +82,28 @@
+ chmod a+x $(PREFIX)/bin/bunzip2
+ chmod a+x $(PREFIX)/bin/bzcat
+ chmod a+x $(PREFIX)/bin/bzip2recover
+- cp -f bzip2.1 $(PREFIX)/man/man1
+- chmod a+r $(PREFIX)/man/man1/bzip2.1
++ cp -f bzip2.1 $(PREFIX)/share/man/man1
++ chmod a+r $(PREFIX)/share/man/man1/bzip2.1
+ cp -f bzlib.h $(PREFIX)/include
+ chmod a+r $(PREFIX)/include/bzlib.h
+- cp -f libbz2.a $(PREFIX)/lib
+- chmod a+r $(PREFIX)/lib/libbz2.a
+ cp -f bzgrep $(PREFIX)/bin/bzgrep
+- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
+- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
++ ln -s -f ./bzgrep $(PREFIX)/bin/bzegrep
++ ln -s -f ./bzgrep $(PREFIX)/bin/bzfgrep
+ chmod a+x $(PREFIX)/bin/bzgrep
+ cp -f bzmore $(PREFIX)/bin/bzmore
+- ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
++ ln -s -f ./bzmore $(PREFIX)/bin/bzless
+ chmod a+x $(PREFIX)/bin/bzmore
+ cp -f bzdiff $(PREFIX)/bin/bzdiff
+- ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
++ ln -s -f ./bzdiff $(PREFIX)/bin/bzcmp
+ chmod a+x $(PREFIX)/bin/bzdiff
+- cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
+- chmod a+r $(PREFIX)/man/man1/bzgrep.1
+- chmod a+r $(PREFIX)/man/man1/bzmore.1
+- chmod a+r $(PREFIX)/man/man1/bzdiff.1
+- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
+- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
+- echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
+- echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
++ cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/share/man/man1
++ chmod a+r $(PREFIX)/share/man/man1/bzgrep.1
++ chmod a+r $(PREFIX)/share/man/man1/bzmore.1
++ chmod a+r $(PREFIX)/share/man/man1/bzdiff.1
++ echo ".so man1/bzgrep.1" > $(PREFIX)/share/man/man1/bzegrep.1
++ echo ".so man1/bzgrep.1" > $(PREFIX)/share/man/man1/bzfgrep.1
++ echo ".so man1/bzmore.1" > $(PREFIX)/share/man/man1/bzless.1
++ echo ".so man1/bzdiff.1" > $(PREFIX)/share/man/man1/bzcmp.1
+
+ clean:
+ rm -f *.o libbz2.a bzip2 bzip2recover \
+@@ -132,6 +129,8 @@
+ $(CC) $(CFLAGS) -c bzip2.c
+ bzip2recover.o: bzip2recover.c
+ $(CC) $(CFLAGS) -c bzip2recover.c
++oldapi.o: oldapi.c
++ $(CC) $(CFLAGS) -c oldapi.c
+
+
+ distclean: clean
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bzip2/patches/bzip2.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,55 @@
+--- bzip2-1.0.5/bzip2.c.orig 2008-11-28 05:47:09.537546000 -0800
++++ bzip2-1.0.5/bzip2.c 2008-11-28 05:50:37.075934000 -0800
+@@ -221,6 +221,7 @@
+ static void copyFileName ( Char*, Char* );
+ static void* myMalloc ( Int32 );
+ static void applySavedFileAttrToOutputFile ( IntNative fd );
++static void applySavedTimeInfoToOutputFile ( Char *dstName );
+
+
+
+@@ -368,6 +369,7 @@
+ if (zStream != stdout) {
+ Int32 fd = fileno ( zStream );
+ if (fd < 0) goto errhandler_io;
++ applySavedTimeInfoToOutputFile ( outName );
+ applySavedFileAttrToOutputFile ( fd );
+ ret = fclose ( zStream );
+ outputHandleJustInCase = NULL;
+@@ -481,17 +483,18 @@
+
+ closeok:
+ if (ferror(zStream)) goto errhandler_io;
++ ret = fflush ( stream );
++ if (ret != 0) goto errhandler_io;
+ if (stream != stdout) {
+ Int32 fd = fileno ( stream );
+ if (fd < 0) goto errhandler_io;
++ applySavedTimeInfoToOutputFile ( outName );
+ applySavedFileAttrToOutputFile ( fd );
+ }
+ ret = fclose ( zStream );
+ if (ret == EOF) goto errhandler_io;
+
+ if (ferror(stream)) goto errhandler_io;
+- ret = fflush ( stream );
+- if (ret != 0) goto errhandler_io;
+ if (stream != stdout) {
+ ret = fclose ( stream );
+ outputHandleJustInCase = NULL;
+@@ -1297,7 +1300,6 @@
+
+ /*--- If there was an I/O error, we won't get here. ---*/
+ if ( srcMode == SM_F2F ) {
+- applySavedTimeInfoToOutputFile ( outName );
+ deleteOutputOnInterrupt = False;
+ if ( !keepInputFiles ) {
+ IntNative retVal = remove ( inName );
+@@ -1475,7 +1477,6 @@
+ /*--- If there was an I/O error, we won't get here. ---*/
+ if ( magicNumberOK ) {
+ if ( srcMode == SM_F2F ) {
+- applySavedTimeInfoToOutputFile ( outName );
+ deleteOutputOnInterrupt = False;
+ if ( !keepInputFiles ) {
+ IntNative retVal = remove ( inName );
--- a/components/coreutils/coreutils-8_5.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
---- coreutils-8.5/configure_orig 2011-02-08 16:13:56.850317000 -0800
-+++ coreutils-8.5/configure 2011-02-08 16:14:04.872411000 -0800
-@@ -53254,11 +53254,10 @@
- optional_bin_progs="$optional_bin_progs df"
- fi
- }
- fi
-
--# Limit stdbuf to ELF systems with GCC
- optional_pkglib_progs=
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this is an ELF system" >&5
- $as_echo_n "checking whether this is an ELF system... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h. */
-@@ -53274,28 +53273,24 @@
- fi
- rm -f conftest*
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $elf_sys" >&5
- $as_echo "$elf_sys" >&6; }
--if test "$elf_sys" = "yes" && \
-- test "$GCC" = "yes"; then
-- {
-- if test -z "$optional_bin_progs"; then
-- optional_bin_progs=stdbuf
-- else
-- optional_bin_progs="$optional_bin_progs stdbuf"
-- fi
--}
-- {
-- if test -z "$optional_pkglib_progs"; then
-- optional_pkglib_progs=libstdbuf.so
-- else
-- optional_pkglib_progs="$optional_pkglib_progs libstdbuf.so"
-- fi
--}
-+
-+if test -z "$optional_bin_progs"; then
-+ optional_bin_progs=stdbuf
-+else
-+ optional_bin_progs="$optional_bin_progs stdbuf"
- fi
-
-+if test -z "$optional_pkglib_progs"; then
-+ optional_pkglib_progs=libstdbuf.so
-+else
-+ optional_pkglib_progs="$optional_pkglib_progs libstdbuf.so"
-+fi
-+
-+
- ############################################################################
- mk="$srcdir/src/Makefile.am"
- # Extract all literal names from the definition of $(EXTRA_PROGRAMS)
- # in $mk but don't expand the variable references.
- # Append each literal name to $optional_bin_progs.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/coreutils/patches/coreutils-8_5.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,55 @@
+--- coreutils-8.5/configure_orig 2011-02-08 16:13:56.850317000 -0800
++++ coreutils-8.5/configure 2011-02-08 16:14:04.872411000 -0800
+@@ -53254,11 +53254,10 @@
+ optional_bin_progs="$optional_bin_progs df"
+ fi
+ }
+ fi
+
+-# Limit stdbuf to ELF systems with GCC
+ optional_pkglib_progs=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether this is an ELF system" >&5
+ $as_echo_n "checking whether this is an ELF system... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+@@ -53274,28 +53273,24 @@
+ fi
+ rm -f conftest*
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $elf_sys" >&5
+ $as_echo "$elf_sys" >&6; }
+-if test "$elf_sys" = "yes" && \
+- test "$GCC" = "yes"; then
+- {
+- if test -z "$optional_bin_progs"; then
+- optional_bin_progs=stdbuf
+- else
+- optional_bin_progs="$optional_bin_progs stdbuf"
+- fi
+-}
+- {
+- if test -z "$optional_pkglib_progs"; then
+- optional_pkglib_progs=libstdbuf.so
+- else
+- optional_pkglib_progs="$optional_pkglib_progs libstdbuf.so"
+- fi
+-}
++
++if test -z "$optional_bin_progs"; then
++ optional_bin_progs=stdbuf
++else
++ optional_bin_progs="$optional_bin_progs stdbuf"
+ fi
+
++if test -z "$optional_pkglib_progs"; then
++ optional_pkglib_progs=libstdbuf.so
++else
++ optional_pkglib_progs="$optional_pkglib_progs libstdbuf.so"
++fi
++
++
+ ############################################################################
+ mk="$srcdir/src/Makefile.am"
+ # Extract all literal names from the definition of $(EXTRA_PROGRAMS)
+ # in $mk but don't expand the variable references.
+ # Append each literal name to $optional_bin_progs.
--- a/components/elinks/Makefile.lib.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
---- elinks-0.11.7/Makefile.lib.orig Wed Jan 26 13:36:42 2011
-+++ elinks-0.11.7/Makefile.lib Wed Jan 26 13:37:29 2011
-@@ -39,7 +39,7 @@
-
- quiet_cmd_compile = ' [$(CC_COLOR)CC$(END_COLOR)] $(RELPATH)$@'
- masq_cmd_compile = $(COMPILE) -o $(@) -c $< $(2)
-- cmd_compile = $(COMPILE) -o $(@) -Wp,-MD,.deps/$(*F).pp -c $< $(2)
-+ cmd_compile = $(COMPILE) -o $(@) -c $< $(2)
-
- # Rule to compile a set of .o files into one .o file
- quiet_cmd_ld_objs = " [$(LD_COLOR)LD$(END_COLOR)] $(RELPATH)$@"
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/elinks/patches/Makefile.lib.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,12 @@
+--- elinks-0.11.7/Makefile.lib.orig Wed Jan 26 13:36:42 2011
++++ elinks-0.11.7/Makefile.lib Wed Jan 26 13:37:29 2011
+@@ -39,7 +39,7 @@
+
+ quiet_cmd_compile = ' [$(CC_COLOR)CC$(END_COLOR)] $(RELPATH)$@'
+ masq_cmd_compile = $(COMPILE) -o $(@) -c $< $(2)
+- cmd_compile = $(COMPILE) -o $(@) -Wp,-MD,.deps/$(*F).pp -c $< $(2)
++ cmd_compile = $(COMPILE) -o $(@) -c $< $(2)
+
+ # Rule to compile a set of .o files into one .o file
+ quiet_cmd_ld_objs = " [$(LD_COLOR)LD$(END_COLOR)] $(RELPATH)$@"
+
--- a/components/gawk/gawk_manpage1.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
---- gawk-3.1.5/doc/gawk.1_orig Sun Jun 26 06:42:14 2005
-+++ gawk-3.1.5/doc/gawk.1 Wed Feb 23 13:10:34 2011
-@@ -1,3 +1,8 @@
-+'\" t
-+.\"
-+.\" Modified for Solaris to add the Solaris stability classification,
-+.\" and to add a note about source availability.
-+.\"
- .ds PX \s-1POSIX\s+1
- .ds UX \s-1UNIX\s+1
- .ds AN \s-1ANSI\s+1
-@@ -3456,3 +3461,23 @@
- manual page into another language, under the above conditions for
- modified versions, except that this permission notice may be stated in
- a translation approved by the Foundation.
-+.\" Begin Oracle update
-+.SH ATTRIBUTES
-+See
-+.BR attributes (5)
-+for descriptions of the following attributes:
-+.sp
-+.TS
-+box;
-+cbp-1 | cbp-1
-+l | l .
-+ATTRIBUTE TYPE ATTRIBUTE VALUE
-+=
-+Availability text/gawk
-+=
-+Interface Stability Volatile
-+.TE
-+.PP
-+.SH NOTES
-+Source for gawk is available on http://opensolaris.org.
-+.\" End Oracle update
--- a/components/gawk/igawk_manpage1.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
---- gawk-3.1.5/doc/igawk.1_orig Wed May 11 08:28:14 2005
-+++ gawk-3.1.5/doc/igawk.1 Wed Feb 23 13:10:41 2011
-@@ -1,3 +1,8 @@
-+'\" t
-+.\"
-+.\" Modified for Solaris to add the Solaris stability classification,
-+.\" and to add a note about source availability.
-+.\"
- .TH IGAWK 1 "Nov 3 1999" "Free Software Foundation" "Utility Commands"
- .SH NAME
- igawk \- gawk with include files
-@@ -71,3 +76,23 @@
- .SH AUTHOR
- Arnold Robbins
- .RB ( [email protected] ).
-+.\" Begin Oracle update
-+.SH ATTRIBUTES
-+See
-+.BR attributes (5)
-+for descriptions of the following attributes:
-+.sp
-+.TS
-+box;
-+cbp-1 | cbp-1
-+l | l .
-+ATTRIBUTE TYPE ATTRIBUTE VALUE
-+=
-+Availability text/gawk
-+=
-+Interface Stability Volatile
-+.TE
-+.PP
-+.SH NOTES
-+Source for gawk is available on http://opensolaris.org.
-+.\" End Oracle update
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gawk/patches/gawk_manpage1.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,35 @@
+--- gawk-3.1.5/doc/gawk.1_orig Sun Jun 26 06:42:14 2005
++++ gawk-3.1.5/doc/gawk.1 Wed Feb 23 13:10:34 2011
+@@ -1,3 +1,8 @@
++'\" t
++.\"
++.\" Modified for Solaris to add the Solaris stability classification,
++.\" and to add a note about source availability.
++.\"
+ .ds PX \s-1POSIX\s+1
+ .ds UX \s-1UNIX\s+1
+ .ds AN \s-1ANSI\s+1
+@@ -3456,3 +3461,23 @@
+ manual page into another language, under the above conditions for
+ modified versions, except that this permission notice may be stated in
+ a translation approved by the Foundation.
++.\" Begin Oracle update
++.SH ATTRIBUTES
++See
++.BR attributes (5)
++for descriptions of the following attributes:
++.sp
++.TS
++box;
++cbp-1 | cbp-1
++l | l .
++ATTRIBUTE TYPE ATTRIBUTE VALUE
++=
++Availability text/gawk
++=
++Interface Stability Volatile
++.TE
++.PP
++.SH NOTES
++Source for gawk is available on http://opensolaris.org.
++.\" End Oracle update
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gawk/patches/igawk_manpage1.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,35 @@
+--- gawk-3.1.5/doc/igawk.1_orig Wed May 11 08:28:14 2005
++++ gawk-3.1.5/doc/igawk.1 Wed Feb 23 13:10:41 2011
+@@ -1,3 +1,8 @@
++'\" t
++.\"
++.\" Modified for Solaris to add the Solaris stability classification,
++.\" and to add a note about source availability.
++.\"
+ .TH IGAWK 1 "Nov 3 1999" "Free Software Foundation" "Utility Commands"
+ .SH NAME
+ igawk \- gawk with include files
+@@ -71,3 +76,23 @@
+ .SH AUTHOR
+ Arnold Robbins
+ .RB ( [email protected] ).
++.\" Begin Oracle update
++.SH ATTRIBUTES
++See
++.BR attributes (5)
++for descriptions of the following attributes:
++.sp
++.TS
++box;
++cbp-1 | cbp-1
++l | l .
++ATTRIBUTE TYPE ATTRIBUTE VALUE
++=
++Availability text/gawk
++=
++Interface Stability Volatile
++.TE
++.PP
++.SH NOTES
++Source for gawk is available on http://opensolaris.org.
++.\" End Oracle update
--- a/components/ggrep/ggrep.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- grep-2.5.4/tests/foad1.sh.orig Fri Jan 28 16:47:12 2011
-+++ grep-2.5.4/tests/foad1.sh Fri Jan 28 16:45:00 2011
-@@ -23,7 +23,7 @@
- INPUT="$1"
- EXPECT="$2"
- shift 2
-- OUTPUT=`echo -n "$INPUT" | tr "/" "\n" | "$GREP" "$@" | tr "\n" "/"`
-+ OUTPUT=`printf "$INPUT" | tr "/" "\n" | "$GREP" "$@" | tr "\n" "/"`
- if test "$OUTPUT" != "$EXPECT" || test "$VERBOSE" = "1"; then
- echo "Testing: $GREP $@"
- test "$LC_ALL" != C && test "$LC_ALL" != "" && echo " LC_ALL: \"$LC_ALL\""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ggrep/patches/ggrep.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,11 @@
+--- grep-2.5.4/tests/foad1.sh.orig Fri Jan 28 16:47:12 2011
++++ grep-2.5.4/tests/foad1.sh Fri Jan 28 16:45:00 2011
+@@ -23,7 +23,7 @@
+ INPUT="$1"
+ EXPECT="$2"
+ shift 2
+- OUTPUT=`echo -n "$INPUT" | tr "/" "\n" | "$GREP" "$@" | tr "\n" "/"`
++ OUTPUT=`printf "$INPUT" | tr "/" "\n" | "$GREP" "$@" | tr "\n" "/"`
+ if test "$OUTPUT" != "$EXPECT" || test "$VERBOSE" = "1"; then
+ echo "Testing: $GREP $@"
+ test "$LC_ALL" != C && test "$LC_ALL" != "" && echo " LC_ALL: \"$LC_ALL\""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gtar/patches/verify.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,25 @@
+From 24214ca5d506f56dc0cb2a2e1312256472039475 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <[email protected]>
+Date: Mon, 15 Nov 2010 08:07:53 +0000
+Subject: tar: fix --verify option, which broke in 1.24
+
+* src/compare.c (verify_volume): Decode the header before invoking
+diff_archive, as diff_archive no longer does this as of the
+2010-06-28 commit. Also, don't try to invoke diff_archive on a
+zero block.
+---
+diff --git a/src/compare.c b/src/compare.c
+index 6b7e6d8..f3112c6 100644
+--- a/src/compare.c
++++ b/src/compare.c
+@@ -611,8 +611,10 @@ verify_volume (void)
+ (0, 0, _("A lone zero block at %s"),
+ STRINGIFY_BIGINT (current_block_ordinal (), buf)));
+ }
++ continue;
+ }
+
++ decode_header (current_header, ¤t_stat_info, ¤t_format, 1);
+ diff_archive ();
+ tar_stat_destroy (¤t_stat_info);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gtar/patches/xgetcwd.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,18 @@
+--- tar-1.25/gnu/xgetcwd.c.orig Mon Nov 8 06:23:04 2010
++++ tar-1.25/gnu/xgetcwd.c Mon Nov 8 06:29:04 2010
+@@ -36,7 +36,14 @@
+ char *
+ xgetcwd (void)
+ {
+- char *cwd = getcwd (NULL, 0);
++ char *cwd;
++#ifdef HAVE_PARTLY_WORKING_GETCWD
++ cwd = getcwd (NULL, 0);
++#else
++ cwd = malloc(PATH_MAX);
++ if (cwd)
++ getcwd (cwd, PATH_MAX);
++#endif
+ if (! cwd && errno == ENOMEM)
+ xalloc_die ();
+ return cwd;
--- a/components/gtar/verify.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-From 24214ca5d506f56dc0cb2a2e1312256472039475 Mon Sep 17 00:00:00 2001
-From: Paul Eggert <[email protected]>
-Date: Mon, 15 Nov 2010 08:07:53 +0000
-Subject: tar: fix --verify option, which broke in 1.24
-
-* src/compare.c (verify_volume): Decode the header before invoking
-diff_archive, as diff_archive no longer does this as of the
-2010-06-28 commit. Also, don't try to invoke diff_archive on a
-zero block.
----
-diff --git a/src/compare.c b/src/compare.c
-index 6b7e6d8..f3112c6 100644
---- a/src/compare.c
-+++ b/src/compare.c
-@@ -611,8 +611,10 @@ verify_volume (void)
- (0, 0, _("A lone zero block at %s"),
- STRINGIFY_BIGINT (current_block_ordinal (), buf)));
- }
-+ continue;
- }
-
-+ decode_header (current_header, ¤t_stat_info, ¤t_format, 1);
- diff_archive ();
- tar_stat_destroy (¤t_stat_info);
- }
--- a/components/gtar/xgetcwd.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
---- tar-1.25/gnu/xgetcwd.c.orig Mon Nov 8 06:23:04 2010
-+++ tar-1.25/gnu/xgetcwd.c Mon Nov 8 06:29:04 2010
-@@ -36,7 +36,14 @@
- char *
- xgetcwd (void)
- {
-- char *cwd = getcwd (NULL, 0);
-+ char *cwd;
-+#ifdef HAVE_PARTLY_WORKING_GETCWD
-+ cwd = getcwd (NULL, 0);
-+#else
-+ cwd = malloc(PATH_MAX);
-+ if (cwd)
-+ getcwd (cwd, PATH_MAX);
-+#endif
- if (! cwd && errno == ENOMEM)
- xalloc_die ();
- return cwd;
--- a/components/gzip/6294656-6283819.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
---- gzip-1.3.5.orig/gzip.c
-+++ gzip-1.3.5/gzip.c
-@@ -878,8 +878,11 @@
- }
-
- close(ifd);
-- if (!to_stdout && close(ofd)) {
-- write_error();
-+ if (!to_stdout) {
-+ /* Copy modes, times, ownership, and remove the input file */
-+ copy_stat(&istat);
-+ if (close(ofd))
-+ write_error();
- }
- if (method == -1) {
- if (!to_stdout) xunlink (ofname);
-@@ -899,10 +902,6 @@
- }
- fprintf(stderr, "\n");
- }
-- /* Copy modes, times, ownership, and remove the input file */
-- if (!to_stdout) {
-- copy_stat(&istat);
-- }
- }
-
- /* ========================================================================
-@@ -1322,6 +1321,7 @@
- /* Copy the base name. Keep a directory prefix intact. */
- char *p = base_name (ofname);
- char *base = p;
-+ char *base2;
- for (;;) {
- *p = (char)get_char();
- if (*p++ == '\0') break;
-@@ -1329,6 +1329,8 @@
- error("corrupted input -- file name too large");
- }
- }
-+ base2 = base_name (base);
-+ strcpy(base, base2);
- /* If necessary, adapt the name to local OS conventions: */
- if (!list) {
- MAKE_LEGAL_NAME(base);
-@@ -1730,7 +1732,7 @@
- reset_times(ofname, ifstat);
- #endif
- /* Copy the protection modes */
-- if (chmod(ofname, ifstat->st_mode & 07777)) {
-+ if (fchmod(ofd, ifstat->st_mode & 07777)) {
- int e = errno;
- WARN((stderr, "%s: ", progname));
- if (!quiet) {
-@@ -1739,7 +1741,7 @@
- }
- }
- #ifndef NO_CHOWN
-- chown(ofname, ifstat->st_uid, ifstat->st_gid); /* Copy ownership */
-+ (void) fchown(ofd, ifstat->st_uid, ifstat->st_gid); /* Copy ownership */
- #endif
- remove_ofname = 0;
- /* It's now safe to remove the input file: */
--- a/components/gzip/6470484.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-Index: gnu/usr.bin/gzip/gzip.h
-===================================================================
-RCS file: /home/ncvs/src/gnu/usr.bin/gzip/gzip.h,v
-retrieving revision 1.4
-diff -u -d -r1.4 gzip.h
---- gzip/gzip.h 2 May 2004 23:07:49 -0000 1.4
-+++ gzip/gzip.h 17 Sep 2006 10:58:37 -0000
-@@ -202,6 +202,8 @@
- extern int to_stdout; /* output to stdout (-c) */
- extern int save_orig_name; /* set if original name must be saved */
-
-+#define MIN(a,b) ((a) <= (b) ? (a) : (b))
-+
- #define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(0))
- #define try_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(1))
-
-Index: gnu/usr.bin/gzip/inflate.c
-===================================================================
-RCS file: /home/ncvs/src/gnu/usr.bin/gzip/inflate.c,v
-retrieving revision 1.9
-diff -u -d -r1.9 inflate.c
---- gzip/inflate.c 13 Aug 2004 05:38:44 -0000 1.9
-+++ gzip/inflate.c 17 Sep 2006 10:58:37 -0000
-@@ -316,7 +316,7 @@
- {
- *t = (struct huft *)NULL;
- *m = 0;
-- return 0;
-+ return 2;
- }
-
-
-Index: gnu/usr.bin/gzip/unlzh.c
-===================================================================
-RCS file: /home/ncvs/src/gnu/usr.bin/gzip/unlzh.c,v
-retrieving revision 1.5
-diff -u -d -r1.5 unlzh.c
---- gzip/unlzh.c 27 Aug 1999 23:35:53 -0000 1.5
-+++ gzip/unlzh.c 17 Sep 2006 10:58:37 -0000
-@@ -148,13 +148,17 @@
- unsigned i, k, len, ch, jutbits, avail, nextcode, mask;
-
- for (i = 1; i <= 16; i++) count[i] = 0;
-- for (i = 0; i < (unsigned)nchar; i++) count[bitlen[i]]++;
-+ for (i = 0; i < (unsigned)nchar; i++) {
-+ if (bitlen[i] > 16)
-+ error("Bad table (case a)\n");
-+ else count[bitlen[i]]++;
-+ }
-
- start[1] = 0;
- for (i = 1; i <= 16; i++)
- start[i + 1] = start[i] + (count[i] << (16 - i));
-- if ((start[17] & 0xffff) != 0)
-- error("Bad table\n");
-+ if ((start[17] & 0xffff) != 0 || tablebits > 16) /* 16 for weight below */
-+ error("Bad table (case b)\n");
-
- jutbits = 16 - tablebits;
- for (i = 1; i <= (unsigned)tablebits; i++) {
-@@ -168,15 +172,15 @@
-
- i = start[tablebits + 1] >> jutbits;
- if (i != 0) {
-- k = 1 << tablebits;
-- while (i != k) table[i++] = 0;
-+ k = MIN(1 << tablebits, DIST_BUFSIZE);
-+ while (i < k) table[i++] = 0;
- }
-
- avail = nchar;
- mask = (unsigned) 1 << (15 - tablebits);
- for (ch = 0; ch < (unsigned)nchar; ch++) {
- if ((len = bitlen[ch]) == 0) continue;
-- nextcode = start[len] + weight[len];
-+ nextcode = MIN(start[len] + weight[len], DIST_BUFSIZE);
- if (len <= (unsigned)tablebits) {
- for (i = start[len]; i < nextcode; i++) table[i] = ch;
- } else {
-@@ -217,7 +221,7 @@
- for (i = 0; i < 256; i++) pt_table[i] = c;
- } else {
- i = 0;
-- while (i < n) {
-+ while (i < MIN(n,NPT)) {
- c = bitbuf >> (BITBUFSIZ - 3);
- if (c == 7) {
- mask = (unsigned) 1 << (BITBUFSIZ - 1 - 3);
-@@ -227,7 +231,7 @@
- pt_len[i++] = c;
- if (i == i_special) {
- c = getbits(2);
-- while (--c >= 0) pt_len[i++] = 0;
-+ while (--c >= 0 && i < NPT) pt_len[i++] = 0;
- }
- }
- while (i < nn) pt_len[i++] = 0;
-@@ -247,7 +251,7 @@
- for (i = 0; i < 4096; i++) c_table[i] = c;
- } else {
- i = 0;
-- while (i < n) {
-+ while (i < MIN(n,NC)) {
- c = pt_table[bitbuf >> (BITBUFSIZ - 8)];
- if (c >= NT) {
- mask = (unsigned) 1 << (BITBUFSIZ - 1 - 8);
-@@ -255,14 +259,14 @@
- if (bitbuf & mask) c = right[c];
- else c = left [c];
- mask >>= 1;
-- } while (c >= NT);
-+ } while (c >= NT && (mask || c != left[c]));
- }
- fillbuf((int) pt_len[c]);
- if (c <= 2) {
- if (c == 0) c = 1;
- else if (c == 1) c = getbits(4) + 3;
- else c = getbits(CBIT) + 20;
-- while (--c >= 0) c_len[i++] = 0;
-+ while (--c >= 0 && i < NC) c_len[i++] = 0;
- } else c_len[i++] = c - 2;
- }
- while (i < NC) c_len[i++] = 0;
-@@ -291,7 +295,7 @@
- if (bitbuf & mask) j = right[j];
- else j = left [j];
- mask >>= 1;
-- } while (j >= NC);
-+ } while (j >= NC && (mask || j != left[j]));
- }
- fillbuf((int) c_len[j]);
- return j;
-@@ -308,7 +312,7 @@
- if (bitbuf & mask) j = right[j];
- else j = left [j];
- mask >>= 1;
-- } while (j >= NP);
-+ } while (j >= NP && (mask || j != left[j]));
- }
- fillbuf((int) pt_len[j]);
- if (j != 0) j = ((unsigned) 1 << (j - 1)) + getbits((int) (j - 1));
-@@ -355,7 +359,7 @@
- while (--j >= 0) {
- buffer[r] = buffer[i];
- i = (i + 1) & (DICSIZ - 1);
-- if (++r == count) return r;
-+ if (++r >= count) return r;
- }
- for ( ; ; ) {
- c = decode_c();
-@@ -365,14 +369,14 @@
- }
- if (c <= UCHAR_MAX) {
- buffer[r] = c;
-- if (++r == count) return r;
-+ if (++r >= count) return r;
- } else {
- j = c - (UCHAR_MAX + 1 - THRESHOLD);
- i = (r - decode_p() - 1) & (DICSIZ - 1);
- while (--j >= 0) {
- buffer[r] = buffer[i];
- i = (i + 1) & (DICSIZ - 1);
-- if (++r == count) return r;
-+ if (++r >= count) return r;
- }
- }
- }
-Index: gnu/usr.bin/gzip/unpack.c
-===================================================================
-RCS file: /home/ncvs/src/gnu/usr.bin/gzip/unpack.c,v
-retrieving revision 1.6
-diff -u -d -r1.6 unpack.c
---- gzip/unpack.c 27 Aug 1999 23:35:54 -0000 1.6
-+++ gzip/unpack.c 17 Sep 2006 10:58:37 -0000
-@@ -12,7 +12,6 @@
- #include "gzip.h"
- #include "crypt.h"
-
--#define MIN(a,b) ((a) <= (b) ? (a) : (b))
- /* The arguments must not have side effects. */
-
- #define MAX_BITLEN 25
-@@ -132,7 +131,7 @@
- /* Remember where the literals of this length start in literal[] : */
- lit_base[len] = base;
- /* And read the literals: */
-- for (n = leaves[len]; n > 0; n--) {
-+ for (n = leaves[len]; n > 0 && base < LITERALS; n--) {
- literal[base++] = (uch)get_byte();
- }
- }
-@@ -168,7 +167,7 @@
- prefixp = &prefix_len[1<<peek_bits];
- for (len = 1; len <= peek_bits; len++) {
- int prefixes = leaves[len] << (peek_bits-len); /* may be 0 */
-- while (prefixes--) *--prefixp = (uch)len;
-+ while (prefixes-- && prefixp > prefix_len) *--prefixp = (uch)len;
- }
- /* The length of all other codes is unknown: */
- while (prefixp > prefix_len) *--prefixp = 0;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gzip/patches/6294656-6283819.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,62 @@
+--- gzip-1.3.5.orig/gzip.c
++++ gzip-1.3.5/gzip.c
+@@ -878,8 +878,11 @@
+ }
+
+ close(ifd);
+- if (!to_stdout && close(ofd)) {
+- write_error();
++ if (!to_stdout) {
++ /* Copy modes, times, ownership, and remove the input file */
++ copy_stat(&istat);
++ if (close(ofd))
++ write_error();
+ }
+ if (method == -1) {
+ if (!to_stdout) xunlink (ofname);
+@@ -899,10 +902,6 @@
+ }
+ fprintf(stderr, "\n");
+ }
+- /* Copy modes, times, ownership, and remove the input file */
+- if (!to_stdout) {
+- copy_stat(&istat);
+- }
+ }
+
+ /* ========================================================================
+@@ -1322,6 +1321,7 @@
+ /* Copy the base name. Keep a directory prefix intact. */
+ char *p = base_name (ofname);
+ char *base = p;
++ char *base2;
+ for (;;) {
+ *p = (char)get_char();
+ if (*p++ == '\0') break;
+@@ -1329,6 +1329,8 @@
+ error("corrupted input -- file name too large");
+ }
+ }
++ base2 = base_name (base);
++ strcpy(base, base2);
+ /* If necessary, adapt the name to local OS conventions: */
+ if (!list) {
+ MAKE_LEGAL_NAME(base);
+@@ -1730,7 +1732,7 @@
+ reset_times(ofname, ifstat);
+ #endif
+ /* Copy the protection modes */
+- if (chmod(ofname, ifstat->st_mode & 07777)) {
++ if (fchmod(ofd, ifstat->st_mode & 07777)) {
+ int e = errno;
+ WARN((stderr, "%s: ", progname));
+ if (!quiet) {
+@@ -1739,7 +1741,7 @@
+ }
+ }
+ #ifndef NO_CHOWN
+- chown(ofname, ifstat->st_uid, ifstat->st_gid); /* Copy ownership */
++ (void) fchown(ofd, ifstat->st_uid, ifstat->st_gid); /* Copy ownership */
+ #endif
+ remove_ofname = 0;
+ /* It's now safe to remove the input file: */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gzip/patches/6470484.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,200 @@
+Index: gnu/usr.bin/gzip/gzip.h
+===================================================================
+RCS file: /home/ncvs/src/gnu/usr.bin/gzip/gzip.h,v
+retrieving revision 1.4
+diff -u -d -r1.4 gzip.h
+--- gzip/gzip.h 2 May 2004 23:07:49 -0000 1.4
++++ gzip/gzip.h 17 Sep 2006 10:58:37 -0000
+@@ -202,6 +202,8 @@
+ extern int to_stdout; /* output to stdout (-c) */
+ extern int save_orig_name; /* set if original name must be saved */
+
++#define MIN(a,b) ((a) <= (b) ? (a) : (b))
++
+ #define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(0))
+ #define try_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(1))
+
+Index: gnu/usr.bin/gzip/inflate.c
+===================================================================
+RCS file: /home/ncvs/src/gnu/usr.bin/gzip/inflate.c,v
+retrieving revision 1.9
+diff -u -d -r1.9 inflate.c
+--- gzip/inflate.c 13 Aug 2004 05:38:44 -0000 1.9
++++ gzip/inflate.c 17 Sep 2006 10:58:37 -0000
+@@ -316,7 +316,7 @@
+ {
+ *t = (struct huft *)NULL;
+ *m = 0;
+- return 0;
++ return 2;
+ }
+
+
+Index: gnu/usr.bin/gzip/unlzh.c
+===================================================================
+RCS file: /home/ncvs/src/gnu/usr.bin/gzip/unlzh.c,v
+retrieving revision 1.5
+diff -u -d -r1.5 unlzh.c
+--- gzip/unlzh.c 27 Aug 1999 23:35:53 -0000 1.5
++++ gzip/unlzh.c 17 Sep 2006 10:58:37 -0000
+@@ -148,13 +148,17 @@
+ unsigned i, k, len, ch, jutbits, avail, nextcode, mask;
+
+ for (i = 1; i <= 16; i++) count[i] = 0;
+- for (i = 0; i < (unsigned)nchar; i++) count[bitlen[i]]++;
++ for (i = 0; i < (unsigned)nchar; i++) {
++ if (bitlen[i] > 16)
++ error("Bad table (case a)\n");
++ else count[bitlen[i]]++;
++ }
+
+ start[1] = 0;
+ for (i = 1; i <= 16; i++)
+ start[i + 1] = start[i] + (count[i] << (16 - i));
+- if ((start[17] & 0xffff) != 0)
+- error("Bad table\n");
++ if ((start[17] & 0xffff) != 0 || tablebits > 16) /* 16 for weight below */
++ error("Bad table (case b)\n");
+
+ jutbits = 16 - tablebits;
+ for (i = 1; i <= (unsigned)tablebits; i++) {
+@@ -168,15 +172,15 @@
+
+ i = start[tablebits + 1] >> jutbits;
+ if (i != 0) {
+- k = 1 << tablebits;
+- while (i != k) table[i++] = 0;
++ k = MIN(1 << tablebits, DIST_BUFSIZE);
++ while (i < k) table[i++] = 0;
+ }
+
+ avail = nchar;
+ mask = (unsigned) 1 << (15 - tablebits);
+ for (ch = 0; ch < (unsigned)nchar; ch++) {
+ if ((len = bitlen[ch]) == 0) continue;
+- nextcode = start[len] + weight[len];
++ nextcode = MIN(start[len] + weight[len], DIST_BUFSIZE);
+ if (len <= (unsigned)tablebits) {
+ for (i = start[len]; i < nextcode; i++) table[i] = ch;
+ } else {
+@@ -217,7 +221,7 @@
+ for (i = 0; i < 256; i++) pt_table[i] = c;
+ } else {
+ i = 0;
+- while (i < n) {
++ while (i < MIN(n,NPT)) {
+ c = bitbuf >> (BITBUFSIZ - 3);
+ if (c == 7) {
+ mask = (unsigned) 1 << (BITBUFSIZ - 1 - 3);
+@@ -227,7 +231,7 @@
+ pt_len[i++] = c;
+ if (i == i_special) {
+ c = getbits(2);
+- while (--c >= 0) pt_len[i++] = 0;
++ while (--c >= 0 && i < NPT) pt_len[i++] = 0;
+ }
+ }
+ while (i < nn) pt_len[i++] = 0;
+@@ -247,7 +251,7 @@
+ for (i = 0; i < 4096; i++) c_table[i] = c;
+ } else {
+ i = 0;
+- while (i < n) {
++ while (i < MIN(n,NC)) {
+ c = pt_table[bitbuf >> (BITBUFSIZ - 8)];
+ if (c >= NT) {
+ mask = (unsigned) 1 << (BITBUFSIZ - 1 - 8);
+@@ -255,14 +259,14 @@
+ if (bitbuf & mask) c = right[c];
+ else c = left [c];
+ mask >>= 1;
+- } while (c >= NT);
++ } while (c >= NT && (mask || c != left[c]));
+ }
+ fillbuf((int) pt_len[c]);
+ if (c <= 2) {
+ if (c == 0) c = 1;
+ else if (c == 1) c = getbits(4) + 3;
+ else c = getbits(CBIT) + 20;
+- while (--c >= 0) c_len[i++] = 0;
++ while (--c >= 0 && i < NC) c_len[i++] = 0;
+ } else c_len[i++] = c - 2;
+ }
+ while (i < NC) c_len[i++] = 0;
+@@ -291,7 +295,7 @@
+ if (bitbuf & mask) j = right[j];
+ else j = left [j];
+ mask >>= 1;
+- } while (j >= NC);
++ } while (j >= NC && (mask || j != left[j]));
+ }
+ fillbuf((int) c_len[j]);
+ return j;
+@@ -308,7 +312,7 @@
+ if (bitbuf & mask) j = right[j];
+ else j = left [j];
+ mask >>= 1;
+- } while (j >= NP);
++ } while (j >= NP && (mask || j != left[j]));
+ }
+ fillbuf((int) pt_len[j]);
+ if (j != 0) j = ((unsigned) 1 << (j - 1)) + getbits((int) (j - 1));
+@@ -355,7 +359,7 @@
+ while (--j >= 0) {
+ buffer[r] = buffer[i];
+ i = (i + 1) & (DICSIZ - 1);
+- if (++r == count) return r;
++ if (++r >= count) return r;
+ }
+ for ( ; ; ) {
+ c = decode_c();
+@@ -365,14 +369,14 @@
+ }
+ if (c <= UCHAR_MAX) {
+ buffer[r] = c;
+- if (++r == count) return r;
++ if (++r >= count) return r;
+ } else {
+ j = c - (UCHAR_MAX + 1 - THRESHOLD);
+ i = (r - decode_p() - 1) & (DICSIZ - 1);
+ while (--j >= 0) {
+ buffer[r] = buffer[i];
+ i = (i + 1) & (DICSIZ - 1);
+- if (++r == count) return r;
++ if (++r >= count) return r;
+ }
+ }
+ }
+Index: gnu/usr.bin/gzip/unpack.c
+===================================================================
+RCS file: /home/ncvs/src/gnu/usr.bin/gzip/unpack.c,v
+retrieving revision 1.6
+diff -u -d -r1.6 unpack.c
+--- gzip/unpack.c 27 Aug 1999 23:35:54 -0000 1.6
++++ gzip/unpack.c 17 Sep 2006 10:58:37 -0000
+@@ -12,7 +12,6 @@
+ #include "gzip.h"
+ #include "crypt.h"
+
+-#define MIN(a,b) ((a) <= (b) ? (a) : (b))
+ /* The arguments must not have side effects. */
+
+ #define MAX_BITLEN 25
+@@ -132,7 +131,7 @@
+ /* Remember where the literals of this length start in literal[] : */
+ lit_base[len] = base;
+ /* And read the literals: */
+- for (n = leaves[len]; n > 0; n--) {
++ for (n = leaves[len]; n > 0 && base < LITERALS; n--) {
+ literal[base++] = (uch)get_byte();
+ }
+ }
+@@ -168,7 +167,7 @@
+ prefixp = &prefix_len[1<<peek_bits];
+ for (len = 1; len <= peek_bits; len++) {
+ int prefixes = leaves[len] << (peek_bits-len); /* may be 0 */
+- while (prefixes--) *--prefixp = (uch)len;
++ while (prefixes-- && prefixp > prefix_len) *--prefixp = (uch)len;
+ }
+ /* The length of all other codes is unknown: */
+ while (prefixp > prefix_len) *--prefixp = 0;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gzip/patches/version.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,11 @@
+--- gzip-1.3.5/gzip.c-orig Fri Oct 6 05:44:06 2006
++++ gzip-1.3.5/gzip.c Fri Oct 6 05:48:53 2006
+@@ -427,6 +427,8 @@
+ #endif
+ printf ("\n");
+ printf ("Written by Jean-loup Gailly.\n");
++ printf ("patched for Sun BugIDs 6294656 6283819\n");
++ printf ("patched for CVE-2006-4334, CVE-2006-4335, CVE-2006-4336, CVE-2006-4337, CVE-2006-4338\n");
+ }
+
+ local void progerror (string)
--- a/components/gzip/version.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- gzip-1.3.5/gzip.c-orig Fri Oct 6 05:44:06 2006
-+++ gzip-1.3.5/gzip.c Fri Oct 6 05:48:53 2006
-@@ -427,6 +427,8 @@
- #endif
- printf ("\n");
- printf ("Written by Jean-loup Gailly.\n");
-+ printf ("patched for Sun BugIDs 6294656 6283819\n");
-+ printf ("patched for CVE-2006-4334, CVE-2006-4335, CVE-2006-4336, CVE-2006-4337, CVE-2006-4338\n");
- }
-
- local void progerror (string)
--- a/components/lua/1.Makefile.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
---- lua-5.1.4/Makefile.orig Mon Aug 11 17:40:48 2008
-+++ lua-5.1.4/Makefile Fri Feb 18 13:00:25 2011
-@@ -5,15 +5,17 @@
- # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
-
- # Your platform. See PLATS for possible values.
--PLAT= none
-+PLAT= solaris
-
- # Where to install. The installation starts in the src and doc directories,
- # so take care if INSTALL_TOP is not an absolute path.
--INSTALL_TOP= /usr/local
-+INSTALL_TOP= $(ROOT)/usr
- INSTALL_BIN= $(INSTALL_TOP)/bin
- INSTALL_INC= $(INSTALL_TOP)/include
- INSTALL_LIB= $(INSTALL_TOP)/lib
--INSTALL_MAN= $(INSTALL_TOP)/man/man1
-+INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
-+INSTALL_DOC= $(INSTALL_TOP)/share/doc/lua
-+INSTALL_TEST= $(INSTALL_TOP)/demo/lua/test
- #
- # You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with
- # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
-@@ -22,9 +24,9 @@
-
- # How to install. If your install program does not support "-p", then you
- # may have to run ranlib on the installed liblua.a (do "make ranlib").
--INSTALL= install -p
--INSTALL_EXEC= $(INSTALL) -m 0755
--INSTALL_DATA= $(INSTALL) -m 0644
-+INSTALL= ginstall -p
-+INSTALL_EXEC= $(INSTALL) -m 0555
-+INSTALL_DATA= $(INSTALL) -m 0444
- #
- # If you don't have install you can use cp instead.
- # INSTALL= cp -p
-@@ -38,13 +40,15 @@
- # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
-
- # Convenience platforms targets.
--PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
-+PLATS= solaris
-
- # What to install.
- TO_BIN= lua luac
--TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
--TO_LIB= liblua.a
-+TO_INC= lua.h luaconf.h lualib.h lauxlib.h
-+TO_LIB= liblua.so
- TO_MAN= lua.1 luac.1
-+TO_DOC= amazon.gif contents.html cover.png logo.gif lua.css lua.html luac.html manual.css manual.html readme.html
-+TO_TEST= bisect.lua cf.lua echo.lua env.lua factorial.lua fib.lua fibfor.lua globals.lua hello.lua life.lua luac.lua printf.lua readonly.lua sieve.lua sort.lua table.lua trace-calls.lua trace-globals.lua xd.lua
-
- # Lua version and release.
- V= 5.1
-@@ -55,16 +59,18 @@
- $(PLATS) clean:
- cd src && $(MAKE) $@
-
-+check: test
- test: dummy
- src/lua test/hello.lua
-
- install: dummy
-- cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
-+ cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_DOC) $(INSTALL_MAN) $(INSTALL_TEST)
- cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
- cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
-- cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
-+ cd src && $(INSTALL_EXEC) $(TO_LIB) $(INSTALL_LIB)
- cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
--
-+ cd doc && $(INSTALL_DATA) $(TO_DOC) $(INSTALL_DOC)
-+ cd test && $(INSTALL_DATA) $(TO_TEST) $(INSTALL_TEST)
- ranlib:
- cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB)
-
---- lua-5.1.4/src/Makefile.orig Sat Jan 19 11:37:58 2008
-+++ lua-5.1.4/src/Makefile Wed Feb 16 15:43:24 2011
-@@ -4,25 +4,24 @@
-
- # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
-
--# Your platform. See PLATS for possible values.
--PLAT= none
--
--CC= gcc
--CFLAGS= -O2 -Wall $(MYCFLAGS)
-+CC=$(CC)
-+CFLAGS= -xO3 -Xc -Kpic $(MYCFLAGS)
-+FLAG_SPARC:sh= if [ ${MACH64} = "sparcv9" ]; then echo -xcode=pic13; fi
-+CFLAGS= $(FLAG_SPARC)
- AR= ar rcu
- RANLIB= ranlib
- RM= rm -f
--LIBS= -lm $(MYLIBS)
-+LIBS= -lm -lc $(MYLIBS)
-
- MYCFLAGS=
--MYLDFLAGS=
-+MYLDFLAGS= -zdefs -ztext
- MYLIBS=
-
- # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
-
--PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
-+PLATS= solaris
-
--LUA_A= liblua.a
-+LUA_SO= liblua.so
- CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
- lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
- lundump.o lvm.o lzio.o
-@@ -36,10 +35,10 @@
- LUAC_O= luac.o print.o
-
- ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
--ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
--ALL_A= $(LUA_A)
-+ALL_T= $(LUA_SO) $(LUA_T) $(LUAC_T)
-+ALL_A= $(LUA_SO)
-
--default: $(PLAT)
-+default: solaris
-
- all: $(ALL_T)
-
-@@ -47,15 +46,15 @@
-
- a: $(ALL_A)
-
--$(LUA_A): $(CORE_O) $(LIB_O)
-- $(AR) $@ $?
-- $(RANLIB) $@
-+$(LUA_SO): $(CORE_O) $(LIB_O)
-+ $(CC) -o $(LUA_SO) -G -h $(LUA_SO) $(CFLAGS) $(MYLDFLAGS) $(CORE_O) \
-+ $(LIB_O) $(LIBS)
-
--$(LUA_T): $(LUA_O) $(LUA_A)
-- $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
-+$(LUA_T): $(LUA_O) $(LUA_SO)
-+ $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_SO) $(LIBS)
-
--$(LUAC_T): $(LUAC_O) $(LUA_A)
-- $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
-+$(LUAC_T): $(LUAC_O) $(LUA_SO)
-+ $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_SO) $(LIBS)
-
- clean:
- $(RM) $(ALL_T) $(ALL_O)
-@@ -74,46 +73,8 @@
- @echo "MYLDFLAGS = $(MYLDFLAGS)"
- @echo "MYLIBS = $(MYLIBS)"
-
--# convenience targets for popular platforms
--
--none:
-- @echo "Please choose a platform:"
-- @echo " $(PLATS)"
--
--aix:
-- $(MAKE) all CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl" MYLDFLAGS="-brtl -bexpall"
--
--ansi:
-- $(MAKE) all MYCFLAGS=-DLUA_ANSI
--
--bsd:
-- $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-Wl,-E"
--
--freebsd:
-- $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
--
--generic:
-- $(MAKE) all MYCFLAGS=
--
--linux:
-- $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
--
--macosx:
-- $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
--# use this on Mac OS X 10.3-
--# $(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
--
--mingw:
-- $(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
-- "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
-- "MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
-- $(MAKE) "LUAC_T=luac.exe" luac.exe
--
--posix:
-- $(MAKE) all MYCFLAGS=-DLUA_USE_POSIX
--
- solaris:
-- $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
-+ $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -D__EXTENSIONS__" MYLIBS="-ldl"
-
- # list targets that do not create files (but not all makes understand .PHONY)
- .PHONY: all $(PLATS) default o a clean depend echo none
-
--- a/components/lua/2.lua.pc.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
---- lua-5.1.4/etc/lua.pc.orig Fri Aug 8 05:46:11 2008
-+++ lua-5.1.4/etc/lua.pc Tue Feb 15 18:30:23 2011
-@@ -1,22 +1,6 @@
- # lua.pc -- pkg-config data for Lua
-
--# vars from install Makefile
--
--# grep '^V=' ../Makefile
--V= 5.1
--# grep '^R=' ../Makefile
--R= 5.1.4
--
--# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
--prefix= /usr/local
--INSTALL_BIN= ${prefix}/bin
--INSTALL_INC= ${prefix}/include
--INSTALL_LIB= ${prefix}/lib
--INSTALL_MAN= ${prefix}/man/man1
--INSTALL_LMOD= ${prefix}/share/lua/${V}
--INSTALL_CMOD= ${prefix}/lib/lua/${V}
--
--# canonical vars
-+prefix=${PROTO_DIR}/usr
- exec_prefix=${prefix}
- libdir=${exec_prefix}/lib
- includedir=${prefix}/include
-@@ -23,7 +7,7 @@
-
- Name: Lua
- Description: An Extensible Extension Language
--Version: ${R}
-+Version: 5.1.4
- Requires:
- Libs: -L${libdir} -llua -lm
- Cflags: -I${includedir}
--- a/components/lua/3.headers.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
---- lua-5.1.4/src/lua.h.orig 2009-01-06 02:15:11.179130113 -0800
-+++ lua-5.1.4/src/lua.h 2009-01-06 02:15:56.570695998 -0800
-@@ -9,6 +9,10 @@
- #ifndef lua_h
- #define lua_h
-
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
- #include <stdarg.h>
- #include <stddef.h>
-
-@@ -384,5 +388,8 @@
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- ******************************************************************************/
-
-+#ifdef __cplusplus
-+}
-+#endif
-
- #endif
---- lua-5.1.4/src/lualib.h.orig 2009-01-06 02:15:19.193417835 -0800
-+++ lua-5.1.4/src/lualib.h 2009-01-06 02:16:20.502288036 -0800
-@@ -8,6 +8,10 @@
- #ifndef lualib_h
- #define lualib_h
-
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
- #include "lua.h"
-
-
-@@ -49,5 +53,8 @@
- #define lua_assert(x) ((void)0)
- #endif
-
-+#ifdef __cplusplus
-+}
-+#endif
-
- #endif
---- lua-5.1.4/src/lauxlib.h.orig 2009-01-06 02:15:37.967244620 -0800
-+++ lua-5.1.4/src/lauxlib.h 2009-01-06 02:16:26.398180986 -0800
-@@ -8,6 +8,9 @@
- #ifndef lauxlib_h
- #define lauxlib_h
-
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-
- #include <stddef.h>
- #include <stdio.h>
-@@ -169,6 +172,10 @@
-
- #define luaL_reg luaL_Reg
-
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
-
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/lua/patches/1.Makefile.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,199 @@
+--- lua-5.1.4/Makefile.orig Mon Aug 11 17:40:48 2008
++++ lua-5.1.4/Makefile Fri Feb 18 13:00:25 2011
+@@ -5,15 +5,17 @@
+ # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
+
+ # Your platform. See PLATS for possible values.
+-PLAT= none
++PLAT= solaris
+
+ # Where to install. The installation starts in the src and doc directories,
+ # so take care if INSTALL_TOP is not an absolute path.
+-INSTALL_TOP= /usr/local
++INSTALL_TOP= $(ROOT)/usr
+ INSTALL_BIN= $(INSTALL_TOP)/bin
+ INSTALL_INC= $(INSTALL_TOP)/include
+ INSTALL_LIB= $(INSTALL_TOP)/lib
+-INSTALL_MAN= $(INSTALL_TOP)/man/man1
++INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
++INSTALL_DOC= $(INSTALL_TOP)/share/doc/lua
++INSTALL_TEST= $(INSTALL_TOP)/demo/lua/test
+ #
+ # You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with
+ # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
+@@ -22,9 +24,9 @@
+
+ # How to install. If your install program does not support "-p", then you
+ # may have to run ranlib on the installed liblua.a (do "make ranlib").
+-INSTALL= install -p
+-INSTALL_EXEC= $(INSTALL) -m 0755
+-INSTALL_DATA= $(INSTALL) -m 0644
++INSTALL= ginstall -p
++INSTALL_EXEC= $(INSTALL) -m 0555
++INSTALL_DATA= $(INSTALL) -m 0444
+ #
+ # If you don't have install you can use cp instead.
+ # INSTALL= cp -p
+@@ -38,13 +40,15 @@
+ # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
+
+ # Convenience platforms targets.
+-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
++PLATS= solaris
+
+ # What to install.
+ TO_BIN= lua luac
+-TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
+-TO_LIB= liblua.a
++TO_INC= lua.h luaconf.h lualib.h lauxlib.h
++TO_LIB= liblua.so
+ TO_MAN= lua.1 luac.1
++TO_DOC= amazon.gif contents.html cover.png logo.gif lua.css lua.html luac.html manual.css manual.html readme.html
++TO_TEST= bisect.lua cf.lua echo.lua env.lua factorial.lua fib.lua fibfor.lua globals.lua hello.lua life.lua luac.lua printf.lua readonly.lua sieve.lua sort.lua table.lua trace-calls.lua trace-globals.lua xd.lua
+
+ # Lua version and release.
+ V= 5.1
+@@ -55,16 +59,18 @@
+ $(PLATS) clean:
+ cd src && $(MAKE) $@
+
++check: test
+ test: dummy
+ src/lua test/hello.lua
+
+ install: dummy
+- cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
++ cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_DOC) $(INSTALL_MAN) $(INSTALL_TEST)
+ cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
+ cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
+- cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
++ cd src && $(INSTALL_EXEC) $(TO_LIB) $(INSTALL_LIB)
+ cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+-
++ cd doc && $(INSTALL_DATA) $(TO_DOC) $(INSTALL_DOC)
++ cd test && $(INSTALL_DATA) $(TO_TEST) $(INSTALL_TEST)
+ ranlib:
+ cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB)
+
+--- lua-5.1.4/src/Makefile.orig Sat Jan 19 11:37:58 2008
++++ lua-5.1.4/src/Makefile Wed Feb 16 15:43:24 2011
+@@ -4,25 +4,24 @@
+
+ # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
+
+-# Your platform. See PLATS for possible values.
+-PLAT= none
+-
+-CC= gcc
+-CFLAGS= -O2 -Wall $(MYCFLAGS)
++CC=$(CC)
++CFLAGS= -xO3 -Xc -Kpic $(MYCFLAGS)
++FLAG_SPARC:sh= if [ ${MACH64} = "sparcv9" ]; then echo -xcode=pic13; fi
++CFLAGS= $(FLAG_SPARC)
+ AR= ar rcu
+ RANLIB= ranlib
+ RM= rm -f
+-LIBS= -lm $(MYLIBS)
++LIBS= -lm -lc $(MYLIBS)
+
+ MYCFLAGS=
+-MYLDFLAGS=
++MYLDFLAGS= -zdefs -ztext
+ MYLIBS=
+
+ # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
+
+-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
++PLATS= solaris
+
+-LUA_A= liblua.a
++LUA_SO= liblua.so
+ CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
+ lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
+ lundump.o lvm.o lzio.o
+@@ -36,10 +35,10 @@
+ LUAC_O= luac.o print.o
+
+ ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+-ALL_A= $(LUA_A)
++ALL_T= $(LUA_SO) $(LUA_T) $(LUAC_T)
++ALL_A= $(LUA_SO)
+
+-default: $(PLAT)
++default: solaris
+
+ all: $(ALL_T)
+
+@@ -47,15 +46,15 @@
+
+ a: $(ALL_A)
+
+-$(LUA_A): $(CORE_O) $(LIB_O)
+- $(AR) $@ $?
+- $(RANLIB) $@
++$(LUA_SO): $(CORE_O) $(LIB_O)
++ $(CC) -o $(LUA_SO) -G -h $(LUA_SO) $(CFLAGS) $(MYLDFLAGS) $(CORE_O) \
++ $(LIB_O) $(LIBS)
+
+-$(LUA_T): $(LUA_O) $(LUA_A)
+- $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
++$(LUA_T): $(LUA_O) $(LUA_SO)
++ $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_SO) $(LIBS)
+
+-$(LUAC_T): $(LUAC_O) $(LUA_A)
+- $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
++$(LUAC_T): $(LUAC_O) $(LUA_SO)
++ $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_SO) $(LIBS)
+
+ clean:
+ $(RM) $(ALL_T) $(ALL_O)
+@@ -74,46 +73,8 @@
+ @echo "MYLDFLAGS = $(MYLDFLAGS)"
+ @echo "MYLIBS = $(MYLIBS)"
+
+-# convenience targets for popular platforms
+-
+-none:
+- @echo "Please choose a platform:"
+- @echo " $(PLATS)"
+-
+-aix:
+- $(MAKE) all CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl" MYLDFLAGS="-brtl -bexpall"
+-
+-ansi:
+- $(MAKE) all MYCFLAGS=-DLUA_ANSI
+-
+-bsd:
+- $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-Wl,-E"
+-
+-freebsd:
+- $(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
+-
+-generic:
+- $(MAKE) all MYCFLAGS=
+-
+-linux:
+- $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
+-
+-macosx:
+- $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
+-# use this on Mac OS X 10.3-
+-# $(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
+-
+-mingw:
+- $(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
+- "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
+- "MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
+- $(MAKE) "LUAC_T=luac.exe" luac.exe
+-
+-posix:
+- $(MAKE) all MYCFLAGS=-DLUA_USE_POSIX
+-
+ solaris:
+- $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
++ $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN -D__EXTENSIONS__" MYLIBS="-ldl"
+
+ # list targets that do not create files (but not all makes understand .PHONY)
+ .PHONY: all $(PLATS) default o a clean depend echo none
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/lua/patches/2.lua.pc.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,35 @@
+--- lua-5.1.4/etc/lua.pc.orig Fri Aug 8 05:46:11 2008
++++ lua-5.1.4/etc/lua.pc Tue Feb 15 18:30:23 2011
+@@ -1,22 +1,6 @@
+ # lua.pc -- pkg-config data for Lua
+
+-# vars from install Makefile
+-
+-# grep '^V=' ../Makefile
+-V= 5.1
+-# grep '^R=' ../Makefile
+-R= 5.1.4
+-
+-# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
+-prefix= /usr/local
+-INSTALL_BIN= ${prefix}/bin
+-INSTALL_INC= ${prefix}/include
+-INSTALL_LIB= ${prefix}/lib
+-INSTALL_MAN= ${prefix}/man/man1
+-INSTALL_LMOD= ${prefix}/share/lua/${V}
+-INSTALL_CMOD= ${prefix}/lib/lua/${V}
+-
+-# canonical vars
++prefix=${PROTO_DIR}/usr
+ exec_prefix=${prefix}
+ libdir=${exec_prefix}/lib
+ includedir=${prefix}/include
+@@ -23,7 +7,7 @@
+
+ Name: Lua
+ Description: An Extensible Extension Language
+-Version: ${R}
++Version: 5.1.4
+ Requires:
+ Libs: -L${libdir} -llua -lm
+ Cflags: -I${includedir}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/lua/patches/3.headers.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,67 @@
+--- lua-5.1.4/src/lua.h.orig 2009-01-06 02:15:11.179130113 -0800
++++ lua-5.1.4/src/lua.h 2009-01-06 02:15:56.570695998 -0800
+@@ -9,6 +9,10 @@
+ #ifndef lua_h
+ #define lua_h
+
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ #include <stdarg.h>
+ #include <stddef.h>
+
+@@ -384,5 +388,8 @@
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ ******************************************************************************/
+
++#ifdef __cplusplus
++}
++#endif
+
+ #endif
+--- lua-5.1.4/src/lualib.h.orig 2009-01-06 02:15:19.193417835 -0800
++++ lua-5.1.4/src/lualib.h 2009-01-06 02:16:20.502288036 -0800
+@@ -8,6 +8,10 @@
+ #ifndef lualib_h
+ #define lualib_h
+
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ #include "lua.h"
+
+
+@@ -49,5 +53,8 @@
+ #define lua_assert(x) ((void)0)
+ #endif
+
++#ifdef __cplusplus
++}
++#endif
+
+ #endif
+--- lua-5.1.4/src/lauxlib.h.orig 2009-01-06 02:15:37.967244620 -0800
++++ lua-5.1.4/src/lauxlib.h 2009-01-06 02:16:26.398180986 -0800
+@@ -8,6 +8,9 @@
+ #ifndef lauxlib_h
+ #define lauxlib_h
+
++#ifdef __cplusplus
++extern "C" {
++#endif
+
+ #include <stddef.h>
+ #include <stdio.h>
+@@ -169,6 +172,10 @@
+
+ #define luaL_reg luaL_Reg
+
++#ifdef __cplusplus
++}
++#endif
++
+ #endif
+
+
--- a/components/mercurial/manpages.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
---- mercurial-1.3.1/doc/hg.1 Thu Jul 23 10:58:26 2009
-+++ /usr/share/man/man1/hg.1 Tue Feb 19 05:28:30 2002
-@@ -1,4 +1,9 @@
- '\" t
-+.\"
-+.\" Modified for Solaris to to add the Solaris stability classification,
-+.\" and to add a note about source availability.
-+.\"
-+'\" t
- .\" Title: hg
- .\" Author: [see the "AUTHOR" section]
- .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
-@@ -757,7 +762,7 @@
- .RS 4
- .\}
- .nf
--$ cp \-al REPO REPOCLONE
-+$ /usr/gnu/bin/cp \-al REPO REPOCLONE
- .fi
- .if n \{\
- .RE
-@@ -4331,6 +4336,12 @@
- .RE
- .sp
- Some commands (e\&.g\&. revert) produce backup files ending in \&.orig, if the \&.orig file already exists and is not tracked by Mercurial, it will be overwritten\&.
-+.TP
-+/usr/demo/mercurial
-+This directory contains assorted files which are part of the Mercurial
-+distribution, but not core to its functionality&. They will generally
-+need to be copied elsewhere to be of use.
-+
- .SH "BUGS"
- .sp
- Probably lots, please post them to the mailing list (See Resources below) when you find them\&.
-@@ -4376,3 +4387,23 @@
- .RS 4
- \%http://selenic.com/mailman/listinfo/mercurial
- .RE
-+.\" Begin Sun update
-+.SH ATTRIBUTES
-+See
-+.BR attributes (5)
-+for descriptions of the following attributes:
-+.sp
-+.TS
-+box;
-+cbp-1 | cbp-1
-+l | l .
-+ATTRIBUTE TYPE ATTRIBUTE VALUE
-+=
-+Availability developer/versioning/mercurial
-+=
-+Interface Stability Volatile
-+.TE
-+.PP
-+.SH NOTES
-+Source for Mercurial is available on http://opensolaris.org.
-+.\" End Sun update
---- mercurial-1.3.1/doc/hgrc.5 Thu Jul 23 10:58:38 2009
-+++ /usr/share/man/man5/hgrc.5 Tue Feb 19 05:28:30 2002
-@@ -1,4 +1,9 @@
- '\" t
-+.\"
-+.\" Modified for Solaris to to add the Solaris stability classification,
-+.\" and to add a note about source availability.
-+.\"
-+'\" t
- .\" Title: hgrc
- .\" Author: [see the "AUTHOR" section]
- .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
-@@ -27,7 +32,7 @@
- .sp
- Mercurial reads configuration data from several files, if they exist\&. The names of these files depend on the system on which Mercurial is installed\&. *\&.rc files from a single directory are read in alphabetical order, later ones overriding earlier ones\&. Where multiple paths are given below, settings from later paths override earlier ones\&.
- .PP
--(Unix) <install\-root>/etc/mercurial/hgrc\&.d/*\&.rc, (Unix) <install\-root>/etc/mercurial/hgrc
-+<install\-root>/etc/mercurial/hgrc\&.d/*\&.rc, <install\-root>/etc/mercurial/hgrc
- .RS 4
- Per\-installation configuration files, searched for in the directory where Mercurial is installed\&.
- <install\-root>
-@@ -36,12 +41,12 @@
- /shared/tools/etc/mercurial/hgrc\&. Options in these files apply to all Mercurial commands executed by any user in any directory\&.
- .RE
- .PP
--(Unix) /etc/mercurial/hgrc\&.d/*\&.rc, (Unix) /etc/mercurial/hgrc
-+/etc/mercurial/hgrc\&.d/*\&.rc, /etc/mercurial/hgrc
- .RS 4
- Per\-system configuration files, for the system on which Mercurial is running\&. Options in these files apply to all Mercurial commands executed by any user in any directory\&. Options in these files override per\-installation options\&.
- .RE
- .PP
--(Windows) <install\-dir>\eMercurial\&.ini, or else, (Windows) HKEY_LOCAL_MACHINE\eSOFTWARE\eMercurial, or else, (Windows) C:\eMercurial\eMercurial\&.ini
-+(Windows) <install\-dir>\eMercurial\&.ini, or else
- .RS 4
- Per\-installation/system configuration files, for the system on which Mercurial is running\&. Options in these files apply to all Mercurial commands executed by any user in any directory\&. Registry keys contain PATH\-like strings, every part of which must reference a
- Mercurial\&.ini
-@@ -50,7 +55,7 @@
- files will be read\&.
- .RE
- .PP
--(Unix) $HOME/\&.hgrc, (Windows) %HOME%\eMercurial\&.ini, (Windows) %HOME%\e\&.hgrc, (Windows) %USERPROFILE%\eMercurial\&.ini, (Windows) %USERPROFILE%\e\&.hgrc
-+$HOME/\&.hgrc
- .RS 4
- Per\-user configuration file(s), for the user running Mercurial\&. On Windows 9x,
- %HOME%
-@@ -58,7 +63,7 @@
- %APPDATA%\&. Options in these files apply to all Mercurial commands executed by this user in any directory\&. Options in these files override per\-installation and per\-system options\&.
- .RE
- .PP
--(Unix, Windows) <repo>/\&.hg/hgrc
-+<repo>/\&.hg/hgrc
- .RS 4
- Per\-repository configuration options that only apply in a particular repository\&. This file is not version\-controlled, and will not get transferred during a "clone" operation\&. Options in this file override options in all other configuration files\&. On Unix, most of this file will be ignored if it doesn\(cqt belong to a trusted user or to a trusted group\&. See the documentation for the trusted section below for more details\&.
- .RE
-@@ -874,7 +879,7 @@
- patch content and patched files end of lines are preserved\&. When set to
- \fIlf\fR
- or
--\fIcrlf\fR, both files end of lines are ignored when patching and the result line endings are normalized to either LF (Unix) or CRLF (Windows)\&. Default: strict\&.
-+\fIcrlf\fR, both files end of lines are ignored when patching and the result line endings are normalized to either LF or CRLF (Windows)\&. Default: strict\&.
- .RE
- .RE
- .PP
-@@ -1275,3 +1280,23 @@
- .RS 4
- \%mailto:[email protected]
- .RE
-+.\" Begin Sun update
-+.SH ATTRIBUTES
-+See
-+.BR attributes (5)
-+for descriptions of the following attributes:
-+.sp
-+.TS
-+box;
-+cbp-1 | cbp-1
-+l | l .
-+ATTRIBUTE TYPE ATTRIBUTE VALUE
-+=
-+Availability developer/versioning/mercurial
-+=
-+Interface Stability Volatile
-+.TE
-+.PP
-+.SH NOTES
-+Source for Mercurial is available on http://opensolaris.org.
-+.\" End Sun update
---- mercurial-1.3.1/doc/hgignore.5 Thu Jul 23 10:58:30 2009
-+++ /usr/share/man/man5/hgignore.5 Tue Feb 19 05:28:30 2002
-@@ -1,4 +1,9 @@
- '\" t
-+.\"
-+.\" Modified for Solaris to to add the Solaris stability classification,
-+.\" and to add a note about source availability.
-+.\"
-+'\" t
- .\" Title: hgignore
- .\" Author: [see the "AUTHOR" section]
- .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
-@@ -119,3 +124,23 @@
- .RS 4
- \%mailto:[email protected]
- .RE
-+.\" Begin Sun update
-+.SH ATTRIBUTES
-+See
-+.BR attributes (5)
-+for descriptions of the following attributes:
-+.sp
-+.TS
-+box;
-+cbp-1 | cbp-1
-+l | l .
-+ATTRIBUTE TYPE ATTRIBUTE VALUE
-+=
-+Availability developer/versioning/mercurial
-+=
-+Interface Stability Volatile
-+.TE
-+.PP
-+.SH NOTES
-+Source for Mercurial is available on http://opensolaris.org.
-+.\" End Sun update
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/mercurial/patches/manpages.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,181 @@
+--- mercurial-1.3.1/doc/hg.1 Thu Jul 23 10:58:26 2009
++++ /usr/share/man/man1/hg.1 Tue Feb 19 05:28:30 2002
+@@ -1,4 +1,9 @@
+ '\" t
++.\"
++.\" Modified for Solaris to to add the Solaris stability classification,
++.\" and to add a note about source availability.
++.\"
++'\" t
+ .\" Title: hg
+ .\" Author: [see the "AUTHOR" section]
+ .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
+@@ -757,7 +762,7 @@
+ .RS 4
+ .\}
+ .nf
+-$ cp \-al REPO REPOCLONE
++$ /usr/gnu/bin/cp \-al REPO REPOCLONE
+ .fi
+ .if n \{\
+ .RE
+@@ -4331,6 +4336,12 @@
+ .RE
+ .sp
+ Some commands (e\&.g\&. revert) produce backup files ending in \&.orig, if the \&.orig file already exists and is not tracked by Mercurial, it will be overwritten\&.
++.TP
++/usr/demo/mercurial
++This directory contains assorted files which are part of the Mercurial
++distribution, but not core to its functionality&. They will generally
++need to be copied elsewhere to be of use.
++
+ .SH "BUGS"
+ .sp
+ Probably lots, please post them to the mailing list (See Resources below) when you find them\&.
+@@ -4376,3 +4387,23 @@
+ .RS 4
+ \%http://selenic.com/mailman/listinfo/mercurial
+ .RE
++.\" Begin Sun update
++.SH ATTRIBUTES
++See
++.BR attributes (5)
++for descriptions of the following attributes:
++.sp
++.TS
++box;
++cbp-1 | cbp-1
++l | l .
++ATTRIBUTE TYPE ATTRIBUTE VALUE
++=
++Availability developer/versioning/mercurial
++=
++Interface Stability Volatile
++.TE
++.PP
++.SH NOTES
++Source for Mercurial is available on http://opensolaris.org.
++.\" End Sun update
+--- mercurial-1.3.1/doc/hgrc.5 Thu Jul 23 10:58:38 2009
++++ /usr/share/man/man5/hgrc.5 Tue Feb 19 05:28:30 2002
+@@ -1,4 +1,9 @@
+ '\" t
++.\"
++.\" Modified for Solaris to to add the Solaris stability classification,
++.\" and to add a note about source availability.
++.\"
++'\" t
+ .\" Title: hgrc
+ .\" Author: [see the "AUTHOR" section]
+ .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
+@@ -27,7 +32,7 @@
+ .sp
+ Mercurial reads configuration data from several files, if they exist\&. The names of these files depend on the system on which Mercurial is installed\&. *\&.rc files from a single directory are read in alphabetical order, later ones overriding earlier ones\&. Where multiple paths are given below, settings from later paths override earlier ones\&.
+ .PP
+-(Unix) <install\-root>/etc/mercurial/hgrc\&.d/*\&.rc, (Unix) <install\-root>/etc/mercurial/hgrc
++<install\-root>/etc/mercurial/hgrc\&.d/*\&.rc, <install\-root>/etc/mercurial/hgrc
+ .RS 4
+ Per\-installation configuration files, searched for in the directory where Mercurial is installed\&.
+ <install\-root>
+@@ -36,12 +41,12 @@
+ /shared/tools/etc/mercurial/hgrc\&. Options in these files apply to all Mercurial commands executed by any user in any directory\&.
+ .RE
+ .PP
+-(Unix) /etc/mercurial/hgrc\&.d/*\&.rc, (Unix) /etc/mercurial/hgrc
++/etc/mercurial/hgrc\&.d/*\&.rc, /etc/mercurial/hgrc
+ .RS 4
+ Per\-system configuration files, for the system on which Mercurial is running\&. Options in these files apply to all Mercurial commands executed by any user in any directory\&. Options in these files override per\-installation options\&.
+ .RE
+ .PP
+-(Windows) <install\-dir>\eMercurial\&.ini, or else, (Windows) HKEY_LOCAL_MACHINE\eSOFTWARE\eMercurial, or else, (Windows) C:\eMercurial\eMercurial\&.ini
++(Windows) <install\-dir>\eMercurial\&.ini, or else
+ .RS 4
+ Per\-installation/system configuration files, for the system on which Mercurial is running\&. Options in these files apply to all Mercurial commands executed by any user in any directory\&. Registry keys contain PATH\-like strings, every part of which must reference a
+ Mercurial\&.ini
+@@ -50,7 +55,7 @@
+ files will be read\&.
+ .RE
+ .PP
+-(Unix) $HOME/\&.hgrc, (Windows) %HOME%\eMercurial\&.ini, (Windows) %HOME%\e\&.hgrc, (Windows) %USERPROFILE%\eMercurial\&.ini, (Windows) %USERPROFILE%\e\&.hgrc
++$HOME/\&.hgrc
+ .RS 4
+ Per\-user configuration file(s), for the user running Mercurial\&. On Windows 9x,
+ %HOME%
+@@ -58,7 +63,7 @@
+ %APPDATA%\&. Options in these files apply to all Mercurial commands executed by this user in any directory\&. Options in these files override per\-installation and per\-system options\&.
+ .RE
+ .PP
+-(Unix, Windows) <repo>/\&.hg/hgrc
++<repo>/\&.hg/hgrc
+ .RS 4
+ Per\-repository configuration options that only apply in a particular repository\&. This file is not version\-controlled, and will not get transferred during a "clone" operation\&. Options in this file override options in all other configuration files\&. On Unix, most of this file will be ignored if it doesn\(cqt belong to a trusted user or to a trusted group\&. See the documentation for the trusted section below for more details\&.
+ .RE
+@@ -874,7 +879,7 @@
+ patch content and patched files end of lines are preserved\&. When set to
+ \fIlf\fR
+ or
+-\fIcrlf\fR, both files end of lines are ignored when patching and the result line endings are normalized to either LF (Unix) or CRLF (Windows)\&. Default: strict\&.
++\fIcrlf\fR, both files end of lines are ignored when patching and the result line endings are normalized to either LF or CRLF (Windows)\&. Default: strict\&.
+ .RE
+ .RE
+ .PP
+@@ -1275,3 +1280,23 @@
+ .RS 4
+ \%mailto:[email protected]
+ .RE
++.\" Begin Sun update
++.SH ATTRIBUTES
++See
++.BR attributes (5)
++for descriptions of the following attributes:
++.sp
++.TS
++box;
++cbp-1 | cbp-1
++l | l .
++ATTRIBUTE TYPE ATTRIBUTE VALUE
++=
++Availability developer/versioning/mercurial
++=
++Interface Stability Volatile
++.TE
++.PP
++.SH NOTES
++Source for Mercurial is available on http://opensolaris.org.
++.\" End Sun update
+--- mercurial-1.3.1/doc/hgignore.5 Thu Jul 23 10:58:30 2009
++++ /usr/share/man/man5/hgignore.5 Tue Feb 19 05:28:30 2002
+@@ -1,4 +1,9 @@
+ '\" t
++.\"
++.\" Modified for Solaris to to add the Solaris stability classification,
++.\" and to add a note about source availability.
++.\"
++'\" t
+ .\" Title: hgignore
+ .\" Author: [see the "AUTHOR" section]
+ .\" Generator: DocBook XSL Stylesheets v1.75.1 <http://docbook.sf.net/>
+@@ -119,3 +124,23 @@
+ .RS 4
+ \%mailto:[email protected]
+ .RE
++.\" Begin Sun update
++.SH ATTRIBUTES
++See
++.BR attributes (5)
++for descriptions of the following attributes:
++.sp
++.TS
++box;
++cbp-1 | cbp-1
++l | l .
++ATTRIBUTE TYPE ATTRIBUTE VALUE
++=
++Availability developer/versioning/mercurial
++=
++Interface Stability Volatile
++.TE
++.PP
++.SH NOTES
++Source for Mercurial is available on http://opensolaris.org.
++.\" End Sun update
--- a/components/patch/DESTDIR.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
---- patch-2.5.9/Makefile.in.orig Tue May 20 09:15:48 2003
-+++ patch-2.5.9/Makefile.in Thu Feb 3 13:41:39 2011
-@@ -112,11 +112,11 @@
- $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
-
- install:: all installdirs
-- $(INSTALL_PROGRAM) patch$(EXEEXT) $(bindir)/$(patch_name)$(EXEEXT)
-- -$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext)
-+ $(INSTALL_PROGRAM) patch$(EXEEXT) $(DESTDIR)/$(bindir)/$(patch_name)$(EXEEXT)
-+ -$(INSTALL_DATA) $(srcdir)/patch.man $(DESTDIR)/$(man1dir)/$(patch_name)$(man1ext)
-
- installdirs::
-- $(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir)
-+ $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)/$(bindir) $(DESTDIR)/$(man1dir)
-
- install-strip::
- $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/patch/patches/DESTDIR.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,17 @@
+--- patch-2.5.9/Makefile.in.orig Tue May 20 09:15:48 2003
++++ patch-2.5.9/Makefile.in Thu Feb 3 13:41:39 2011
+@@ -112,11 +112,11 @@
+ $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
+
+ install:: all installdirs
+- $(INSTALL_PROGRAM) patch$(EXEEXT) $(bindir)/$(patch_name)$(EXEEXT)
+- -$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext)
++ $(INSTALL_PROGRAM) patch$(EXEEXT) $(DESTDIR)/$(bindir)/$(patch_name)$(EXEEXT)
++ -$(INSTALL_DATA) $(srcdir)/patch.man $(DESTDIR)/$(man1dir)/$(patch_name)$(man1ext)
+
+ installdirs::
+- $(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir)
++ $(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)/$(bindir) $(DESTDIR)/$(man1dir)
+
+ install-strip::
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
--- a/components/python/pyopenssl/no-zip_safe.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
---- pyOpenSSL-0.11/setup.py.orig Mon Feb 14 23:17:02 2011
-+++ pyOpenSSL-0.11/setup.py Mon Feb 14 23:17:31 2011
-@@ -203,7 +203,6 @@
- 'OpenSSL.test.test_crypto',
- 'OpenSSL.test.test_rand',
- 'OpenSSL.test.test_ssl'],
-- zip_safe = False,
- cmdclass = {"build_ext": BuildExtension},
- description = 'Python wrapper module around the OpenSSL library',
- author = 'Martin Sjögren, AB Strakt',
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/pyopenssl/patches/no-zip_safe.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,10 @@
+--- pyOpenSSL-0.11/setup.py.orig Mon Feb 14 23:17:02 2011
++++ pyOpenSSL-0.11/setup.py Mon Feb 14 23:17:31 2011
+@@ -203,7 +203,6 @@
+ 'OpenSSL.test.test_crypto',
+ 'OpenSSL.test.test_rand',
+ 'OpenSSL.test.test_ssl'],
+- zip_safe = False,
+ cmdclass = {"build_ext": BuildExtension},
+ description = 'Python wrapper module around the OpenSSL library',
+ author = 'Martin Sjögren, AB Strakt',
--- a/components/python/python26/Python26-00-filemagic.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2232 +0,0 @@
-diff -u Python-2.6.4/Lib/platform.py.orig Python-2.6.4/Lib/platform.py
---- Python-2.6.4/Lib/platform.py.orig Mon Feb 21 10:46:30 2011
-+++ Python-2.6.4/Lib/platform.py Mon Feb 21 10:46:30 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """ This module tries to retrieve as much platform-identifying data as
- possible. It makes this information available via function APIs.
-diff -u Python-2.6.4/Lib/profile.py.orig Python-2.6.4/Lib/profile.py
---- Python-2.6.4/Lib/profile.py.orig Mon Feb 21 10:46:25 2011
-+++ Python-2.6.4/Lib/profile.py Mon Feb 21 10:46:25 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # Class for profiling python code. rev 1.0 6/2/94
- #
-diff -u Python-2.6.4/Lib/trace.py.orig Python-2.6.4/Lib/trace.py
---- Python-2.6.4/Lib/trace.py.orig Mon Feb 21 10:46:29 2011
-+++ Python-2.6.4/Lib/trace.py Mon Feb 21 10:46:29 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- # portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
- # err... reserved and offered to the public under the terms of the
-diff -u Python-2.6.4/Lib/cProfile.py.orig Python-2.6.4/Lib/cProfile.py
---- Python-2.6.4/Lib/cProfile.py.orig Mon Feb 21 10:46:29 2011
-+++ Python-2.6.4/Lib/cProfile.py Mon Feb 21 10:46:29 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Python interface for the 'lsprof' profiler.
- Compatible with the 'profile' module.
-diff -u Python-2.6.4/Lib/idlelib/PyShell.py.orig Python-2.6.4/Lib/idlelib/PyShell.py
---- Python-2.6.4/Lib/idlelib/PyShell.py.orig Mon Feb 21 10:46:23 2011
-+++ Python-2.6.4/Lib/idlelib/PyShell.py Mon Feb 21 10:46:23 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- import os
- import os.path
-diff -u Python-2.6.4/Lib/UserString.py.orig Python-2.6.4/Lib/UserString.py
---- Python-2.6.4/Lib/UserString.py.orig Mon Feb 21 10:46:27 2011
-+++ Python-2.6.4/Lib/UserString.py Mon Feb 21 10:46:27 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- ## vim:ts=4:et:nowrap
- """A user-defined wrapper around string objects
-
-diff -u Python-2.6.4/Lib/lib2to3/tests/pytree_idempotency.py.orig Python-2.6.4/Lib/lib2to3/tests/pytree_idempotency.py
---- Python-2.6.4/Lib/lib2to3/tests/pytree_idempotency.py.orig Mon Feb 21 10:46:24 2011
-+++ Python-2.6.4/Lib/lib2to3/tests/pytree_idempotency.py Mon Feb 21 10:46:24 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python2.5
-+#!/usr/bin/python2.6
- # Copyright 2006 Google, Inc. All Rights Reserved.
- # Licensed to PSF under a Contributor Agreement.
-
-diff -u Python-2.6.4/Lib/lib2to3/tests/test_all_fixers.py.orig Python-2.6.4/Lib/lib2to3/tests/test_all_fixers.py
---- Python-2.6.4/Lib/lib2to3/tests/test_all_fixers.py.orig Mon Feb 21 10:46:24 2011
-+++ Python-2.6.4/Lib/lib2to3/tests/test_all_fixers.py Mon Feb 21 10:46:24 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python2.5
-+#!/usr/bin/python2.6
- """Tests that run all fixer modules over an input stream.
-
- This has been broken out into its own test module because of its
-diff -u Python-2.6.4/Lib/lib2to3/tests/test_util.py.orig Python-2.6.4/Lib/lib2to3/tests/test_util.py
---- Python-2.6.4/Lib/lib2to3/tests/test_util.py.orig Mon Feb 21 10:46:24 2011
-+++ Python-2.6.4/Lib/lib2to3/tests/test_util.py Mon Feb 21 10:46:24 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python2.5
-+#!/usr/bin/python2.6
- """ Test suite for the code in fixes.util """
- # Author: Collin Winter
-
-diff -u Python-2.6.4/Lib/lib2to3/tests/test_parser.py.orig Python-2.6.4/Lib/lib2to3/tests/test_parser.py
---- Python-2.6.4/Lib/lib2to3/tests/test_parser.py.orig Mon Feb 21 10:46:24 2011
-+++ Python-2.6.4/Lib/lib2to3/tests/test_parser.py Mon Feb 21 10:46:24 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python2.5
-+#!/usr/bin/python2.6
- """Test suite for 2to3's parser and grammar files.
-
- This is the place to add tests for changes to 2to3's grammar, such as those
-diff -u Python-2.6.4/Lib/lib2to3/tests/test_pytree.py.orig Python-2.6.4/Lib/lib2to3/tests/test_pytree.py
---- Python-2.6.4/Lib/lib2to3/tests/test_pytree.py.orig Mon Feb 21 10:46:24 2011
-+++ Python-2.6.4/Lib/lib2to3/tests/test_pytree.py Mon Feb 21 10:46:24 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python2.5
-+#!/usr/bin/python2.6
- # Copyright 2006 Google, Inc. All Rights Reserved.
- # Licensed to PSF under a Contributor Agreement.
-
-diff -u Python-2.6.4/Lib/lib2to3/tests/test_fixers.py.orig Python-2.6.4/Lib/lib2to3/tests/test_fixers.py
---- Python-2.6.4/Lib/lib2to3/tests/test_fixers.py.orig Mon Feb 21 10:46:24 2011
-+++ Python-2.6.4/Lib/lib2to3/tests/test_fixers.py Mon Feb 21 10:46:24 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python2.5
-+#!/usr/bin/python2.6
- """ Test suite for the fixer modules """
- # Author: Collin Winter
-
-diff -u Python-2.6.4/Lib/lib2to3/refactor.py.orig Python-2.6.4/Lib/lib2to3/refactor.py
---- Python-2.6.4/Lib/lib2to3/refactor.py.orig Mon Feb 21 10:46:24 2011
-+++ Python-2.6.4/Lib/lib2to3/refactor.py Mon Feb 21 10:46:24 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python2.5
-+#!/usr/bin/python2.6
- # Copyright 2006 Google, Inc. All Rights Reserved.
- # Licensed to PSF under a Contributor Agreement.
-
-diff -u Python-2.6.4/Lib/lib2to3/pgen2/token.py.orig Python-2.6.4/Lib/lib2to3/pgen2/token.py
---- Python-2.6.4/Lib/lib2to3/pgen2/token.py.orig Mon Feb 21 10:46:25 2011
-+++ Python-2.6.4/Lib/lib2to3/pgen2/token.py Mon Feb 21 10:46:25 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Token constants (from "token.h")."""
-
-diff -u Python-2.6.4/Lib/cgi.py.orig Python-2.6.4/Lib/cgi.py
---- Python-2.6.4/Lib/cgi.py.orig Mon Feb 21 10:46:24 2011
-+++ Python-2.6.4/Lib/cgi.py Mon Feb 21 10:46:24 2011
-@@ -1,4 +1,4 @@
--#! /usr/local/bin/python
-+#!/usr/bin/python2.6
-
- # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
- # intentionally NOT "/usr/bin/env python". On many systems
-diff -u Python-2.6.4/Lib/base64.py.orig Python-2.6.4/Lib/base64.py
---- Python-2.6.4/Lib/base64.py.orig Mon Feb 21 10:46:36 2011
-+++ Python-2.6.4/Lib/base64.py Mon Feb 21 10:46:36 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """RFC 3548: Base16, Base32, Base64 Data Encodings"""
-
-diff -u Python-2.6.4/Lib/encodings/rot_13.py.orig Python-2.6.4/Lib/encodings/rot_13.py
---- Python-2.6.4/Lib/encodings/rot_13.py.orig Mon Feb 21 10:46:26 2011
-+++ Python-2.6.4/Lib/encodings/rot_13.py Mon Feb 21 10:46:26 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- """ Python Character Mapping Codec for ROT13.
-
- See http://ucsub.colorado.edu/~kominek/rot13/ for details.
-diff -u Python-2.6.4/Lib/tabnanny.py.orig Python-2.6.4/Lib/tabnanny.py
---- Python-2.6.4/Lib/tabnanny.py.orig Mon Feb 21 10:46:27 2011
-+++ Python-2.6.4/Lib/tabnanny.py Mon Feb 21 10:46:27 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """The Tab Nanny despises ambiguous indentation. She knows no mercy.
-
-diff -u Python-2.6.4/Lib/timeit.py.orig Python-2.6.4/Lib/timeit.py
---- Python-2.6.4/Lib/timeit.py.orig Mon Feb 21 10:46:23 2011
-+++ Python-2.6.4/Lib/timeit.py Mon Feb 21 10:46:23 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Tool for measuring execution time of small code snippets.
-
-diff -u Python-2.6.4/Lib/pydoc.py.orig Python-2.6.4/Lib/pydoc.py
---- Python-2.6.4/Lib/pydoc.py.orig Mon Feb 21 10:46:28 2011
-+++ Python-2.6.4/Lib/pydoc.py Mon Feb 21 10:46:28 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- # -*- coding: latin-1 -*-
- """Generate Python documentation in HTML or text for interactive use.
-
-diff -u Python-2.6.4/Lib/quopri.py.orig Python-2.6.4/Lib/quopri.py
---- Python-2.6.4/Lib/quopri.py.orig Mon Feb 21 10:46:29 2011
-+++ Python-2.6.4/Lib/quopri.py Mon Feb 21 10:46:29 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Conversions to/from quoted-printable transport encoding as per RFC 1521."""
-
-diff -u Python-2.6.4/Lib/keyword.py.orig Python-2.6.4/Lib/keyword.py
---- Python-2.6.4/Lib/keyword.py.orig Mon Feb 21 10:46:24 2011
-+++ Python-2.6.4/Lib/keyword.py Mon Feb 21 10:46:24 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Keywords (from "graminit.c")
-
-diff -u Python-2.6.4/Lib/mailbox.py.orig Python-2.6.4/Lib/mailbox.py
---- Python-2.6.4/Lib/mailbox.py.orig Mon Feb 21 10:46:27 2011
-+++ Python-2.6.4/Lib/mailbox.py Mon Feb 21 10:46:27 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes."""
-
-diff -u Python-2.6.4/Lib/difflib.py.orig Python-2.6.4/Lib/difflib.py
---- Python-2.6.4/Lib/difflib.py.orig Mon Feb 21 10:46:36 2011
-+++ Python-2.6.4/Lib/difflib.py Mon Feb 21 10:46:36 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """
- Module difflib -- helpers for computing deltas between objects.
-diff -u Python-2.6.4/Lib/webbrowser.py.orig Python-2.6.4/Lib/webbrowser.py
---- Python-2.6.4/Lib/webbrowser.py.orig Mon Feb 21 10:46:26 2011
-+++ Python-2.6.4/Lib/webbrowser.py Mon Feb 21 10:46:26 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Interfaces for launching and remotely controlling Web browsers."""
- # Maintained by Georg Brandl.
-
-diff -u Python-2.6.4/Lib/unittest.py.orig Python-2.6.4/Lib/unittest.py
---- Python-2.6.4/Lib/unittest.py.orig Mon Feb 21 10:46:28 2011
-+++ Python-2.6.4/Lib/unittest.py Mon Feb 21 10:46:28 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- '''
- Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
- Smalltalk testing framework.
-diff -u Python-2.6.4/Lib/bsddb/test/test_dbtables.py.orig Python-2.6.4/Lib/bsddb/test/test_dbtables.py
---- Python-2.6.4/Lib/bsddb/test/test_dbtables.py.orig Mon Feb 21 10:46:28 2011
-+++ Python-2.6.4/Lib/bsddb/test/test_dbtables.py Mon Feb 21 10:46:28 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- #-----------------------------------------------------------------------
- # A test suite for the table interface built on bsddb.db
-diff -u Python-2.6.4/Lib/bsddb/dbshelve.py.orig Python-2.6.4/Lib/bsddb/dbshelve.py
---- Python-2.6.4/Lib/bsddb/dbshelve.py.orig Mon Feb 21 10:46:28 2011
-+++ Python-2.6.4/Lib/bsddb/dbshelve.py Mon Feb 21 10:46:28 2011
-@@ -1,4 +1,4 @@
--#!/bin/env python
-+#!/usr/bin/python2.6
- #------------------------------------------------------------------------
- # Copyright (c) 1997-2001 by Total Control Software
- # All Rights Reserved
-diff -u Python-2.6.4/Lib/token.py.orig Python-2.6.4/Lib/token.py
---- Python-2.6.4/Lib/token.py.orig Mon Feb 21 10:46:28 2011
-+++ Python-2.6.4/Lib/token.py Mon Feb 21 10:46:28 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Token constants (from "token.h")."""
-
-diff -u Python-2.6.4/Lib/Cookie.py.orig Python-2.6.4/Lib/Cookie.py
---- Python-2.6.4/Lib/Cookie.py.orig Mon Feb 21 10:46:25 2011
-+++ Python-2.6.4/Lib/Cookie.py Mon Feb 21 10:46:25 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
-
- ####
-diff -u Python-2.6.4/Lib/smtplib.py.orig Python-2.6.4/Lib/smtplib.py
---- Python-2.6.4/Lib/smtplib.py.orig Mon Feb 21 10:46:28 2011
-+++ Python-2.6.4/Lib/smtplib.py Mon Feb 21 10:46:28 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- '''SMTP/ESMTP client class.
-
-diff -u Python-2.6.4/Lib/smtpd.py.orig Python-2.6.4/Lib/smtpd.py
---- Python-2.6.4/Lib/smtpd.py.orig Mon Feb 21 10:46:28 2011
-+++ Python-2.6.4/Lib/smtpd.py Mon Feb 21 10:46:28 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """An RFC 2821 smtp proxy.
-
- Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]
-diff -u Python-2.6.4/Lib/test/regrtest.py.orig Python-2.6.4/Lib/test/regrtest.py
---- Python-2.6.4/Lib/test/regrtest.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/regrtest.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Regression test.
-
-diff -u Python-2.6.4/Lib/test/test_sets.py.orig Python-2.6.4/Lib/test/test_sets.py
---- Python-2.6.4/Lib/test/test_sets.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/test_sets.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- import warnings
- warnings.filterwarnings("ignore", "the sets module is deprecated",
-diff -u Python-2.6.4/Lib/test/test_dl.py.orig Python-2.6.4/Lib/test/test_dl.py
---- Python-2.6.4/Lib/test/test_dl.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/test_dl.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Test dlmodule.c
- Roger E. Masse revised strategy by Barry Warsaw
- """
-diff -u Python-2.6.4/Lib/test/test_multiprocessing.py.orig Python-2.6.4/Lib/test/test_multiprocessing.py
---- Python-2.6.4/Lib/test/test_multiprocessing.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test_multiprocessing.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- #
- # Unit tests for the multiprocessing package
-diff -u Python-2.6.4/Lib/test/test_cmd.py.orig Python-2.6.4/Lib/test/test_cmd.py
---- Python-2.6.4/Lib/test/test_cmd.py.orig Mon Feb 21 10:46:36 2011
-+++ Python-2.6.4/Lib/test/test_cmd.py Mon Feb 21 10:46:36 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- """
- Test script for the 'cmd' module
- Original by Michael Schneider
-diff -u Python-2.6.4/Lib/test/test_userstring.py.orig Python-2.6.4/Lib/test/test_userstring.py
---- Python-2.6.4/Lib/test/test_userstring.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/test_userstring.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- # UserString is a wrapper around the native builtin string type.
- # UserString instances should behave similar to builtin string objects.
-
-diff -u Python-2.6.4/Lib/test/test_popen.py.orig Python-2.6.4/Lib/test/test_popen.py
---- Python-2.6.4/Lib/test/test_popen.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/test_popen.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Basic tests for os.popen()
-
- Particularly useful for platforms that fake popen.
-diff -u Python-2.6.4/Lib/test/test_cd.py.orig Python-2.6.4/Lib/test/test_cd.py
---- Python-2.6.4/Lib/test/test_cd.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/test_cd.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Whimpy test script for the cd module
- Roger E. Masse
- """
-diff -u Python-2.6.4/Lib/test/test_cl.py.orig Python-2.6.4/Lib/test/test_cl.py
---- Python-2.6.4/Lib/test/test_cl.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/test_cl.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Whimpy test script for the cl module
- Roger E. Masse
- """
-diff -u Python-2.6.4/Lib/test/test_imgfile.py.orig Python-2.6.4/Lib/test/test_imgfile.py
---- Python-2.6.4/Lib/test/test_imgfile.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test_imgfile.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Simple test script for imgfile.c
- Roger E. Masse
-diff -u Python-2.6.4/Lib/test/test_random.py.orig Python-2.6.4/Lib/test/test_random.py
---- Python-2.6.4/Lib/test/test_random.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test_random.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- import unittest
- import random
-diff -u Python-2.6.4/Lib/test/curses_tests.py.orig Python-2.6.4/Lib/test/curses_tests.py
---- Python-2.6.4/Lib/test/curses_tests.py.orig Mon Feb 21 10:46:32 2011
-+++ Python-2.6.4/Lib/test/curses_tests.py Mon Feb 21 10:46:32 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $
- #
-diff -u Python-2.6.4/Lib/test/test_codecmaps_cn.py.orig Python-2.6.4/Lib/test/test_codecmaps_cn.py
---- Python-2.6.4/Lib/test/test_codecmaps_cn.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/test_codecmaps_cn.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_codecmaps_cn.py
- # Codec mapping tests for PRC encodings
-diff -u Python-2.6.4/Lib/test/test_whichdb.py.orig Python-2.6.4/Lib/test/test_whichdb.py
---- Python-2.6.4/Lib/test/test_whichdb.py.orig Mon Feb 21 10:46:36 2011
-+++ Python-2.6.4/Lib/test/test_whichdb.py Mon Feb 21 10:46:36 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Test script for the whichdb module
- based on test_anydbm.py
- """
-diff -u Python-2.6.4/Lib/test/test_eof.py.orig Python-2.6.4/Lib/test/test_eof.py
---- Python-2.6.4/Lib/test/test_eof.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test_eof.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """test script for a few new invalid token catches"""
-
- import unittest
-diff -u Python-2.6.4/Lib/test/test_imageop.py.orig Python-2.6.4/Lib/test/test_imageop.py
---- Python-2.6.4/Lib/test/test_imageop.py.orig Mon Feb 21 10:46:31 2011
-+++ Python-2.6.4/Lib/test/test_imageop.py Mon Feb 21 10:46:31 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Test script for the imageop module. This has the side
- effect of partially testing the imgfile module as well.
-diff -u Python-2.6.4/Lib/test/test_codecmaps_tw.py.orig Python-2.6.4/Lib/test/test_codecmaps_tw.py
---- Python-2.6.4/Lib/test/test_codecmaps_tw.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test_codecmaps_tw.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_codecmaps_tw.py
- # Codec mapping tests for ROC encodings
-diff -u Python-2.6.4/Lib/test/test_codecencodings_hk.py.orig Python-2.6.4/Lib/test/test_codecencodings_hk.py
---- Python-2.6.4/Lib/test/test_codecencodings_hk.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/test_codecencodings_hk.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_codecencodings_hk.py
- # Codec encoding tests for HongKong encodings.
-diff -u Python-2.6.4/Lib/test/test_codecencodings_jp.py.orig Python-2.6.4/Lib/test/test_codecencodings_jp.py
---- Python-2.6.4/Lib/test/test_codecencodings_jp.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/test_codecencodings_jp.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_codecencodings_jp.py
- # Codec encoding tests for Japanese encodings.
-diff -u Python-2.6.4/Lib/test/test_with.py.orig Python-2.6.4/Lib/test/test_with.py
---- Python-2.6.4/Lib/test/test_with.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/test_with.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Unit tests for the with statement specified in PEP 343."""
-
-diff -u Python-2.6.4/Lib/test/crashers/recursive_call.py.orig Python-2.6.4/Lib/test/crashers/recursive_call.py
---- Python-2.6.4/Lib/test/crashers/recursive_call.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/crashers/recursive_call.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- # No bug report AFAIK, mail on python-dev on 2006-01-10
-
-diff -u Python-2.6.4/Lib/test/test_codecmaps_kr.py.orig Python-2.6.4/Lib/test/test_codecmaps_kr.py
---- Python-2.6.4/Lib/test/test_codecmaps_kr.py.orig Mon Feb 21 10:46:32 2011
-+++ Python-2.6.4/Lib/test/test_codecmaps_kr.py Mon Feb 21 10:46:32 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_codecmaps_kr.py
- # Codec mapping tests for ROK encodings
-diff -u Python-2.6.4/Lib/test/test_array.py.orig Python-2.6.4/Lib/test/test_array.py
---- Python-2.6.4/Lib/test/test_array.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/test_array.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Test the arraymodule.
- Roger E. Masse
- """
-diff -u Python-2.6.4/Lib/test/test_pep263.py.orig Python-2.6.4/Lib/test/test_pep263.py
---- Python-2.6.4/Lib/test/test_pep263.py.orig Mon Feb 21 10:46:32 2011
-+++ Python-2.6.4/Lib/test/test_pep263.py Mon Feb 21 10:46:32 2011
-@@ -1,4 +1,4 @@
--#! -*- coding: koi8-r -*-
-+#!/usr/bin/python2.6
- # This file is marked as binary in SVN, to prevent MacCVS from recoding it.
-
- import unittest
-diff -u Python-2.6.4/Lib/test/test_anydbm.py.orig Python-2.6.4/Lib/test/test_anydbm.py
---- Python-2.6.4/Lib/test/test_anydbm.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test_anydbm.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Test script for the anydbm module
- based on testdumbdbm.py
- """
-diff -u Python-2.6.4/Lib/test/test_smtpnet.py.orig Python-2.6.4/Lib/test/test_smtpnet.py
---- Python-2.6.4/Lib/test/test_smtpnet.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/test_smtpnet.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- import unittest
- from test import test_support
-diff -u Python-2.6.4/Lib/test/test_al.py.orig Python-2.6.4/Lib/test/test_al.py
---- Python-2.6.4/Lib/test/test_al.py.orig Mon Feb 21 10:46:31 2011
-+++ Python-2.6.4/Lib/test/test_al.py Mon Feb 21 10:46:31 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Whimpy test script for the al module
- Roger E. Masse
- """
-diff -u Python-2.6.4/Lib/test/test_urllib2net.py.orig Python-2.6.4/Lib/test/test_urllib2net.py
---- Python-2.6.4/Lib/test/test_urllib2net.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/test_urllib2net.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- import unittest
- from test import test_support
-diff -u Python-2.6.4/Lib/test/test_marshal.py.orig Python-2.6.4/Lib/test/test_marshal.py
---- Python-2.6.4/Lib/test/test_marshal.py.orig Mon Feb 21 10:46:32 2011
-+++ Python-2.6.4/Lib/test/test_marshal.py Mon Feb 21 10:46:32 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- # -*- coding: iso-8859-1 -*-
-
- from test import test_support
-diff -u Python-2.6.4/Lib/test/test_urlparse.py.orig Python-2.6.4/Lib/test/test_urlparse.py
---- Python-2.6.4/Lib/test/test_urlparse.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/test_urlparse.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- from test import test_support
- import unittest
-diff -u Python-2.6.4/Lib/test/test_bz2.py.orig Python-2.6.4/Lib/test/test_bz2.py
---- Python-2.6.4/Lib/test/test_bz2.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/test_bz2.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- from test import test_support
- from test.test_support import TESTFN
-
-diff -u Python-2.6.4/Lib/test/test_urllibnet.py.orig Python-2.6.4/Lib/test/test_urllibnet.py
---- Python-2.6.4/Lib/test/test_urllibnet.py.orig Mon Feb 21 10:46:32 2011
-+++ Python-2.6.4/Lib/test/test_urllibnet.py Mon Feb 21 10:46:32 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- import unittest
- from test import test_support
-diff -u Python-2.6.4/Lib/test/test_logging.py.orig Python-2.6.4/Lib/test/test_logging.py
---- Python-2.6.4/Lib/test/test_logging.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/test_logging.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # Copyright 2001-2004 by Vinay Sajip. All Rights Reserved.
- #
-diff -u Python-2.6.4/Lib/test/test_socket.py.orig Python-2.6.4/Lib/test/test_socket.py
---- Python-2.6.4/Lib/test/test_socket.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test_socket.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- import unittest
- from test import test_support
-diff -u Python-2.6.4/Lib/test/pystone.py.orig Python-2.6.4/Lib/test/pystone.py
---- Python-2.6.4/Lib/test/pystone.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/pystone.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """
- "PYSTONE" Benchmark Program
-diff -u Python-2.6.4/Lib/test/test_multibytecodec.py.orig Python-2.6.4/Lib/test/test_multibytecodec.py
---- Python-2.6.4/Lib/test/test_multibytecodec.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test_multibytecodec.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_multibytecodec.py
- # Unit test for multibytecodec itself
-diff -u Python-2.6.4/Lib/test/test_popen2.py.orig Python-2.6.4/Lib/test/test_popen2.py
---- Python-2.6.4/Lib/test/test_popen2.py.orig Mon Feb 21 10:46:33 2011
-+++ Python-2.6.4/Lib/test/test_popen2.py Mon Feb 21 10:46:33 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Test script for popen2.py"""
-
- import warnings
-diff -u Python-2.6.4/Lib/test/test_binhex.py.orig Python-2.6.4/Lib/test/test_binhex.py
---- Python-2.6.4/Lib/test/test_binhex.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/test_binhex.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Test script for the binhex C module
-
- Uses the mechanism of the python binhex module
-diff -u Python-2.6.4/Lib/test/test_gzip.py.orig Python-2.6.4/Lib/test/test_gzip.py
---- Python-2.6.4/Lib/test/test_gzip.py.orig Mon Feb 21 10:46:36 2011
-+++ Python-2.6.4/Lib/test/test_gzip.py Mon Feb 21 10:46:36 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Test script for the gzip module.
- """
-
-diff -u Python-2.6.4/Lib/test/re_tests.py.orig Python-2.6.4/Lib/test/re_tests.py
---- Python-2.6.4/Lib/test/re_tests.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/re_tests.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- # -*- mode: python -*-
-
- # Re test suite and benchmark suite v1.5
-diff -u Python-2.6.4/Lib/test/test_urllib2_localnet.py.orig Python-2.6.4/Lib/test/test_urllib2_localnet.py
---- Python-2.6.4/Lib/test/test_urllib2_localnet.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test_urllib2_localnet.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- import mimetools
- import threading
-diff -u Python-2.6.4/Lib/test/test_codecencodings_kr.py.orig Python-2.6.4/Lib/test/test_codecencodings_kr.py
---- Python-2.6.4/Lib/test/test_codecencodings_kr.py.orig Mon Feb 21 10:46:32 2011
-+++ Python-2.6.4/Lib/test/test_codecencodings_kr.py Mon Feb 21 10:46:32 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_codecencodings_kr.py
- # Codec encoding tests for ROK encodings.
-diff -u Python-2.6.4/Lib/test/test_multibytecodec_support.py.orig Python-2.6.4/Lib/test/test_multibytecodec_support.py
---- Python-2.6.4/Lib/test/test_multibytecodec_support.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test_multibytecodec_support.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_multibytecodec_support.py
- # Common Unittest Routines for CJK codecs
-diff -u Python-2.6.4/Lib/test/test_tcl.py.orig Python-2.6.4/Lib/test/test_tcl.py
---- Python-2.6.4/Lib/test/test_tcl.py.orig Mon Feb 21 10:46:36 2011
-+++ Python-2.6.4/Lib/test/test_tcl.py Mon Feb 21 10:46:36 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- import unittest
- import os
-diff -u Python-2.6.4/Lib/test/test_codecencodings_cn.py.orig Python-2.6.4/Lib/test/test_codecencodings_cn.py
---- Python-2.6.4/Lib/test/test_codecencodings_cn.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/test_codecencodings_cn.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_codecencodings_cn.py
- # Codec encoding tests for PRC encodings.
-diff -u Python-2.6.4/Lib/test/test_gl.py.orig Python-2.6.4/Lib/test/test_gl.py
---- Python-2.6.4/Lib/test/test_gl.py.orig Mon Feb 21 10:46:32 2011
-+++ Python-2.6.4/Lib/test/test_gl.py Mon Feb 21 10:46:32 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Very simple test script for the SGI gl library extension module
- taken mostly from the documentation.
- Roger E. Masse
-diff -u Python-2.6.4/Lib/test/test___future__.py.orig Python-2.6.4/Lib/test/test___future__.py
---- Python-2.6.4/Lib/test/test___future__.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test___future__.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- import unittest
- from test import test_support
- import __future__
-diff -u Python-2.6.4/Lib/test/test_bsddb.py.orig Python-2.6.4/Lib/test/test_bsddb.py
---- Python-2.6.4/Lib/test/test_bsddb.py.orig Mon Feb 21 10:46:36 2011
-+++ Python-2.6.4/Lib/test/test_bsddb.py Mon Feb 21 10:46:36 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Test script for the bsddb C module by Roger E. Masse
- Adapted to unittest format and expanded scope by Raymond Hettinger
- """
-diff -u Python-2.6.4/Lib/test/test_errno.py.orig Python-2.6.4/Lib/test/test_errno.py
---- Python-2.6.4/Lib/test/test_errno.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/test_errno.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Test the errno module
- Roger E. Masse
- """
-diff -u Python-2.6.4/Lib/test/test_optparse.py.orig Python-2.6.4/Lib/test/test_optparse.py
---- Python-2.6.4/Lib/test/test_optparse.py.orig Mon Feb 21 10:46:32 2011
-+++ Python-2.6.4/Lib/test/test_optparse.py Mon Feb 21 10:46:32 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
-
- #
- # Test suite for Optik. Supplied by Johannes Gijsbers
-diff -u Python-2.6.4/Lib/test/test_codecencodings_tw.py.orig Python-2.6.4/Lib/test/test_codecencodings_tw.py
---- Python-2.6.4/Lib/test/test_codecencodings_tw.py.orig Mon Feb 21 10:46:35 2011
-+++ Python-2.6.4/Lib/test/test_codecencodings_tw.py Mon Feb 21 10:46:35 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_codecencodings_tw.py
- # Codec encoding tests for ROC encodings.
-diff -u Python-2.6.4/Lib/test/test_codecmaps_jp.py.orig Python-2.6.4/Lib/test/test_codecmaps_jp.py
---- Python-2.6.4/Lib/test/test_codecmaps_jp.py.orig Mon Feb 21 10:46:32 2011
-+++ Python-2.6.4/Lib/test/test_codecmaps_jp.py Mon Feb 21 10:46:32 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_codecmaps_jp.py
- # Codec mapping tests for Japanese encodings
-diff -u Python-2.6.4/Lib/test/test_codecmaps_hk.py.orig Python-2.6.4/Lib/test/test_codecmaps_hk.py
---- Python-2.6.4/Lib/test/test_codecmaps_hk.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/test_codecmaps_hk.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # test_codecmaps_hk.py
- # Codec mapping tests for HongKong encodings
-diff -u Python-2.6.4/Lib/test/test_dumbdbm.py.orig Python-2.6.4/Lib/test/test_dumbdbm.py
---- Python-2.6.4/Lib/test/test_dumbdbm.py.orig Mon Feb 21 10:46:34 2011
-+++ Python-2.6.4/Lib/test/test_dumbdbm.py Mon Feb 21 10:46:34 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Test script for the dumbdbm module
- Original by Roger E. Masse
- """
-diff -u Python-2.6.4/Lib/tarfile.py.orig Python-2.6.4/Lib/tarfile.py
---- Python-2.6.4/Lib/tarfile.py.orig Mon Feb 21 10:46:38 2011
-+++ Python-2.6.4/Lib/tarfile.py Mon Feb 21 10:46:38 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- # -*- coding: iso-8859-1 -*-
- #-------------------------------------------------------------------
- # tarfile.py
-diff -u Python-2.6.4/Lib/uu.py.orig Python-2.6.4/Lib/uu.py
---- Python-2.6.4/Lib/uu.py.orig Mon Feb 21 10:46:25 2011
-+++ Python-2.6.4/Lib/uu.py Mon Feb 21 10:46:25 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Copyright 1994 by Lance Ellinghouse
- # Cathedral City, California Republic, United States of America.
-diff -u Python-2.6.4/Lib/symbol.py.orig Python-2.6.4/Lib/symbol.py
---- Python-2.6.4/Lib/symbol.py.orig Mon Feb 21 10:46:27 2011
-+++ Python-2.6.4/Lib/symbol.py Mon Feb 21 10:46:27 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Non-terminal symbols of Python grammar (from "graminit.h")."""
-
-diff -u Python-2.6.4/Lib/mimify.py.orig Python-2.6.4/Lib/mimify.py
---- Python-2.6.4/Lib/mimify.py.orig Mon Feb 21 10:46:28 2011
-+++ Python-2.6.4/Lib/mimify.py Mon Feb 21 10:46:28 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Mimification and unmimification of mail messages.
-
-diff -u Python-2.6.4/Lib/pdb.py.orig Python-2.6.4/Lib/pdb.py
---- Python-2.6.4/Lib/pdb.py.orig Mon Feb 21 10:46:38 2011
-+++ Python-2.6.4/Lib/pdb.py Mon Feb 21 10:46:38 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """A Python debugger."""
-
-diff -u Python-2.6.4/Lib/plat-mac/bundlebuilder.py.orig Python-2.6.4/Lib/plat-mac/bundlebuilder.py
---- Python-2.6.4/Lib/plat-mac/bundlebuilder.py.orig Mon Feb 21 10:46:38 2011
-+++ Python-2.6.4/Lib/plat-mac/bundlebuilder.py Mon Feb 21 10:46:38 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """\
- bundlebuilder.py -- Tools to assemble MacOS X (application) bundles.
-diff -u Python-2.6.4/Lib/plat-mac/appletrunner.py.orig Python-2.6.4/Lib/plat-mac/appletrunner.py
---- Python-2.6.4/Lib/plat-mac/appletrunner.py.orig Mon Feb 21 10:46:38 2011
-+++ Python-2.6.4/Lib/plat-mac/appletrunner.py Mon Feb 21 10:46:38 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- # This file is meant as an executable script for running applets.
- # BuildApplet will use it as the main executable in the .app bundle if
- # we are not running in a framework build.
-diff -u Python-2.6.4/Demo/scripts/primes.py.orig Python-2.6.4/Demo/scripts/primes.py
---- Python-2.6.4/Demo/scripts/primes.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/primes.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Print prime numbers in a given range
-
-diff -u Python-2.6.4/Demo/scripts/mkrcs.py.orig Python-2.6.4/Demo/scripts/mkrcs.py
---- Python-2.6.4/Demo/scripts/mkrcs.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/mkrcs.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # A rather specialized script to make sure that a symbolic link named
- # RCS exists pointing to a real RCS directory in a parallel tree
-diff -u Python-2.6.4/Demo/scripts/queens.py.orig Python-2.6.4/Demo/scripts/queens.py
---- Python-2.6.4/Demo/scripts/queens.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/queens.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """N queens problem.
-
-diff -u Python-2.6.4/Demo/scripts/pi.py.orig Python-2.6.4/Demo/scripts/pi.py
---- Python-2.6.4/Demo/scripts/pi.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/pi.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Print digits of pi forever.
- #
-diff -u Python-2.6.4/Demo/scripts/mboxconvert.py.orig Python-2.6.4/Demo/scripts/mboxconvert.py
---- Python-2.6.4/Demo/scripts/mboxconvert.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/mboxconvert.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Convert MH directories (1 message per file) or MMDF mailboxes (4x^A
- # delimited) to unix mailbox (From ... delimited) on stdout.
-diff -u Python-2.6.4/Demo/scripts/eqfix.py.orig Python-2.6.4/Demo/scripts/eqfix.py
---- Python-2.6.4/Demo/scripts/eqfix.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/eqfix.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Fix Python source files to use the new equality test operator, i.e.,
- # if x = y: ...
-diff -u Python-2.6.4/Demo/scripts/find-uname.py.orig Python-2.6.4/Demo/scripts/find-uname.py
---- Python-2.6.4/Demo/scripts/find-uname.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/find-uname.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """
- For each argument on the command line, look for it in the set of all Unicode
-diff -u Python-2.6.4/Demo/scripts/pp.py.orig Python-2.6.4/Demo/scripts/pp.py
---- Python-2.6.4/Demo/scripts/pp.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/pp.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Emulate some Perl command line options.
- # Usage: pp [-a] [-c] [-d] [-e scriptline] [-F fieldsep] [-n] [-p] [file] ...
-diff -u Python-2.6.4/Demo/scripts/unbirthday.py.orig Python-2.6.4/Demo/scripts/unbirthday.py
---- Python-2.6.4/Demo/scripts/unbirthday.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/unbirthday.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Calculate your unbirthday count (see Alice in Wonderland).
- # This is defined as the number of days from your birth until today
-diff -u Python-2.6.4/Demo/scripts/update.py.orig Python-2.6.4/Demo/scripts/update.py
---- Python-2.6.4/Demo/scripts/update.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/update.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Update a bunch of files according to a script.
- # The input file contains lines of the form <filename>:<lineno>:<text>,
-diff -u Python-2.6.4/Demo/scripts/markov.py.orig Python-2.6.4/Demo/scripts/markov.py
---- Python-2.6.4/Demo/scripts/markov.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/markov.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- class Markov:
- def __init__(self, histsize, choice):
-diff -u Python-2.6.4/Demo/scripts/from.py.orig Python-2.6.4/Demo/scripts/from.py
---- Python-2.6.4/Demo/scripts/from.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/from.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Print From and Subject of messages in $MAIL.
- # Extension to multiple mailboxes and other bells & whistles are left
-diff -u Python-2.6.4/Demo/scripts/script.py.orig Python-2.6.4/Demo/scripts/script.py
---- Python-2.6.4/Demo/scripts/script.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/script.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- # script.py -- Make typescript of terminal session.
- # Usage:
- # -a Append to typescript.
-diff -u Python-2.6.4/Demo/scripts/lpwatch.py.orig Python-2.6.4/Demo/scripts/lpwatch.py
---- Python-2.6.4/Demo/scripts/lpwatch.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/lpwatch.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Watch line printer queue(s).
- # Intended for BSD 4.3 lpq.
-diff -u Python-2.6.4/Demo/scripts/fact.py.orig Python-2.6.4/Demo/scripts/fact.py
---- Python-2.6.4/Demo/scripts/fact.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/fact.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Factorize numbers.
- # The algorithm is not efficient, but easy to understand.
-diff -u Python-2.6.4/Demo/scripts/beer.py.orig Python-2.6.4/Demo/scripts/beer.py
---- Python-2.6.4/Demo/scripts/beer.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/beer.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- # By GvR, demystified after a version by Fredrik Lundh.
- import sys
- n = 100
-diff -u Python-2.6.4/Demo/scripts/newslist.py.orig Python-2.6.4/Demo/scripts/newslist.py
---- Python-2.6.4/Demo/scripts/newslist.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/newslist.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- #######################################################################
- # Newslist $Revision: 66429 $
- #
-diff -u Python-2.6.4/Demo/scripts/ftpstats.py.orig Python-2.6.4/Demo/scripts/ftpstats.py
---- Python-2.6.4/Demo/scripts/ftpstats.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/ftpstats.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Extract statistics from ftp daemon log.
-
-diff -u Python-2.6.4/Demo/scripts/makedir.py.orig Python-2.6.4/Demo/scripts/makedir.py
---- Python-2.6.4/Demo/scripts/makedir.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/scripts/makedir.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Like mkdir, but also make intermediate directories if necessary.
- # It is not an error if the given directory already exists (as long
-diff -u Python-2.6.4/Demo/turtle/tdemo_clock.py.orig Python-2.6.4/Demo/turtle/tdemo_clock.py
---- Python-2.6.4/Demo/turtle/tdemo_clock.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_clock.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- # -*- coding: cp1252 -*-
- """ turtle-example-suite:
-
-diff -u Python-2.6.4/Demo/turtle/tdemo_planet_and_moon.py.orig Python-2.6.4/Demo/turtle/tdemo_planet_and_moon.py
---- Python-2.6.4/Demo/turtle/tdemo_planet_and_moon.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_planet_and_moon.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """ turtle-example-suite:
-
- tdemo_planets_and_moon.py
-diff -u Python-2.6.4/Demo/turtle/tdemo_lindenmayer_indian.py.orig Python-2.6.4/Demo/turtle/tdemo_lindenmayer_indian.py
---- Python-2.6.4/Demo/turtle/tdemo_lindenmayer_indian.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_lindenmayer_indian.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """ turtle-example-suite:
-
- xtx_lindenmayer_indian.py
-diff -u Python-2.6.4/Demo/turtle/tdemo_penrose.py.orig Python-2.6.4/Demo/turtle/tdemo_penrose.py
---- Python-2.6.4/Demo/turtle/tdemo_penrose.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_penrose.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """ xturtle-example-suite:
-
- xtx_kites_and_darts.py
-diff -u Python-2.6.4/Demo/turtle/turtleDemo.py.orig Python-2.6.4/Demo/turtle/turtleDemo.py
---- Python-2.6.4/Demo/turtle/turtleDemo.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/turtleDemo.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- import sys
- import os
-
-diff -u Python-2.6.4/Demo/turtle/tdemo_yinyang.py.orig Python-2.6.4/Demo/turtle/tdemo_yinyang.py
---- Python-2.6.4/Demo/turtle/tdemo_yinyang.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_yinyang.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """ turtle-example-suite:
-
- tdemo_yinyang.py
-diff -u Python-2.6.4/Demo/turtle/tdemo_tree.py.orig Python-2.6.4/Demo/turtle/tdemo_tree.py
---- Python-2.6.4/Demo/turtle/tdemo_tree.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_tree.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """ turtle-example-suite:
-
- tdemo_tree.py
-diff -u Python-2.6.4/Demo/turtle/tdemo_fractalcurves.py.orig Python-2.6.4/Demo/turtle/tdemo_fractalcurves.py
---- Python-2.6.4/Demo/turtle/tdemo_fractalcurves.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_fractalcurves.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """ turtle-example-suite:
-
- tdemo_fractalCurves.py
-diff -u Python-2.6.4/Demo/turtle/turtledemo_two_canvases.py.orig Python-2.6.4/Demo/turtle/turtledemo_two_canvases.py
---- Python-2.6.4/Demo/turtle/turtledemo_two_canvases.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/turtledemo_two_canvases.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- ## DEMONSTRATES USE OF 2 CANVASES, SO CANNOT BE RUN IN DEMOVIEWER!
- """turtle example: Using TurtleScreen and RawTurtle
- for drawing on two distinct canvases.
-diff -u Python-2.6.4/Demo/turtle/tdemo_minimal_hanoi.py.orig Python-2.6.4/Demo/turtle/tdemo_minimal_hanoi.py
---- Python-2.6.4/Demo/turtle/tdemo_minimal_hanoi.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_minimal_hanoi.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """ turtle-example-suite:
-
- tdemo_minimal_hanoi.py
-diff -u Python-2.6.4/Demo/turtle/tdemo_peace.py.orig Python-2.6.4/Demo/turtle/tdemo_peace.py
---- Python-2.6.4/Demo/turtle/tdemo_peace.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_peace.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """ turtle-example-suite:
-
- tdemo_peace.py
-diff -u Python-2.6.4/Demo/turtle/tdemo_bytedesign.py.orig Python-2.6.4/Demo/turtle/tdemo_bytedesign.py
---- Python-2.6.4/Demo/turtle/tdemo_bytedesign.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_bytedesign.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """ turtle-example-suite:
-
- tdemo_bytedesign.py
-diff -u Python-2.6.4/Demo/turtle/tdemo_paint.py.orig Python-2.6.4/Demo/turtle/tdemo_paint.py
---- Python-2.6.4/Demo/turtle/tdemo_paint.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_paint.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """ turtle-example-suite:
-
- tdemo_paint.py
-diff -u Python-2.6.4/Demo/turtle/tdemo_I_dontlike_tiltdemo.py.orig Python-2.6.4/Demo/turtle/tdemo_I_dontlike_tiltdemo.py
---- Python-2.6.4/Demo/turtle/tdemo_I_dontlike_tiltdemo.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/turtle/tdemo_I_dontlike_tiltdemo.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """ turtle-example-suite:
-
- tdemo-I_dont_like_tiltdemo.py
-diff -u Python-2.6.4/Demo/cgi/cgi1.py.orig Python-2.6.4/Demo/cgi/cgi1.py
---- Python-2.6.4/Demo/cgi/cgi1.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/cgi/cgi1.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/python
-+#!/usr/bin/python2.6
-
- """CGI test 1 - check server setup."""
-
-diff -u Python-2.6.4/Demo/cgi/cgi3.py.orig Python-2.6.4/Demo/cgi/cgi3.py
---- Python-2.6.4/Demo/cgi/cgi3.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/cgi/cgi3.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/python
-+#!/usr/bin/python2.6
-
- """CGI test 3 (persistent data)."""
-
-diff -u Python-2.6.4/Demo/cgi/cgi2.py.orig Python-2.6.4/Demo/cgi/cgi2.py
---- Python-2.6.4/Demo/cgi/cgi2.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/cgi/cgi2.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/python
-+#!/usr/bin/python2.6
-
- """CGI test 2 - basic use of cgi module."""
-
-diff -u Python-2.6.4/Demo/comparisons/sortingtest.py.orig Python-2.6.4/Demo/comparisons/sortingtest.py
---- Python-2.6.4/Demo/comparisons/sortingtest.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/comparisons/sortingtest.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # 2) Sorting Test
- #
-diff -u Python-2.6.4/Demo/comparisons/regextest.py.orig Python-2.6.4/Demo/comparisons/regextest.py
---- Python-2.6.4/Demo/comparisons/regextest.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/comparisons/regextest.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # 1) Regular Expressions Test
- #
-diff -u Python-2.6.4/Demo/comparisons/systemtest.py.orig Python-2.6.4/Demo/comparisons/systemtest.py
---- Python-2.6.4/Demo/comparisons/systemtest.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/comparisons/systemtest.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # 3) System Test
- #
-diff -u Python-2.6.4/Demo/pysvr/pysvr.py.orig Python-2.6.4/Demo/pysvr/pysvr.py
---- Python-2.6.4/Demo/pysvr/pysvr.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/pysvr/pysvr.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """A multi-threaded telnet-like server that gives a Python prompt.
-
-diff -u Python-2.6.4/Demo/tkinter/guido/sortvisu.py.orig Python-2.6.4/Demo/tkinter/guido/sortvisu.py
---- Python-2.6.4/Demo/tkinter/guido/sortvisu.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/sortvisu.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Sorting algorithms visualizer using Tkinter.
-
-diff -u Python-2.6.4/Demo/tkinter/guido/dialog.py.orig Python-2.6.4/Demo/tkinter/guido/dialog.py
---- Python-2.6.4/Demo/tkinter/guido/dialog.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/dialog.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # A Python function that generates dialog boxes with a text message,
- # optional bitmap, and any number of buttons.
-diff -u Python-2.6.4/Demo/tkinter/guido/electrons.py.orig Python-2.6.4/Demo/tkinter/guido/electrons.py
---- Python-2.6.4/Demo/tkinter/guido/electrons.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/electrons.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Simulate "electrons" migrating across the screen.
- # An optional bitmap file in can be in the background.
-diff -u Python-2.6.4/Demo/tkinter/guido/newmenubardemo.py.orig Python-2.6.4/Demo/tkinter/guido/newmenubardemo.py
---- Python-2.6.4/Demo/tkinter/guido/newmenubardemo.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/newmenubardemo.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Play with the new Tk 8.0 toplevel menu option."""
-
-diff -u Python-2.6.4/Demo/tkinter/guido/canvasevents.py.orig Python-2.6.4/Demo/tkinter/guido/canvasevents.py
---- Python-2.6.4/Demo/tkinter/guido/canvasevents.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/canvasevents.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- from Tkinter import *
- from Canvas import Oval, Group, CanvasText
-diff -u Python-2.6.4/Demo/tkinter/guido/tkman.py.orig Python-2.6.4/Demo/tkinter/guido/tkman.py
---- Python-2.6.4/Demo/tkinter/guido/tkman.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/tkman.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Tk man page browser -- currently only shows the Tcl/Tk man pages
-
-diff -u Python-2.6.4/Demo/tkinter/guido/solitaire.py.orig Python-2.6.4/Demo/tkinter/guido/solitaire.py
---- Python-2.6.4/Demo/tkinter/guido/solitaire.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/solitaire.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Solitaire game, much like the one that comes with MS Windows.
-
-diff -u Python-2.6.4/Demo/tkinter/guido/kill.py.orig Python-2.6.4/Demo/tkinter/guido/kill.py
---- Python-2.6.4/Demo/tkinter/guido/kill.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/kill.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- # Tkinter interface to Linux `kill' command.
-
- from Tkinter import *
-diff -u Python-2.6.4/Demo/tkinter/guido/MimeViewer.py.orig Python-2.6.4/Demo/tkinter/guido/MimeViewer.py
---- Python-2.6.4/Demo/tkinter/guido/MimeViewer.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/MimeViewer.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # View a single MIME multipart message.
- # Display each part as a box.
-diff -u Python-2.6.4/Demo/tkinter/guido/mbox.py.orig Python-2.6.4/Demo/tkinter/guido/mbox.py
---- Python-2.6.4/Demo/tkinter/guido/mbox.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/mbox.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Scan MH folder, display results in window
-
-diff -u Python-2.6.4/Demo/tkinter/guido/rmt.py.orig Python-2.6.4/Demo/tkinter/guido/rmt.py
---- Python-2.6.4/Demo/tkinter/guido/rmt.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/rmt.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # A Python program implementing rmt, an application for remotely
- # controlling other Tk applications.
-diff -u Python-2.6.4/Demo/tkinter/guido/svkill.py.orig Python-2.6.4/Demo/tkinter/guido/svkill.py
---- Python-2.6.4/Demo/tkinter/guido/svkill.py.orig Mon Feb 21 10:46:39 2011
-+++ Python-2.6.4/Demo/tkinter/guido/svkill.py Mon Feb 21 10:46:39 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Tkinter interface to SYSV `ps' and `kill' commands.
-
-diff -u Python-2.6.4/Demo/pdist/rrcs.py.orig Python-2.6.4/Demo/pdist/rrcs.py
---- Python-2.6.4/Demo/pdist/rrcs.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/pdist/rrcs.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- "Remote RCS -- command line interface"
-
-diff -u Python-2.6.4/Demo/pdist/rcvs.py.orig Python-2.6.4/Demo/pdist/rcvs.py
---- Python-2.6.4/Demo/pdist/rcvs.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/pdist/rcvs.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Remote CVS -- command line interface"""
-
-diff -u Python-2.6.4/Demo/pdist/RCSProxy.py.orig Python-2.6.4/Demo/pdist/RCSProxy.py
---- Python-2.6.4/Demo/pdist/RCSProxy.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/pdist/RCSProxy.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """RCS Proxy.
-
-diff -u Python-2.6.4/Demo/pdist/makechangelog.py.orig Python-2.6.4/Demo/pdist/makechangelog.py
---- Python-2.6.4/Demo/pdist/makechangelog.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/pdist/makechangelog.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Turn a pile of RCS log output into ChangeLog file entries.
-
-diff -u Python-2.6.4/Demo/zlib/zlibdemo.py.orig Python-2.6.4/Demo/zlib/zlibdemo.py
---- Python-2.6.4/Demo/zlib/zlibdemo.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/zlib/zlibdemo.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Takes an optional filename, defaulting to this file itself.
- # Reads the file and compresses the content using level 1 and level 9
-diff -u Python-2.6.4/Demo/zlib/minigzip.py.orig Python-2.6.4/Demo/zlib/minigzip.py
---- Python-2.6.4/Demo/zlib/minigzip.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/zlib/minigzip.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- # Demo program for zlib; it compresses or decompresses files, but *doesn't*
- # delete the original. This doesn't support all of gzip's options.
- #
-diff -u Python-2.6.4/Demo/curses/life.py.orig Python-2.6.4/Demo/curses/life.py
---- Python-2.6.4/Demo/curses/life.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/curses/life.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- # life.py -- A curses-based version of Conway's Game of Life.
- # Contributed by AMK
- #
-diff -u Python-2.6.4/Demo/curses/rain.py.orig Python-2.6.4/Demo/curses/rain.py
---- Python-2.6.4/Demo/curses/rain.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/curses/rain.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # $Id: rain.py 46625 2006-06-03 23:02:15Z andrew.kuchling $
- #
-diff -u Python-2.6.4/Demo/curses/repeat.py.orig Python-2.6.4/Demo/curses/repeat.py
---- Python-2.6.4/Demo/curses/repeat.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/curses/repeat.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """repeat <shell-command>
-
-diff -u Python-2.6.4/Demo/curses/ncurses.py.orig Python-2.6.4/Demo/curses/ncurses.py
---- Python-2.6.4/Demo/curses/ncurses.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/curses/ncurses.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # $Id: ncurses.py 66424 2008-09-13 01:22:08Z andrew.kuchling $
- #
-diff -u Python-2.6.4/Demo/curses/tclock.py.orig Python-2.6.4/Demo/curses/tclock.py
---- Python-2.6.4/Demo/curses/tclock.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/curses/tclock.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # $Id: tclock.py 46626 2006-06-03 23:07:21Z andrew.kuchling $
- #
-diff -u Python-2.6.4/Demo/parser/test_parser.py.orig Python-2.6.4/Demo/parser/test_parser.py
---- Python-2.6.4/Demo/parser/test_parser.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/parser/test_parser.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- # (Force the script to use the latest build.)
- #
- # test_parser.py
-diff -u Python-2.6.4/Demo/sockets/gopher.py.orig Python-2.6.4/Demo/sockets/gopher.py
---- Python-2.6.4/Demo/sockets/gopher.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/sockets/gopher.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # A simple gopher client.
- #
-diff -u Python-2.6.4/Demo/sockets/throughput.py.orig Python-2.6.4/Demo/sockets/throughput.py
---- Python-2.6.4/Demo/sockets/throughput.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/sockets/throughput.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Test network throughput.
- #
-diff -u Python-2.6.4/Demo/sockets/rpython.py.orig Python-2.6.4/Demo/sockets/rpython.py
---- Python-2.6.4/Demo/sockets/rpython.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/sockets/rpython.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Remote python client.
- # Execute Python commands remotely and send output back.
-diff -u Python-2.6.4/Demo/sockets/echosvr.py.orig Python-2.6.4/Demo/sockets/echosvr.py
---- Python-2.6.4/Demo/sockets/echosvr.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/sockets/echosvr.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Python implementation of an 'echo' tcp server: echo all data it receives.
- #
-diff -u Python-2.6.4/Demo/sockets/telnet.py.orig Python-2.6.4/Demo/sockets/telnet.py
---- Python-2.6.4/Demo/sockets/telnet.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/sockets/telnet.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Minimal interface to the Internet telnet protocol.
- #
-diff -u Python-2.6.4/Demo/sockets/finger.py.orig Python-2.6.4/Demo/sockets/finger.py
---- Python-2.6.4/Demo/sockets/finger.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/sockets/finger.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Python interface to the Internet finger daemon.
- #
-diff -u Python-2.6.4/Demo/sockets/udpecho.py.orig Python-2.6.4/Demo/sockets/udpecho.py
---- Python-2.6.4/Demo/sockets/udpecho.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/sockets/udpecho.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Client and server for udp (datagram) echo.
- #
-diff -u Python-2.6.4/Demo/sockets/rpythond.py.orig Python-2.6.4/Demo/sockets/rpythond.py
---- Python-2.6.4/Demo/sockets/rpythond.py.orig Mon Feb 21 10:46:40 2011
-+++ Python-2.6.4/Demo/sockets/rpythond.py Mon Feb 21 10:46:40 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Remote python server.
- # Execute Python commands remotely and send output back.
-diff -u Python-2.6.4/Tools/ssl/get-remote-certificate.py.orig Python-2.6.4/Tools/ssl/get-remote-certificate.py
---- Python-2.6.4/Tools/ssl/get-remote-certificate.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/ssl/get-remote-certificate.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # fetch the certificate that the server(s) are providing in PEM form
- #
-diff -u Python-2.6.4/Tools/compiler/demo.py.orig Python-2.6.4/Tools/compiler/demo.py
---- Python-2.6.4/Tools/compiler/demo.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/compiler/demo.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Print names of all methods defined in module
-
-diff -u Python-2.6.4/Tools/compiler/dumppyc.py.orig Python-2.6.4/Tools/compiler/dumppyc.py
---- Python-2.6.4/Tools/compiler/dumppyc.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/compiler/dumppyc.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- import marshal
- import dis
-diff -u Python-2.6.4/Tools/webchecker/wsgui.py.orig Python-2.6.4/Tools/webchecker/wsgui.py
---- Python-2.6.4/Tools/webchecker/wsgui.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/webchecker/wsgui.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Tkinter-based GUI for websucker.
-
-diff -u Python-2.6.4/Tools/webchecker/webchecker.py.orig Python-2.6.4/Tools/webchecker/webchecker.py
---- Python-2.6.4/Tools/webchecker/webchecker.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/webchecker/webchecker.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Original code by Guido van Rossum; extensive changes by Sam Bayer,
- # including code to check URL fragments.
-diff -u Python-2.6.4/Tools/webchecker/websucker.py.orig Python-2.6.4/Tools/webchecker/websucker.py
---- Python-2.6.4/Tools/webchecker/websucker.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/webchecker/websucker.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """A variant on webchecker that creates a mirror copy of a remote site."""
-
-diff -u Python-2.6.4/Tools/webchecker/wcgui.py.orig Python-2.6.4/Tools/webchecker/wcgui.py
---- Python-2.6.4/Tools/webchecker/wcgui.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/webchecker/wcgui.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """GUI interface to webchecker.
-
-diff -u Python-2.6.4/Tools/faqwiz/faqw.py.orig Python-2.6.4/Tools/faqwiz/faqw.py
---- Python-2.6.4/Tools/faqwiz/faqw.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/faqwiz/faqw.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#! /usr/local/bin/python
-+#!/usr/bin/python2.6
-
- """FAQ wizard bootstrap."""
-
-diff -u Python-2.6.4/Tools/unicode/comparecodecs.py.orig Python-2.6.4/Tools/unicode/comparecodecs.py
---- Python-2.6.4/Tools/unicode/comparecodecs.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/unicode/comparecodecs.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """ Compare the output of two codecs.
-
-diff -u Python-2.6.4/Tools/i18n/msgfmt.py.orig Python-2.6.4/Tools/i18n/msgfmt.py
---- Python-2.6.4/Tools/i18n/msgfmt.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/i18n/msgfmt.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- # -*- coding: iso-8859-1 -*-
- # Written by Martin v. Löwis <[email protected]>
-
-diff -u Python-2.6.4/Tools/i18n/makelocalealias.py.orig Python-2.6.4/Tools/i18n/makelocalealias.py
---- Python-2.6.4/Tools/i18n/makelocalealias.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/i18n/makelocalealias.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- """
- Convert the X11 locale.alias file into a mapping dictionary suitable
- for locale.py.
-diff -u Python-2.6.4/Tools/i18n/pygettext.py.orig Python-2.6.4/Tools/i18n/pygettext.py
---- Python-2.6.4/Tools/i18n/pygettext.py.orig Mon Feb 21 10:46:41 2011
-+++ Python-2.6.4/Tools/i18n/pygettext.py Mon Feb 21 10:46:41 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- # -*- coding: iso-8859-1 -*-
- # Originally written by Barry Warsaw <[email protected]>
- #
-diff -u Python-2.6.4/Tools/freeze/freeze.py.orig Python-2.6.4/Tools/freeze/freeze.py
---- Python-2.6.4/Tools/freeze/freeze.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/freeze/freeze.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Freeze a Python script into a binary.
-
-diff -u Python-2.6.4/Tools/modulator/Tkextra.py.orig Python-2.6.4/Tools/modulator/Tkextra.py
---- Python-2.6.4/Tools/modulator/Tkextra.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/modulator/Tkextra.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # A Python function that generates dialog boxes with a text message,
- # optional bitmap, and any number of buttons.
-diff -u Python-2.6.4/Tools/modulator/modulator.py.orig Python-2.6.4/Tools/modulator/modulator.py
---- Python-2.6.4/Tools/modulator/modulator.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/modulator/modulator.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- #
- # Modulator - Generate skeleton modules.
- #
-diff -u Python-2.6.4/Tools/pybench/pybench.py.orig Python-2.6.4/Tools/pybench/pybench.py
---- Python-2.6.4/Tools/pybench/pybench.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/pybench/pybench.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/python -O
-+#!/usr/bin/python2.6
-
- """ A Python Benchmark Suite
-
-diff -u Python-2.6.4/Tools/pybench/Setup.py.orig Python-2.6.4/Tools/pybench/Setup.py
---- Python-2.6.4/Tools/pybench/Setup.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/pybench/Setup.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!python
-+#!/usr/bin/python2.6
-
- # Setup file for pybench
- #
-diff -u Python-2.6.4/Tools/pybench/clockres.py.orig Python-2.6.4/Tools/pybench/clockres.py
---- Python-2.6.4/Tools/pybench/clockres.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/pybench/clockres.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """ clockres - calculates the resolution in seconds of a given timer.
-
-diff -u Python-2.6.4/Tools/pybench/systimes.py.orig Python-2.6.4/Tools/pybench/systimes.py
---- Python-2.6.4/Tools/pybench/systimes.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/pybench/systimes.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """ systimes() user and system timer implementations for use by
- pybench.
-diff -u Python-2.6.4/Tools/scripts/fixheader.py.orig Python-2.6.4/Tools/scripts/fixheader.py
---- Python-2.6.4/Tools/scripts/fixheader.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/fixheader.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Add some standard cpp magic to a header file
-
-diff -u Python-2.6.4/Tools/scripts/fixdiv.py.orig Python-2.6.4/Tools/scripts/fixdiv.py
---- Python-2.6.4/Tools/scripts/fixdiv.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/fixdiv.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """fixdiv - tool to fix division operators.
-
-diff -u Python-2.6.4/Tools/scripts/which.py.orig Python-2.6.4/Tools/scripts/which.py
---- Python-2.6.4/Tools/scripts/which.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/which.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Variant of "which".
- # On stderr, near and total misses are reported.
-diff -u Python-2.6.4/Tools/scripts/suff.py.orig Python-2.6.4/Tools/scripts/suff.py
---- Python-2.6.4/Tools/scripts/suff.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/suff.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # suff
- #
-diff -u Python-2.6.4/Tools/scripts/pysource.py.orig Python-2.6.4/Tools/scripts/pysource.py
---- Python-2.6.4/Tools/scripts/pysource.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/pysource.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """\
- List python source files.
-diff -u Python-2.6.4/Tools/scripts/lll.py.orig Python-2.6.4/Tools/scripts/lll.py
---- Python-2.6.4/Tools/scripts/lll.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/lll.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Find symbolic links and show where they point to.
- # Arguments are directories to search; default is current directory.
-diff -u Python-2.6.4/Tools/scripts/pickle2db.py.orig Python-2.6.4/Tools/scripts/pickle2db.py
---- Python-2.6.4/Tools/scripts/pickle2db.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/pickle2db.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """
- Synopsis: %(prog)s [-h|-b|-g|-r|-a|-d] [ picklefile ] dbfile
-diff -u Python-2.6.4/Tools/scripts/texi2html.py.orig Python-2.6.4/Tools/scripts/texi2html.py
---- Python-2.6.4/Tools/scripts/texi2html.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/texi2html.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Convert GNU texinfo files into HTML, one file per node.
- # Based on Texinfo 2.14.
-diff -u Python-2.6.4/Tools/scripts/mkreal.py.orig Python-2.6.4/Tools/scripts/mkreal.py
---- Python-2.6.4/Tools/scripts/mkreal.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/mkreal.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # mkreal
- #
-diff -u Python-2.6.4/Tools/scripts/ftpmirror.py.orig Python-2.6.4/Tools/scripts/ftpmirror.py
---- Python-2.6.4/Tools/scripts/ftpmirror.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/ftpmirror.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Mirror a remote ftp subtree into a local directory tree.
-
-diff -u Python-2.6.4/Tools/scripts/lfcr.py.orig Python-2.6.4/Tools/scripts/lfcr.py
---- Python-2.6.4/Tools/scripts/lfcr.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/lfcr.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- "Replace LF with CRLF in argument files. Print names of changed files."
-
-diff -u Python-2.6.4/Tools/scripts/ptags.py.orig Python-2.6.4/Tools/scripts/ptags.py
---- Python-2.6.4/Tools/scripts/ptags.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/ptags.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # ptags
- #
-diff -u Python-2.6.4/Tools/scripts/copytime.py.orig Python-2.6.4/Tools/scripts/copytime.py
---- Python-2.6.4/Tools/scripts/copytime.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/copytime.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Copy one file's atime and mtime to another
-
-diff -u Python-2.6.4/Tools/scripts/finddiv.py.orig Python-2.6.4/Tools/scripts/finddiv.py
---- Python-2.6.4/Tools/scripts/finddiv.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/finddiv.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """finddiv - a grep-like tool that looks for division operators.
-
-diff -u Python-2.6.4/Tools/scripts/combinerefs.py.orig Python-2.6.4/Tools/scripts/combinerefs.py
---- Python-2.6.4/Tools/scripts/combinerefs.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/combinerefs.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """
- combinerefs path
-diff -u Python-2.6.4/Tools/scripts/cvsfiles.py.orig Python-2.6.4/Tools/scripts/cvsfiles.py
---- Python-2.6.4/Tools/scripts/cvsfiles.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/cvsfiles.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Print a list of files that are mentioned in CVS directories.
-
-diff -u Python-2.6.4/Tools/scripts/reindent.py.orig Python-2.6.4/Tools/scripts/reindent.py
---- Python-2.6.4/Tools/scripts/reindent.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/reindent.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Released to the public domain, by Tim Peters, 03 October 2000.
-
-diff -u Python-2.6.4/Tools/scripts/checkpyc.py.orig Python-2.6.4/Tools/scripts/checkpyc.py
---- Python-2.6.4/Tools/scripts/checkpyc.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/checkpyc.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- # Check that all ".pyc" files exist and are up-to-date
- # Uses module 'os'
-
-diff -u Python-2.6.4/Tools/scripts/fixps.py.orig Python-2.6.4/Tools/scripts/fixps.py
---- Python-2.6.4/Tools/scripts/fixps.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/fixps.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Fix Python script(s) to reference the interpreter via /usr/bin/env python.
- # Warning: this overwrites the file without making a backup.
-diff -u Python-2.6.4/Tools/scripts/crlf.py.orig Python-2.6.4/Tools/scripts/crlf.py
---- Python-2.6.4/Tools/scripts/crlf.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/crlf.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- "Replace CRLF with LF in argument files. Print names of changed files."
-
- import sys, os
-diff -u Python-2.6.4/Tools/scripts/methfix.py.orig Python-2.6.4/Tools/scripts/methfix.py
---- Python-2.6.4/Tools/scripts/methfix.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/methfix.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Fix Python source files to avoid using
- # def method(self, (arg1, ..., argn)):
-diff -u Python-2.6.4/Tools/scripts/classfix.py.orig Python-2.6.4/Tools/scripts/classfix.py
---- Python-2.6.4/Tools/scripts/classfix.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/classfix.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # This script is obsolete -- it is kept for historical purposes only.
- #
-diff -u Python-2.6.4/Tools/scripts/xxci.py.orig Python-2.6.4/Tools/scripts/xxci.py
---- Python-2.6.4/Tools/scripts/xxci.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/xxci.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # xxci
- #
-diff -u Python-2.6.4/Tools/scripts/findnocoding.py.orig Python-2.6.4/Tools/scripts/findnocoding.py
---- Python-2.6.4/Tools/scripts/findnocoding.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/findnocoding.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """List all those Python files that require a coding directive
-
-diff -u Python-2.6.4/Tools/scripts/fixnotice.py.orig Python-2.6.4/Tools/scripts/fixnotice.py
---- Python-2.6.4/Tools/scripts/fixnotice.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/fixnotice.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """(Ostensibly) fix copyright notices in files.
-
-diff -u Python-2.6.4/Tools/scripts/eptags.py.orig Python-2.6.4/Tools/scripts/eptags.py
---- Python-2.6.4/Tools/scripts/eptags.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/eptags.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Create a TAGS file for Python programs, usable with GNU Emacs.
-
- usage: eptags pyfiles...
-diff -u Python-2.6.4/Tools/scripts/linktree.py.orig Python-2.6.4/Tools/scripts/linktree.py
---- Python-2.6.4/Tools/scripts/linktree.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/linktree.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # linktree
- #
-diff -u Python-2.6.4/Tools/scripts/checkappend.py.orig Python-2.6.4/Tools/scripts/checkappend.py
---- Python-2.6.4/Tools/scripts/checkappend.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/checkappend.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Released to the public domain, by Tim Peters, 28 February 2000.
-
-diff -u Python-2.6.4/Tools/scripts/pindent.py.orig Python-2.6.4/Tools/scripts/pindent.py
---- Python-2.6.4/Tools/scripts/pindent.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/pindent.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # This file contains a class and a main program that perform three
- # related (though complimentary) formatting operations on Python
-diff -u Python-2.6.4/Tools/scripts/google.py.orig Python-2.6.4/Tools/scripts/google.py
---- Python-2.6.4/Tools/scripts/google.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/google.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- import sys, webbrowser
-
-diff -u Python-2.6.4/Tools/scripts/nm2def.py.orig Python-2.6.4/Tools/scripts/nm2def.py
---- Python-2.6.4/Tools/scripts/nm2def.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/nm2def.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """nm2def.py
-
- Helpers to extract symbols from Unix libs and auto-generate
-diff -u Python-2.6.4/Tools/scripts/md5sum.py.orig Python-2.6.4/Tools/scripts/md5sum.py
---- Python-2.6.4/Tools/scripts/md5sum.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/md5sum.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Python utility to print MD5 checksums of argument files.
- """
-diff -u Python-2.6.4/Tools/scripts/logmerge.py.orig Python-2.6.4/Tools/scripts/logmerge.py
---- Python-2.6.4/Tools/scripts/logmerge.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/logmerge.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Consolidate a bunch of CVS or RCS logs read from stdin.
-
-diff -u Python-2.6.4/Tools/scripts/svneol.py.orig Python-2.6.4/Tools/scripts/svneol.py
---- Python-2.6.4/Tools/scripts/svneol.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/svneol.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """
- SVN helper script.
-diff -u Python-2.6.4/Tools/scripts/rgrep.py.orig Python-2.6.4/Tools/scripts/rgrep.py
---- Python-2.6.4/Tools/scripts/rgrep.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/rgrep.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Reverse grep.
-
-diff -u Python-2.6.4/Tools/scripts/h2py.py.orig Python-2.6.4/Tools/scripts/h2py.py
---- Python-2.6.4/Tools/scripts/h2py.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/h2py.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Read #define's and translate to Python code.
- # Handle #include statements.
-diff -u Python-2.6.4/Tools/scripts/pathfix.py.orig Python-2.6.4/Tools/scripts/pathfix.py
---- Python-2.6.4/Tools/scripts/pathfix.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/pathfix.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Change the #! line occurring in Python scripts. The new interpreter
- # pathname must be given with a -i option.
-diff -u Python-2.6.4/Tools/scripts/byext.py.orig Python-2.6.4/Tools/scripts/byext.py
---- Python-2.6.4/Tools/scripts/byext.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/byext.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Show file statistics by extension."""
-
-diff -u Python-2.6.4/Tools/scripts/ifdef.py.orig Python-2.6.4/Tools/scripts/ifdef.py
---- Python-2.6.4/Tools/scripts/ifdef.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/ifdef.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Selectively preprocess #ifdef / #ifndef statements.
- # Usage:
-diff -u Python-2.6.4/Tools/scripts/treesync.py.orig Python-2.6.4/Tools/scripts/treesync.py
---- Python-2.6.4/Tools/scripts/treesync.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/treesync.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Script to synchronize two source trees.
-
-diff -u Python-2.6.4/Tools/scripts/ndiff.py.orig Python-2.6.4/Tools/scripts/ndiff.py
---- Python-2.6.4/Tools/scripts/ndiff.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/ndiff.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Module ndiff version 1.7.0
- # Released to the public domain 08-Dec-2000,
-diff -u Python-2.6.4/Tools/scripts/findlinksto.py.orig Python-2.6.4/Tools/scripts/findlinksto.py
---- Python-2.6.4/Tools/scripts/findlinksto.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/findlinksto.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # findlinksto
- #
-diff -u Python-2.6.4/Tools/scripts/objgraph.py.orig Python-2.6.4/Tools/scripts/objgraph.py
---- Python-2.6.4/Tools/scripts/objgraph.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/objgraph.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # objgraph
- #
-diff -u Python-2.6.4/Tools/scripts/untabify.py.orig Python-2.6.4/Tools/scripts/untabify.py
---- Python-2.6.4/Tools/scripts/untabify.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/untabify.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- "Replace tabs with spaces in argument files. Print names of changed files."
-
-diff -u Python-2.6.4/Tools/scripts/db2pickle.py.orig Python-2.6.4/Tools/scripts/db2pickle.py
---- Python-2.6.4/Tools/scripts/db2pickle.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/db2pickle.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """
- Synopsis: %(prog)s [-h|-g|-b|-r|-a] dbfile [ picklefile ]
-diff -u Python-2.6.4/Tools/scripts/parseentities.py.orig Python-2.6.4/Tools/scripts/parseentities.py
---- Python-2.6.4/Tools/scripts/parseentities.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/parseentities.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/python
-+#!/usr/bin/python2.6
- """ Utility for parsing HTML entity definitions available from:
-
- http://www.w3.org/ as e.g.
-diff -u Python-2.6.4/Tools/scripts/dutree.py.orig Python-2.6.4/Tools/scripts/dutree.py
---- Python-2.6.4/Tools/scripts/dutree.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/dutree.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- # Format du output in a tree shape
-
- import os, sys, errno
-diff -u Python-2.6.4/Tools/scripts/pdeps.py.orig Python-2.6.4/Tools/scripts/pdeps.py
---- Python-2.6.4/Tools/scripts/pdeps.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/pdeps.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # pdeps
- #
-diff -u Python-2.6.4/Tools/scripts/cleanfuture.py.orig Python-2.6.4/Tools/scripts/cleanfuture.py
---- Python-2.6.4/Tools/scripts/cleanfuture.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/cleanfuture.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- """cleanfuture [-d][-r][-v] path ...
-
-diff -u Python-2.6.4/Tools/scripts/hotshotmain.py.orig Python-2.6.4/Tools/scripts/hotshotmain.py
---- Python-2.6.4/Tools/scripts/hotshotmain.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/hotshotmain.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- # -*- coding: iso-8859-1 -*-
-
- """
-diff -u Python-2.6.4/Tools/scripts/byteyears.py.orig Python-2.6.4/Tools/scripts/byteyears.py
---- Python-2.6.4/Tools/scripts/byteyears.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/byteyears.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Print the product of age and size of each file, in suitable units.
- #
-diff -u Python-2.6.4/Tools/scripts/gprof2html.py.orig Python-2.6.4/Tools/scripts/gprof2html.py
---- Python-2.6.4/Tools/scripts/gprof2html.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/gprof2html.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python2.3
-+#!/usr/bin/python2.6
-
- """Transform gprof(1) output into useful HTML."""
-
-diff -u Python-2.6.4/Tools/scripts/fixcid.py.orig Python-2.6.4/Tools/scripts/fixcid.py
---- Python-2.6.4/Tools/scripts/fixcid.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/fixcid.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Perform massive identifier substitution on C source files.
- # This actually tokenizes the files (to some extent) so it can
-diff -u Python-2.6.4/Tools/scripts/reindent-rst.py.orig Python-2.6.4/Tools/scripts/reindent-rst.py
---- Python-2.6.4/Tools/scripts/reindent-rst.py.orig Mon Feb 21 10:46:42 2011
-+++ Python-2.6.4/Tools/scripts/reindent-rst.py Mon Feb 21 10:46:42 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- # Make a reST file compliant to our pre-commit hook.
- # Currently just remove trailing whitespace.
-diff -u Python-2.6.4/Mac/BuildScript/build-installer.py.orig Python-2.6.4/Mac/BuildScript/build-installer.py
---- Python-2.6.4/Mac/BuildScript/build-installer.py.orig Mon Feb 21 10:46:43 2011
-+++ Python-2.6.4/Mac/BuildScript/build-installer.py Mon Feb 21 10:46:43 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """
- This script is used to build the "official unofficial" universal build on
- Mac OS X. It requires Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK to do its
-diff -u Python-2.6.4/Mac/scripts/zappycfiles.py.orig Python-2.6.4/Mac/scripts/zappycfiles.py
---- Python-2.6.4/Mac/scripts/zappycfiles.py.orig Mon Feb 21 10:46:44 2011
-+++ Python-2.6.4/Mac/scripts/zappycfiles.py Mon Feb 21 10:46:44 2011
-@@ -1,4 +1,4 @@
--#!/usr/local/bin/python
-+#!/usr/bin/python2.6
- """Recursively zap all .pyc and .pyo files"""
- import os
- import sys
-diff -u Python-2.6.4/Mac/scripts/buildpkg.py.orig Python-2.6.4/Mac/scripts/buildpkg.py
---- Python-2.6.4/Mac/scripts/buildpkg.py.orig Mon Feb 21 10:46:44 2011
-+++ Python-2.6.4/Mac/scripts/buildpkg.py Mon Feb 21 10:46:44 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """buildpkg.py -- Build OS X packages for Apple's Installer.app.
-
-diff -u Python-2.6.4/Mac/Tools/fixapplepython23.py.orig Python-2.6.4/Mac/Tools/fixapplepython23.py
---- Python-2.6.4/Mac/Tools/fixapplepython23.py.orig Mon Feb 21 10:46:44 2011
-+++ Python-2.6.4/Mac/Tools/fixapplepython23.py Mon Feb 21 10:46:44 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/python
-+#!/usr/bin/python2.6
- """fixapplepython23 - Fix Apple-installed Python 2.3 (on Mac OS X 10.3)
-
- Python 2.3 (and 2.3.X for X<5) have the problem that building an extension
-diff -u Python-2.6.4/Misc/find_recursionlimit.py.orig Python-2.6.4/Misc/find_recursionlimit.py
---- Python-2.6.4/Misc/find_recursionlimit.py.orig Mon Feb 21 10:46:44 2011
-+++ Python-2.6.4/Misc/find_recursionlimit.py Mon Feb 21 10:46:44 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Find the maximum recursion limit that prevents interpreter termination.
-
- This script finds the maximum safe recursion limit on a particular
-diff -u Python-2.6.4/Parser/asdl_c.py.orig Python-2.6.4/Parser/asdl_c.py
---- Python-2.6.4/Parser/asdl_c.py.orig Mon Feb 21 10:46:44 2011
-+++ Python-2.6.4/Parser/asdl_c.py Mon Feb 21 10:46:44 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/env python
-+#!/usr/bin/python2.6
- """Generate C code from an ASDL description."""
-
- # TO DO
-diff -u Python-2.6.4/Doc/includes/email-alternative.py.orig Python-2.6.4/Doc/includes/email-alternative.py
---- Python-2.6.4/Doc/includes/email-alternative.py.orig Mon Feb 21 10:46:44 2011
-+++ Python-2.6.4/Doc/includes/email-alternative.py Mon Feb 21 10:46:44 2011
-@@ -1,4 +1,4 @@
--#! /usr/bin/python
-+#!/usr/bin/python2.6
-
- import smtplib
-
-diff -u Python-2.6.4/Doc/includes/email-unpack.py.orig Python-2.6.4/Doc/includes/email-unpack.py
---- Python-2.6.4/Doc/includes/email-unpack.py.orig Mon Feb 21 10:46:44 2011
-+++ Python-2.6.4/Doc/includes/email-unpack.py Mon Feb 21 10:46:44 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Unpack a MIME message into a directory of files."""
-
-diff -u Python-2.6.4/Doc/includes/email-dir.py.orig Python-2.6.4/Doc/includes/email-dir.py
---- Python-2.6.4/Doc/includes/email-dir.py.orig Mon Feb 21 10:46:44 2011
-+++ Python-2.6.4/Doc/includes/email-dir.py Mon Feb 21 10:46:44 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
-
- """Send the contents of a directory as a MIME message."""
-
-diff -u Python-2.6.4/Doc/tools/rstlint.py.orig Python-2.6.4/Doc/tools/rstlint.py
---- Python-2.6.4/Doc/tools/rstlint.py.orig Mon Feb 21 10:46:44 2011
-+++ Python-2.6.4/Doc/tools/rstlint.py Mon Feb 21 10:46:44 2011
-@@ -1,4 +1,4 @@
--#!/usr/bin/env python
-+#!/usr/bin/python2.6
- # -*- coding: utf-8 -*-
-
- # Check for stylistic and formal issues in .rst and .py
--- a/components/python/python26/Python26-01-solaris-lib-dirs.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-diff --git Python-2.6.4/Modules/_multiprocessing/multiprocessing.h Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
---- Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
-+++ Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
-@@ -3,6 +3,10 @@
-
- #define PY_SSIZE_T_CLEAN
-
-+/* needed on Solaris for the definition of CMSG_SPACE and friends */
-+#define _XOPEN_SOURCE
-+#define _XOPEN_SOURCE_EXTENDED 1
-+
- #include "Python.h"
- #include "structmember.h"
- #include "pythread.h"
-diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
-new file mode 100644
---- Python-2.6.4/setup.py
-+++ Python-2.6.4/setup.py
-@@ -309,10 +309,10 @@
- return sys.platform
-
- def detect_modules(self):
-- # Ensure that /usr/local is always used
-- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
--
-+ if sys.platform != 'sunos5':
-+ # Ensure that /usr/local is always used
-+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
- # Add paths specified in the environment variables LDFLAGS and
- # CPPFLAGS for header and library files.
- # We must get the values from the Makefile and not the environment
-@@ -610,11 +610,22 @@
- exts.append( Extension('_csv', ['_csv.c']) )
-
- # socket(2)
-+ socket_libs = []
-+ if self.compiler.find_library_file(lib_dirs,
-+ 'socket'):
-+ socket_libs.append('socket')
-+ if self.compiler.find_library_file(lib_dirs,
-+ 'nsl'):
-+ socket_libs.append('nsl')
-+ if self.compiler.find_library_file(lib_dirs,
-+ 'resolv'):
-+ socket_libs.append('resolv')
- exts.append( Extension('_socket', ['socketmodule.c'],
-- depends = ['socketmodule.h']) )
-+ depends = ['socketmodule.h'],
-+ libraries = socket_libs) )
- # Detect SSL support for the socket module (via _ssl)
- search_for_ssl_incs_in = [
-- '/usr/local/ssl/include',
-+ '/usr/sfw/include',
- '/usr/contrib/ssl/include/'
- ]
- ssl_incs = find_file('openssl/ssl.h', inc_dirs,
-@@ -625,8 +636,12 @@
- ['/usr/kerberos/include'])
- if krb5_h:
- ssl_incs += krb5_h
-+ if sys.maxint == 2147483647L:
-+ sfw_libdir = '/usr/sfw/lib';
-+ else:
-+ sfw_libdir = '/usr/sfw/lib/64';
- ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-- ['/usr/local/ssl/lib',
-+ [sfw_libdir,
- '/usr/contrib/ssl/lib/'
- ] )
-
-@@ -635,6 +650,7 @@
- exts.append( Extension('_ssl', ['_ssl.c'],
- include_dirs = ssl_incs,
- library_dirs = ssl_libs,
-+ runtime_library_dirs = ssl_libs,
- libraries = ['ssl', 'crypto'],
- depends = ['socketmodule.h']), )
- else:
-@@ -1079,6 +1095,14 @@
-
- # Curses support, requiring the System V version of curses, often
- # provided by the ncurses library.
-+ curses_lib_dirs = []
-+ curses_inc_dirs = []
-+ if platform == 'sunos5':
-+ # look for ncurses in /usr/gnu on Solaris
-+ curses_inc_dirs.append('/usr/include/ncurses')
-+ curses_lib_dirs.append('/usr/gnu/lib')
-+ curses_lib_dirs.append('/usr/gnu/lib/amd64')
-+ curses_lib_dirs.append('/usr/gnu/lib/sparcv9')
- panel_library = 'panel'
- if (self.compiler.find_library_file(lib_dirs, 'ncursesw')):
- curses_libs = ['ncursesw']
-@@ -1087,10 +1111,13 @@
- panel_library = 'panelw'
- exts.append( Extension('_curses', ['_cursesmodule.c'],
- libraries = curses_libs) )
-- elif (self.compiler.find_library_file(lib_dirs, 'ncurses')):
-+ elif (self.compiler.find_library_file(lib_dirs + curses_lib_dirs, 'ncurses')):
- curses_libs = ['ncurses']
- exts.append( Extension('_curses', ['_cursesmodule.c'],
-- libraries = curses_libs) )
-+ libraries = curses_libs,
-+ library_dirs = curses_lib_dirs,
-+ runtime_library_dirs = curses_lib_dirs,
-+ include_dirs = curses_inc_dirs ) )
- elif (self.compiler.find_library_file(lib_dirs, 'curses')
- and platform != 'darwin'):
- # OSX has an old Berkeley curses, not good enough for
-@@ -1109,9 +1136,12 @@
-
- # If the curses module is enabled, check for the panel module
- if (module_enabled(exts, '_curses') and
-- self.compiler.find_library_file(lib_dirs, panel_library)):
-+ self.compiler.find_library_file(lib_dirs + curses_lib_dirs, panel_library)):
- exts.append( Extension('_curses_panel', ['_curses_panel.c'],
-- libraries = [panel_library] + curses_libs) )
-+ libraries = [panel_library] + curses_libs,
-+ include_dirs = curses_inc_dirs,
-+ library_dirs = curses_lib_dirs,
-+ runtime_library_dirs = curses_lib_dirs ) )
- else:
- missing.append('_curses_panel')
-
-@@ -1324,8 +1354,13 @@
- if macros.get('HAVE_SEM_OPEN', False):
- multiprocessing_srcs.append('_multiprocessing/semaphore.c')
-
-+ multiproc_libs = []
-+ if platform == 'sunos5':
-+ multiproc_libs = [ "xnet" ]
-+
- exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
- define_macros=macros.items(),
-+ libraries=multiproc_libs,
- include_dirs=["Modules/_multiprocessing"]))
- # End multiprocessing
-
-@@ -1549,15 +1584,26 @@
- # Assume we haven't found any of the libraries or include files
- # The versions with dots are used on Unix, and the versions without
- # dots on Windows, for detection by cygwin.
-+ added_lib_dirs = []
-+ tcl_tk_lib_dirs = ['/usr/sfw/lib']
-+ tcl_tk_inc_dirs = ['/usr/sfw/include']
- tcllib = tklib = tcl_includes = tk_includes = None
- for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
- '82', '8.1', '81', '8.0', '80']:
-- tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
-- tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
-+ tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version, tcl_tk_lib_dirs)
-+ tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version, tcl_tk_lib_dirs)
- if tklib and tcllib:
- # Exit the loop when we've found the Tcl/Tk libraries
- break
-
-+ tklib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tk' + version)
-+ tcllib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tcl' + version)
-+ if tklib and tcllib:
-+ # found the libs in a non-standard dir
-+ added_lib_dirs.append(os.path.dirname(tcllib))
-+ # Exit the loop when we've found the Tcl/Tk libraries
-+ break
-+
- # Now check for the header files
- if tklib and tcllib:
- # Check for the include files on Debian and {Free,Open}BSD, where
-@@ -1572,6 +1618,7 @@
- for dir in inc_dirs:
- tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
- tk_include_sub += [dir + os.sep + "tk" + dotversion]
-+ tcl_include_sub += tcl_tk_inc_dirs
- tk_include_sub += tcl_include_sub
- tcl_includes = find_file('tcl.h', inc_dirs, tcl_include_sub)
- tk_includes = find_file('tk.h', inc_dirs, tk_include_sub)
-@@ -1636,6 +1683,7 @@
- include_dirs = include_dirs,
- libraries = libs,
- library_dirs = added_lib_dirs,
-+ runtime_library_dirs = added_lib_dirs
- )
- self.extensions.append(ext)
-
-diff --git Python-2.6.4/Lib/site-packages/vendor-packages.pth Python2.6.4/Lib/site-packages/vendor-packages.pth
---- /dev/null Sat Feb 12 00:21:26 2011
-+++ Python-2.6.4/Lib/site-packages/vendor-packages.pth Sat Feb 12 00:47:05 2011
-@@ -0,0 +1,1 @@
-+import site; site.addsitedir('/usr/lib/python2.6/vendor-packages')
--- a/components/python/python26/Python26-02-pycc.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-diff --git Python-2.6.4/Makefile.pre.in Python-2.6.4/Makefile.pre.in
---- Python-2.6.4/Makefile.pre.in.orig Sun Feb 13 21:00:17 2011
-+++ Python-2.6.4/Makefile.pre.in Sun Feb 13 21:02:35 2011
-@@ -663,6 +663,8 @@
-
- $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
-
-+install-pycc: $(srcdir)/pycc
-+ $(INSTALL_SCRIPT) $< $(DESTDIR)$(BINLIBDEST)
-
- ######################################################################
-
-@@ -728,7 +728,7 @@
- $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
-
- # Install everything
--install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@
-+install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@ install-pycc
-
- # Install almost everything without disturbing previous versions
- altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
-
-diff --git Python-2.6.4/pycc Python-2.6.4/pycc
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/pycc
-@@ -0,0 +1,172 @@
-+#!/bin/ksh
-+#
-+# Script for running the C/C++ compiler when building python modules
-+#
-+# CDDL HEADER START
-+#
-+# The contents of this file are subject to the terms of the
-+# Common Development and Distribution License, Version 1.0 only
-+# (the "License"). You may not use this file except in compliance
-+# with the License.
-+#
-+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+# or http://www.opensolaris.org/os/licensing.
-+# See the License for the specific language governing permissions
-+# and limitations under the License.
-+#
-+# When distributing Covered Code, include this CDDL HEADER in each
-+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+# If applicable, add the following below this CDDL HEADER, with the
-+# fields enclosed by brackets "[]" replaced with your own identifying
-+# information: Portions Copyright [yyyy] [name of copyright owner]
-+#
-+# CDDL HEADER END
-+#
-+#
-+# Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
-+# Use is subject to license terms.
-+#
-+
-+MYNAME=`basename $0`
-+
-+# name of the compiler executable
-+CCEXE='cc'
-+# name of the GNU compiler executable
-+GCCEXE='gcc'
-+# name of the programming language
-+CLANG='C'
-+# name of the env variable for setting the compiler path
-+CVAR='CC'
-+
-+if [ "x$PYCC_CC" != x ]; then
-+ CC="$PYCC_CC"
-+fi
-+
-+if [ "x$MYNAME" = xpyCC ]; then
-+ CCEXE='CC'
-+ GCCEXE='g++'
-+ CLANG='C++'
-+ CC="$CXX"
-+ CVAR='CXX'
-+ if [ "x$PYCC_CXX" != x ]; then
-+ CC="$PYCC_CXX"
-+ fi
-+fi
-+
-+SAVED_IFS="$IFS"
-+IFS=:
-+
-+# check if the CC env variable is set
-+if [ "x$CC" != x ]; then
-+ # verify that it doesn't point to this script
-+ if /usr/bin/cmp -s "$CC" $0; then
-+ echo "WARNING: "$CVAR" is set to this script; ignoring this value to avoid an infinite loop"
-+ CC=
-+ fi
-+fi
-+
-+# check again if the CC env variable is set
-+if [ "x$CC" != x ]; then
-+ case "$CC" in
-+ /* )
-+ # $CC is an absolute path name
-+ # check if $CC exists
-+ if [ ! -e "$CC" ]; then
-+ echo "WARNING: pycc: $CC not found" 1>&2
-+ CC=
-+ else
-+ # check if $CC is an executable
-+ if [ ! -x "$CC" -o ! -f "$CC" ]; then
-+ echo "WARNING: pycc: $CC is not an executable" 1>&2
-+ CC=
-+ fi
-+ fi
-+ ;;
-+ * )
-+ # try to find $CC in the PATH
-+ NEW_CC=
-+ for dir in $PATH; do
-+ if [ -x "$dir/$CC" ]; then
-+ NEW_CC="$dir/$CC"
-+ break
-+ fi
-+ done
-+ if [ "x$NEW_CC" = x ]; then
-+ echo "WARNING: pycc: $CC not found" 1>&2
-+ CC=
-+ else
-+ CC="$NEW_CC"
-+ fi
-+ ;;
-+ esac
-+fi
-+
-+if [ "x$CC" = x ]; then
-+ # Look for the Sun Studio compiler in the PATH
-+ for dir in $PATH; do
-+ if [ -x "$dir/$CCEXE" ]; then
-+ CC="$dir/$CCEXE"
-+ break
-+ fi
-+ done
-+fi
-+
-+if [ "x$CC" = x ]; then
-+ # Look for gcc in the PATH
-+ for dir in $PATH; do
-+ if [ -x "$dir/$GCCEXE" ]; then
-+ CC="$dir/$GCCEXE"
-+ break
-+ fi
-+ done
-+fi
-+
-+if [ "x$CC" = x ]; then
-+ # Check for Sun Studio in /opt/SUNWspro (default install location)
-+ if [ -x /opt/SUNWspro/bin/$CCEXE ]; then
-+ CC=/opt/SUNWspro/bin/$CCEXE
-+ fi
-+fi
-+
-+if [ "x$CC" = x ]; then
-+ # Check for the GNU compiler in /usr/sfw/bin
-+ if [ -x /usr/sfw/bin/$GCCEXE ]; then
-+ CC=/usr/sfw/bin/$GCCEXE
-+ fi
-+fi
-+
-+if [ "x$CC" = x ]; then
-+ # Cannot continue without a C compiler
-+ echo "ERROR: no $CLANG compiler not found; update your PATH or set the $CVAR env variable" 1>&2
-+ exit 1
-+fi
-+
-+IFS="$SAVED_IFS"
-+
-+# We need to make some modifications to adapt correctly to compiler options
-+# that differ between GCC and Studio.
-+
-+extra_flags=
-+
-+is_gcc=no
-+
-+$CC --version >/dev/null 2>&1 && is_gcc=yes
-+
-+if [ "$is_gcc" = yes ]; then
-+ for flag in "${@}"; do
-+ # need -shared to link shared objects properly
-+ if [ "$flag" = "-G" ]; then
-+ extra_flags="$extra_flags -shared"
-+ fi
-+ # workaround for 6223255
-+ if [ "$flag" = "-m64" ]; then
-+ extra_flags="$extra_flags -R/usr/sfw/lib/amd64"
-+ fi
-+ done
-+ # force PIC compilation
-+ extra_flags="$extra_flags -fPIC -DPIC"
-+else
-+ extra_flags="$extra_flags -KPIC"
-+fi
-+
-+exec "$CC" $extra_flags "${@}"
--- a/components/python/python26/Python26-03-distutils-pycc.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-diff --git Python-2.6.4/Lib/distutils/sysconfig.py Python-2.6.4/Lib/distutils/sysconfig.py
---- Python-2.6.4/Lib/distutils/sysconfig.py
-+++ Python-2.6.4/Lib/distutils/sysconfig.py
-@@ -166,16 +166,10 @@
- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
- 'CCSHARED', 'LDSHARED', 'SO')
-
-- if 'CC' in os.environ:
-- cc = os.environ['CC']
-- if 'CXX' in os.environ:
-- cxx = os.environ['CXX']
-- if 'LDSHARED' in os.environ:
-- ldshared = os.environ['LDSHARED']
-- if 'CPP' in os.environ:
-- cpp = os.environ['CPP']
-- else:
-- cpp = cc + " -E" # not always
-+ # On Solaris, we must always use pycc/pyCC, which will then look up
-+ # $CC and $CXX
-+ cpp = cc + " -E"
-+
- if 'LDFLAGS' in os.environ:
- ldshared = ldshared + ' ' + os.environ['LDFLAGS']
- if 'CFLAGS' in os.environ:
--- a/components/python/python26/Python26-04-distutils-log.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-diff --git Python-2.6.4/Lib/distutils/spawn.py Python-2.6.4/Lib/distutils/spawn.py
---- Python-2.6.4/Lib/distutils/spawn.py
-+++ Python-2.6.4/Lib/distutils/spawn.py
-@@ -73,7 +73,7 @@
- if search_path:
- # either we find one or it stays the same
- executable = find_executable(executable) or executable
-- log.info(string.join([executable] + cmd[1:], ' '))
-+ log.info("%s", string.join([executable] + cmd[1:], ' '))
- if not dry_run:
- # spawn for NT requires a full path to the .exe
- try:
-@@ -98,7 +98,7 @@
- if search_path:
- # either we find one or it stays the same
- executable = find_executable(executable) or executable
-- log.info(string.join([executable] + cmd[1:], ' '))
-+ log.info("%s", string.join([executable] + cmd[1:], ' '))
- if not dry_run:
- # spawnv for OS/2 EMX requires a full path to the .exe
- try:
-@@ -119,7 +119,7 @@
- verbose=0,
- dry_run=0):
-
-- log.info(string.join(cmd, ' '))
-+ log.info("%s", string.join(cmd, ' '))
- if dry_run:
- return
- exec_fn = search_path and os.execvp or os.execv
--- a/components/python/python26/Python26-05-isalibs.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,452 +0,0 @@
-diff --git Python-2.6.4/Lib/distutils/command/build_ext.py Python-2.6.4/Lib/distutils/command/build_ext.py
---- Python-2.6.4/Lib/distutils/command/build_ext.py
-+++ Python-2.6.4/Lib/distutils/command/build_ext.py
-@@ -636,6 +636,8 @@
- modpath = fullname.split('.')
- filename = self.get_ext_filename(ext_name)
- filename = os.path.split(filename)[-1]
-+ if sys.maxint != 2147483647L:
-+ filename = os.path.join("64", filename)
-
- if not self.inplace:
- # no further work needed
-@@ -677,7 +679,13 @@
- so_ext = get_config_var('SO')
- if os.name == 'nt' and self.debug:
- return apply(os.path.join, ext_path) + '_d' + so_ext
-- return os.path.join(*ext_path) + so_ext
-+ # .so extensions are word-size specific
-+ path = apply(os.path.join, ext_path)
-+ if sys.maxint == 2147483647L:
-+ return path + so_ext
-+ dirname = os.path.dirname(path);
-+ basename = os.path.basename(path);
-+ return os.path.join(dirname, "64", basename + so_ext)
-
- def get_export_symbols (self, ext):
- """Return the list of symbols that a shared extension has to
-diff --git Python-2.6.4/Makefile.pre.in Python-2.6.4/Makefile.pre.in
---- Python-2.6.4/Makefile.pre.in
-+++ Python-2.6.4/Makefile.pre.in
-@@ -87,18 +87,18 @@
-
- # Expanded directories
- BINDIR= $(exec_prefix)/bin
--LIBDIR= $(exec_prefix)/lib
-+LIBDIR= @libdir@
- MANDIR= @mandir@
- INCLUDEDIR= @includedir@
- CONFINCLUDEDIR= $(exec_prefix)/include
- SCRIPTDIR= $(prefix)/lib
-
- # Detailed destination directories
--BINLIBDEST= $(LIBDIR)/python$(VERSION)
--LIBDEST= $(SCRIPTDIR)/python$(VERSION)
--INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
--CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
--LIBP= $(LIBDIR)/python$(VERSION)
-+BINLIBDEST= $(exec_prefix)/lib/python$(VERSION)
-+LIBDEST= $(SCRIPTDIR)/python$(VERSION)
-+INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
-+CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
-+LIBP= $(exec_prefix)/lib/python$(VERSION)
-
- # Symbols used for using shared libraries
- SO= @SO@
-diff --git Python-2.6.4/Python/import.c Python-2.6.4/Python/import.c
---- Python-2.6.4/Python/import.c
-+++ Python-2.6.4/Python/import.c
-@@ -1191,6 +1191,57 @@
- static int find_init_module(char *); /* Forward */
- static struct filedescr importhookdescr = {"", "", IMP_HOOK};
-
-+#ifdef HAVE_STAT
-+static char *
-+insert_64dir(char *buf, size_t buflen)
-+{
-+ char *base;
-+ char *cp;
-+ size_t blen;
-+
-+ if ((blen = strlen(buf)) == 0)
-+ return (NULL);
-+
-+ cp = &buf[blen - 1];
-+ while (cp != buf && *cp != SEP)
-+ cp--;
-+
-+ if (cp != buf)
-+ cp++;
-+
-+ if (blen + strlen("64/") + 1 >= buflen)
-+ return NULL;
-+
-+ base = strdup(cp);
-+ sprintf(cp, "64%c%s", SEP, base);
-+ free(base);
-+
-+ return buf;
-+}
-+
-+/*
-+ * If we're on a 64-bit platform, modify lookups for shared object files.
-+ */
-+static size_t modify_path(struct filedescr *fdp, char *buf, size_t buflen)
-+{
-+ struct stat statbuf;
-+
-+ if (sizeof(void *) != 8)
-+ return 0;
-+
-+ if (stat(buf, &statbuf) == 0 && S_ISDIR(statbuf.st_mode))
-+ return 0;
-+
-+ if (fdp->type != C_EXTENSION)
-+ return 0;
-+
-+ if (insert_64dir(buf, buflen) == NULL)
-+ return 0;
-+
-+ return strlen("64/");
-+}
-+#endif
-+
- static struct filedescr *
- find_module(char *fullname, char *subname, PyObject *path, char *buf,
- size_t buflen, FILE **p_fp, PyObject **p_loader)
-@@ -1208,11 +1259,10 @@
- static struct filedescr fd_builtin = {"", "", C_BUILTIN};
- static struct filedescr fd_package = {"", "", PKG_DIRECTORY};
- char name[MAXPATHLEN+1];
--#if defined(PYOS_OS2)
- size_t saved_len;
- size_t saved_namelen;
- char *saved_buf = NULL;
--#endif
-+
- if (p_loader != NULL)
- *p_loader = NULL;
-
-@@ -1431,15 +1481,19 @@
- }
- #endif
- #endif
--#if defined(PYOS_OS2)
-+
- /* take a snapshot of the module spec for restoration
- * after the 8 character DLL hackery
- */
- saved_buf = strdup(buf);
- saved_len = len;
- saved_namelen = namelen;
--#endif /* PYOS_OS2 */
-+
- for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
-+#ifdef HAVE_STAT
-+ len += modify_path(fdp, buf, buflen);
-+#endif
-+
- #if defined(PYOS_OS2) && defined(HAVE_DYNAMIC_LOADING)
- /* OS/2 limits DLLs to 8 character names (w/o
- extension)
-@@ -1480,21 +1534,18 @@
- fp = NULL;
- }
- }
--#if defined(PYOS_OS2)
-+
- /* restore the saved snapshot */
- strcpy(buf, saved_buf);
- len = saved_len;
- namelen = saved_namelen;
--#endif
- }
--#if defined(PYOS_OS2)
- /* don't need/want the module name snapshot anymore */
- if (saved_buf)
- {
- free(saved_buf);
- saved_buf = NULL;
- }
--#endif
- Py_XDECREF(copy);
- if (fp != NULL)
- break;
-diff --git Python-2.6.4/Python/importdl.h Python-2.6.4/Python/importdl.h
---- Python-2.6.4/Python/importdl.h
-+++ Python-2.6.4/Python/importdl.h
-@@ -31,8 +31,9 @@
- extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
- FILE *);
-
--/* Max length of module suffix searched for -- accommodates "module.slb" */
--#define MAXSUFFIXSIZE 12
-+/* Max length of module suffix searched for -- accommodates "module.slb"
-+ and "64/" */
-+#define MAXSUFFIXSIZE 15
-
- #ifdef MS_WINDOWS
- #include <windows.h>
-diff --git Python-2.6.4/configure.in Python-2.6.4/configure.in
---- Python-2.6.4/configure.in
-+++ Python-2.6.4/configure.in
-@@ -17,8 +17,44 @@
- AH_TOP([
- #ifndef Py_PYCONFIG_H
- #define Py_PYCONFIG_H
-+
- ])
- AH_BOTTOM([
-+
-+#include <sys/isa_defs.h>
-+
-+/*
-+ * Python originally defined these statically, which prevents a 32-64 python
-+ * from working at all.
-+ */
-+
-+#define SIZEOF_SHORT 2
-+#define SIZEOF_INT 4
-+#define SIZEOF_LONG_LONG 8
-+#define SIZEOF_FPOS_T 8
-+#define SIZEOF_OFF_T 8
-+#define SIZEOF_PTHREAD_T 4
-+
-+#ifdef _LP64
-+#define SIZEOF_LONG 8
-+#define SIZEOF_UINTPTR_T 8
-+#define SIZEOF_VOID_P 8
-+#define SIZEOF_TIME_T 8
-+#define SIZEOF_SIZE_T 8
-+#define SIZEOF_LONG_DOUBLE 16
-+#else
-+#define SIZEOF_LONG 4
-+#define SIZEOF_UINTPTR_T 4
-+#define SIZEOF_VOID_P 4
-+#define SIZEOF_TIME_T 4
-+#define SIZEOF_SIZE_T 4
-+#if defined(__i386)
-+#define SIZEOF_LONG_DOUBLE 12
-+#else
-+#define SIZEOF_LONG_DOUBLE 16
-+#endif
-+#endif
-+
- /* Define the macros needed if on a UnixWare 7.x system. */
- #if defined(__USLC__) && defined(__SCO_VERSION__)
- #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
-@@ -65,6 +101,26 @@
-
- define_xopen_source=yes
-
-+# AC_CHECK_SIZEOF without the AC_DEFINE_UNQUOTED
-+AC_DEFUN([PY_CHECK_SIZEOF],
-+[AS_LITERAL_IF([$1], [],
-+ [AC_FATAL([$0: requires literal arguments])])dnl
-+AC_CHECK_TYPE([$1], [], [], [$3])
-+AC_CACHE_CHECK([size of $1], AS_TR_SH([ac_cv_sizeof_$1]),
-+[if test "$AS_TR_SH([ac_cv_type_$1])" = yes; then
-+ # The cast to unsigned long works around a bug in the HP C Compiler
-+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-+ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-+ # This bug is HP SR number 8606223364.
-+ _AC_COMPUTE_INT([(long) (sizeof ($1))],
-+ [AS_TR_SH([ac_cv_sizeof_$1])],
-+ [AC_INCLUDES_DEFAULT([$3])],
-+ [AC_MSG_FAILURE([cannot compute sizeof ($1), 77])])
-+else
-+ AS_TR_SH([ac_cv_sizeof_$1])=0
-+fi])dnl
-+])# PY_CHECK_SIZEOF
-+
- # Arguments passed to configure.
- AC_SUBST(CONFIG_ARGS)
- CONFIG_ARGS="$ac_configure_args"
-@@ -1377,14 +1433,10 @@
-
- # Sizes of various common basic types
- # ANSI C requires sizeof(char) == 1, so no need to check it
--AC_CHECK_SIZEOF(int, 4)
--AC_CHECK_SIZEOF(long, 4)
--AC_CHECK_SIZEOF(void *, 4)
- AC_CHECK_SIZEOF(short, 2)
- AC_CHECK_SIZEOF(float, 4)
- AC_CHECK_SIZEOF(double, 8)
--AC_CHECK_SIZEOF(fpos_t, 4)
--AC_CHECK_SIZEOF(size_t, 4)
-+AC_CHECK_SIZEOF(short)
- AC_CHECK_SIZEOF(pid_t, 4)
-
- AC_MSG_CHECKING(for long long support)
-@@ -1394,9 +1446,6 @@
- have_long_long=yes
- ])
- AC_MSG_RESULT($have_long_long)
--if test "$have_long_long" = yes ; then
--AC_CHECK_SIZEOF(long long, 8)
--fi
-
- AC_MSG_CHECKING(for long double support)
- have_long_double=no
-@@ -1404,10 +1453,6 @@
- AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.])
- have_long_double=yes
- ])
--AC_MSG_RESULT($have_long_double)
--if test "$have_long_double" = yes ; then
--AC_CHECK_SIZEOF(long double, 12)
--fi
-
- AC_MSG_CHECKING(for _Bool support)
- have_c99_bool=no
-@@ -1421,102 +1466,26 @@
- fi
-
- AC_CHECK_TYPES(uintptr_t,
-- [AC_CHECK_SIZEOF(uintptr_t, 4)],
-+ [],
- [], [#ifdef HAVE_STDINT_H
- #include <stdint.h>
- #endif])
-
-
--# Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
--AC_MSG_CHECKING(size of off_t)
--AC_CACHE_VAL(ac_cv_sizeof_off_t,
--[AC_TRY_RUN([#include <stdio.h>
-+PY_CHECK_SIZEOF(off_t,4,[
-+#include <stdio.h>
-+#include <stdlib.h>
- #include <sys/types.h>
--main()
--{
-- FILE *f=fopen("conftestval", "w");
-- if (!f) exit(1);
-- fprintf(f, "%d\n", sizeof(off_t));
-- exit(0);
--}],
--ac_cv_sizeof_off_t=`cat conftestval`,
--ac_cv_sizeof_off_t=0,
--ac_cv_sizeof_off_t=4)
- ])
--AC_MSG_RESULT($ac_cv_sizeof_off_t)
--AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
--[The number of bytes in an off_t.])
-
- AC_MSG_CHECKING(whether to enable large file support)
--if test "$have_long_long" = yes -a \
-- "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
-- "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
-- AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
-- [Defined to enable large file support when an off_t is bigger than a long
-- and long long is available and at least as big as an off_t. You may need
-- to add some flags for configuration and compilation to enable this mode.
-- (For Solaris and Linux, the necessary defines are already defined.)])
-- AC_MSG_RESULT(yes)
--else
-- AC_MSG_RESULT(no)
--fi
-
--# AC_CHECK_SIZEOF() doesn't include <time.h>.
--AC_MSG_CHECKING(size of time_t)
--AC_CACHE_VAL(ac_cv_sizeof_time_t,
--[AC_TRY_RUN([#include <stdio.h>
--#include <time.h>
--main()
--{
-- FILE *f=fopen("conftestval", "w");
-- if (!f) exit(1);
-- fprintf(f, "%d\n", sizeof(time_t));
-- exit(0);
--}],
--ac_cv_sizeof_time_t=`cat conftestval`,
--ac_cv_sizeof_time_t=0,
--ac_cv_sizeof_time_t=4)
--])
--AC_MSG_RESULT($ac_cv_sizeof_time_t)
--AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t,
--[The number of bytes in a time_t.])
--
--
--# if have pthread_t then define SIZEOF_PTHREAD_T
--ac_save_cc="$CC"
--if test "$ac_cv_kpthread" = "yes"
--then CC="$CC -Kpthread"
--elif test "$ac_cv_kthread" = "yes"
--then CC="$CC -Kthread"
--elif test "$ac_cv_pthread" = "yes"
--then CC="$CC -pthread"
--fi
--AC_MSG_CHECKING(for pthread_t)
--have_pthread_t=no
--AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
--AC_MSG_RESULT($have_pthread_t)
--if test "$have_pthread_t" = yes ; then
-- # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
-- AC_MSG_CHECKING(size of pthread_t)
-- AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
-- [AC_TRY_RUN([#include <stdio.h>
--#include <pthread.h>
-- main()
-- {
-- FILE *f=fopen("conftestval", "w");
-- if (!f) exit(1);
-- fprintf(f, "%d\n", sizeof(pthread_t));
-- exit(0);
-- }],
-- ac_cv_sizeof_pthread_t=`cat conftestval`,
-- ac_cv_sizeof_pthread_t=0,
-- ac_cv_sizeof_pthread_t=4)
-- ])
-- AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
-- AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t,
-- [The number of bytes in a pthread_t.])
--fi
--CC="$ac_save_cc"
-+AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
-+[Defined to enable large file support when an off_t is bigger than a long
-+ and long long is available and at least as big as an off_t. You may need
-+ to add some flags for configuration and compilation to enable this mode.
-+ (For Solaris and Linux, the necessary defines are already defined.)])
-+AC_MSG_RESULT(yes)
-
- AC_MSG_CHECKING(for --enable-toolbox-glue)
- AC_ARG_ENABLE(toolbox-glue,
-@@ -1810,12 +1779,6 @@
- if test -z "$CCSHARED"
- then
- case $ac_sys_system/$ac_sys_release in
-- SunOS*) if test "$GCC" = yes;
-- then CCSHARED="-fPIC";
-- elif test `uname -p` = sparc;
-- then CCSHARED="-xcode=pic32";
-- else CCSHARED="-Kpic";
-- fi;;
- hp*|HP*) if test "$GCC" = yes;
- then CCSHARED="-fPIC";
- else CCSHARED="+z";
-@@ -3308,12 +3271,6 @@
- wchar_h="no"
- )
-
--# determine wchar_t size
--if test "$wchar_h" = yes
--then
-- AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
--fi
--
- AC_MSG_CHECKING(for UCS-4 tcl)
- have_ucs4_tcl=no
- AC_TRY_COMPILE([
-@@ -3344,6 +3301,11 @@
- ac_cv_wchar_t_signed=no,
- ac_cv_wchar_t_signed=yes)])
- AC_MSG_RESULT($ac_cv_wchar_t_signed)
-+
-+ PY_CHECK_SIZEOF(wchar_t, 4, [
-+ #include <wchar.h>
-+ #include <stdlib.h
-+ ])
- fi
-
- AC_MSG_CHECKING(what type to use for unicode)
--- a/components/python/python26/Python26-06-write_compiled_module-atomic.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-diff --git Python-2.6.4/Python/import.c Python-2.6.4/Python/import.c
---- Python-2.6.4/Python/import.c
-+++ Python-2.6.4/Python/import.c
-@@ -866,8 +866,9 @@
-
- /* Write a compiled module to a file, placing the time of last
- modification of its source into the header.
-- Errors are ignored, if a write error occurs an attempt is made to
-- remove the file. */
-+ Write to a temporary file first so that creating the file is atomic.
-+ Errors are ignored, if a write/unlink/rename error occurs an attempt
-+ is made to remove the temporary file. */
-
- static void
- write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
-@@ -879,12 +880,21 @@
- #else
- mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
- #endif
-+ char *tmppathname;
-+
-+ /* the temporary file is called cpathname + ".tmp" */
-+ if ((tmppathname = PyMem_Malloc(strlen(cpathname) + strlen(".tmp") + 1))
-+ == NULL) {
-+ return;
-+ }
-+ sprintf (tmppathname, "%s.tmp", cpathname);
-+ fp = open_exclusive(tmppathname, mode);
-
-- fp = open_exclusive(cpathname, mode);
- if (fp == NULL) {
- if (Py_VerboseFlag)
- PySys_WriteStderr(
-- "# can't create %s\n", cpathname);
-+ "# can't create %s\n", tmppathname);
-+ PyMem_Free(tmppathname);
- return;
- }
- PyMarshal_WriteLongToFile(pyc_magic, fp, Py_MARSHAL_VERSION);
-@@ -893,10 +903,11 @@
- PyMarshal_WriteObjectToFile((PyObject *)co, fp, Py_MARSHAL_VERSION);
- if (fflush(fp) != 0 || ferror(fp)) {
- if (Py_VerboseFlag)
-- PySys_WriteStderr("# can't write %s\n", cpathname);
-+ PySys_WriteStderr("# can't write %s\n", tmppathname);
- /* Don't keep partial file */
- fclose(fp);
-- (void) unlink(cpathname);
-+ (void) unlink(tmppathname);
-+ PyMem_Free(tmppathname);
- return;
- }
- /* Now write the true mtime */
-@@ -905,8 +916,30 @@
- PyMarshal_WriteLongToFile((long)mtime, fp, Py_MARSHAL_VERSION);
- fflush(fp);
- fclose(fp);
-+ /* Delete the old compiled file, if exists */
-+ if (unlink (cpathname)) {
-+ if ((errno != ENOENT)) {
-+ /* the file exists but could not be deleted */
-+ if (Py_VerboseFlag)
-+ PySys_WriteStderr(
-+ "# can't unlink %s\n", cpathname);
-+ (void) unlink(tmppathname);
-+ PyMem_Free(tmppathname);
-+ return;
-+ }
-+ }
-+ /* rename the tmp file to the real file name */
-+ if (rename (tmppathname, cpathname)) {
-+ if (Py_VerboseFlag)
-+ PySys_WriteStderr(
-+ "# can't rename %s to %s\n", tmppathname, cpathname);
-+ (void) unlink(tmppathname);
-+ PyMem_Free(tmppathname);
-+ return;
-+ }
- if (Py_VerboseFlag)
- PySys_WriteStderr("# wrote %s\n", cpathname);
-+ PyMem_Free(tmppathname);
- }
-
- static void
--- a/components/python/python26/Python26-07-dtrace.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,417 +0,0 @@
-diff --git Python-2.6.4/Include/frameobject.h Python-2.6.4/Include/frameobject.h
---- Python-2.6.4/Include/frameobject.h
-+++ Python-2.6.4/Include/frameobject.h
-@@ -41,6 +41,7 @@
- /* As of 2.3 f_lineno is only valid when tracing is active (i.e. when
- f_trace is set) -- at other times use PyCode_Addr2Line instead. */
- int f_lineno; /* Current line number */
-+ int f_calllineno; /* line number of call site */
- int f_iblock; /* index in f_blockstack */
- PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
- PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */
-diff --git Python-2.6.4/Makefile.pre.in Python-2.6.4/Makefile.pre.in
---- Python-2.6.4/Makefile.pre.in
-+++ Python-2.6.4/Makefile.pre.in
-@@ -201,6 +201,7 @@
- GRAMMAR_C= $(srcdir)/Python/graminit.c
- GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
-
-+DTRACE_OBJS=Python/dtrace.o Python/phelper.o
-
- ##########################################################################
- # Parser
-@@ -290,6 +291,7 @@
- Python/formatter_unicode.o \
- Python/formatter_string.o \
- Python/$(DYNLOADFILE) \
-+ $(DTRACE_OBJS) \
- $(LIBOBJS) \
- $(MACHDEP_OBJS) \
- $(THREADOBJ)
-@@ -577,6 +579,18 @@
- Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
- $(STRINGLIB_HEADERS)
-
-+Python/phelper.o: $(srcdir)/Python/phelper.d
-+ dtrace -o $@ -DPHELPER $(DFLAGS) $(CPPFLAGS) -C -G -s $(srcdir)/Python/phelper.d
-+
-+Python/python.h: $(srcdir)/Python/python.d
-+ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Python/python.d
-+
-+Python/ceval.o: Python/ceval.c Python/python.h
-+ $(CC) -c $(BASECFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE -o $@ $<
-+
-+Python/dtrace.o: $(srcdir)/Python/python.d Python/ceval.o
-+ dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Python/python.d Python/ceval.o
-+
- ############################################################################
- # Header files
-
-diff --git Python-2.6.4/Objects/frameobject.c Python-2.6.4/Objects/frameobject.c
---- Python-2.6.4/Objects/frameobject.c
-+++ Python-2.6.4/Objects/frameobject.c
-@@ -698,6 +698,7 @@
- f->f_tstate = tstate;
-
- f->f_lasti = -1;
-+ f->f_calllineno = code->co_firstlineno;
- f->f_lineno = code->co_firstlineno;
- f->f_iblock = 0;
-
-diff --git Python-2.6.4/Python/ceval.c Python-2.6.4/Python/ceval.c
---- Python-2.6.4/Python/ceval.c
-+++ Python-2.6.4/Python/ceval.c
-@@ -19,6 +19,11 @@
-
- #include <ctype.h>
-
-+#define HAVE_DTRACE
-+#ifdef HAVE_DTRACE
-+#include "python.h"
-+#endif
-+
- #ifndef WITH_TSC
-
- #define READ_TIMESTAMP(var)
-@@ -527,6 +532,55 @@
- NULL);
- }
-
-+#ifdef HAVE_DTRACE
-+static void
-+dtrace_entry(PyFrameObject *f)
-+{
-+ const char *filename;
-+ const char *fname;
-+ int lineno;
-+
-+ filename = PyString_AsString(f->f_code->co_filename);
-+ fname = PyString_AsString(f->f_code->co_name);
-+ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
-+
-+ PYTHON_FUNCTION_ENTRY((char *)filename, (char *)fname, lineno);
-+
-+ /*
-+ * Currently a USDT tail-call will not receive the correct arguments.
-+ * Disable the tail call here.
-+ */
-+#if defined(__sparc)
-+ asm("nop");
-+#endif
-+}
-+
-+static void
-+dtrace_return(PyFrameObject *f)
-+{
-+ const char *filename;
-+ const char *fname;
-+ int lineno;
-+
-+ filename = PyString_AsString(f->f_code->co_filename);
-+ fname = PyString_AsString(f->f_code->co_name);
-+ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
-+ PYTHON_FUNCTION_RETURN((char *)filename, (char *)fname, lineno);
-+
-+ /*
-+ * Currently a USDT tail-call will not receive the correct arguments.
-+ * Disable the tail call here.
-+ */
-+#if defined(__sparc)
-+ asm("nop");
-+#endif
-+}
-+#else
-+#define PYTHON_FUNCTION_ENTRY_ENABLED 0
-+#define PYTHON_FUNCTION_RETURN_ENABLED 0
-+#define dtrace_entry()
-+#define dtrace_return()
-+#endif
-
- /* Interpreter main loop */
-
-@@ -538,9 +592,84 @@
- return PyEval_EvalFrameEx(f, 0);
- }
-
-+/*
-+ * These shenanigans look like utter madness, but what we're actually doing is
-+ * making sure that the ustack helper will see the PyFrameObject pointer on the
-+ * stack. We have two tricky cases:
-+ *
-+ * amd64
-+ *
-+ * We use up the six registers for passing arguments, meaning the call can't
-+ * use a register for passing 'f', and has to push it onto the stack in a known
-+ * location.
-+ *
-+ * And how does "throwflag" figure in to this? -PN
-+ *
-+ * SPARC
-+ *
-+ * Here the problem is that (on 32-bit) the compiler is re-using %i0 before
-+ * some calls inside PyEval_EvalFrameReal(), which means that when it's saved,
-+ * it's just some junk value rather than the real first argument. So, instead,
-+ * we trace our proxy PyEval_EvalFrame(), where we 'know' the compiler won't
-+ * decide to re-use %i0. We also need to defeat optimization of our proxy.
-+ */
-+
-+#if defined(HAVE_DTRACE)
-+
-+#if defined(__amd64)
-+PyObject *PyEval_EvalFrameExReal(long, long, long, long, long, long,
-+ PyFrameObject *, int throwflag);
-+
-+
-+
- PyObject *
- PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
- {
-+ volatile PyObject *f2;
-+ f2 = PyEval_EvalFrameExReal(0, 0, 0, 0, 0, 0, f, throwflag);
-+ return (PyObject *)f2;
-+}
-+
-+PyObject *
-+PyEval_EvalFrameExReal(long a1, long a2, long a3, long a4, long a5, long a6,
-+ PyFrameObject *f, int throwflag)
-+{
-+
-+#elif defined(__sparc)
-+
-+PyObject *PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag);
-+
-+volatile int dummy;
-+
-+PyObject *
-+PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
-+{
-+ volatile PyObject *f2;
-+ f2 = PyEval_EvalFrameExReal(f, throwflag);
-+ dummy = f->ob_refcnt;
-+ return (PyObject *)f2;
-+}
-+
-+PyObject *
-+PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag)
-+{
-+
-+#else /* __amd64 || __sparc */
-+
-+PyObject *
-+PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
-+{
-+
-+#endif /* __amd64 || __sparc */
-+
-+#else /* don't HAVE_DTRACE */
-+
-+PyObject *
-+PyEval_EvalFrameexEx(PyFrameObject *f, int throwflag))
-+{
-+
-+#endif /* HAVE_DTRACE */
-+
- #ifdef DXPAIRS
- int lastopcode = 0;
- #endif
-@@ -763,6 +892,9 @@
- }
- }
-
-+ if (PYTHON_FUNCTION_ENTRY_ENABLED())
-+ dtrace_entry(f);
-+
- co = f->f_code;
- names = co->co_names;
- consts = co->co_consts;
-@@ -2383,6 +2515,10 @@
- PyObject **sp;
- PCALL(PCALL_ALL);
- sp = stack_pointer;
-+#ifdef HAVE_DTRACE
-+ f->f_calllineno = PyCode_Addr2Line(f->f_code,
-+ f->f_lasti);
-+#endif
- #ifdef WITH_TSC
- x = call_function(&sp, oparg, &intr0, &intr1);
- #else
-@@ -2425,6 +2561,11 @@
- } else
- Py_INCREF(func);
- sp = stack_pointer;
-+#ifdef HAVE_DTRACE
-+ f->f_calllineno = PyCode_Addr2Line(f->f_code,
-+ f->f_lasti);
-+#endif
-+
- READ_TIMESTAMP(intr0);
- x = ext_do_call(func, &sp, flags, na, nk);
- READ_TIMESTAMP(intr1);
-@@ -2723,6 +2864,8 @@
-
- /* pop frame */
- exit_eval_frame:
-+ if (PYTHON_FUNCTION_RETURN_ENABLED())
-+ dtrace_return(f);
- Py_LeaveRecursiveCall();
- tstate->frame = f->f_back;
-
-diff --git Python-2.6.4/Python/phelper.d Python-2.6.4/Python/phelper.d
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/Python/phelper.d
-@@ -0,0 +1,139 @@
-+
-+/*
-+ * Python ustack helper. This relies on the first argument (PyFrame *) being
-+ * on the stack; see Python/ceval.c for the contortions we go through to ensure
-+ * this is the case.
-+ *
-+ * On x86, the PyFrame * is two slots up from the frame pointer; on SPARC, it's
-+ * eight.
-+ */
-+
-+/*
-+ * Yes, this is as gross as it looks. DTrace cannot handle static functions,
-+ * and our stat_impl.h has them in ILP32.
-+ */
-+#define _SYS_STAT_H
-+
-+#include <stdio.h>
-+#include <sys/types.h>
-+
-+#include "pyport.h"
-+#include "object.h"
-+#include "pystate.h"
-+#include "pyarena.h"
-+#include "pythonrun.h"
-+#include "compile.h"
-+#include "frameobject.h"
-+#include "stringobject.h"
-+
-+#if defined(__i386)
-+#define startframe PyEval_EvalFrameEx
-+#define endframe PyEval_EvalCodeEx
-+#elif defined(__amd64)
-+#define PyEval_EvalFrameEx PyEval_EvalFrameExReal
-+#define startframe PyEval_EvalFrameExReal
-+#define endframe PyEval_EvalCodeEx
-+#elif defined(__sparc)
-+#define PyEval_EvalFrameEx PyEval_EvalFrameExReal
-+#define startframe PyEval_EvalFrameEx
-+#define endframe PyEval_EvalFrameExReal
-+#endif
-+
-+#ifdef __sparcv9
-+#define STACK_BIAS (2048-1)
-+#else
-+#define STACK_BIAS 0
-+#endif
-+
-+/*
-+ * Not defining PHELPER lets us test this code as a normal D script.
-+ */
-+#ifdef PHELPER
-+
-+#define at_evalframe(addr) \
-+ ((uintptr_t)addr >= ((uintptr_t)&``startframe) && \
-+ (uintptr_t)addr < ((uintptr_t)&``endframe))
-+#define probe dtrace:helper:ustack:
-+#define print_result(r) (r)
-+
-+#if defined(__i386) || defined(__amd64)
-+#define frame_ptr_addr ((uintptr_t)arg1 + sizeof(uintptr_t) * 2)
-+#elif defined(__sparc)
-+#define frame_ptr_addr ((uintptr_t)arg1 + STACK_BIAS + sizeof(uintptr_t) * 8)
-+#else
-+#error unknown architecture
-+#endif
-+
-+#else /* PHELPER */
-+
-+#define at_evalframe(addr) (1)
-+#define probe pid$target::PyEval_EvalFrame:entry
-+#define print_result(r) (trace(r))
-+
-+#if defined(__i386) || defined(__amd64)
-+#define frame_ptr_addr ((uintptr_t)uregs[R_SP] + sizeof(uintptr_t))
-+#elif defined(__sparc)
-+/*
-+ * Not implemented: we could just use R_I0, but what's the point?
-+ */
-+#else
-+#error unknown architecture
-+#endif
-+
-+#endif /* PHELPER */
-+
-+extern uintptr_t PyEval_EvalFrameEx;
-+extern uintptr_t PyEval_EvalCodeEx;
-+
-+#define copyin_obj(addr, obj) ((obj *)copyin((uintptr_t)addr, sizeof(obj)))
-+#define pystr_addr(addr) ((char *)addr + offsetof(PyStringObject, ob_sval))
-+#define copyin_str(dest, addr, obj) \
-+ (copyinto((uintptr_t)pystr_addr(addr), obj->ob_size, (dest)))
-+#define add_str(addr, obj) \
-+ copyin_str(this->result + this->pos, addr, obj); \
-+ this->pos += obj->ob_size; \
-+ this->result[this->pos] = '\0';
-+#define add_digit(nr, div) ((nr / div) ? \
-+ (this->result[this->pos++] = '0' + ((nr / div) % 10)) : \
-+ (this->result[this->pos] = '\0'))
-+#define add_char(c) (this->result[this->pos++] = c)
-+
-+probe /at_evalframe(arg0)/
-+{
-+ this->framep = *(uintptr_t *)copyin(frame_ptr_addr, sizeof(uintptr_t));
-+ this->frameo = copyin_obj(this->framep, PyFrameObject);
-+ this->codep = this->frameo->f_code;
-+ this->lineno = this->frameo->f_calllineno;
-+ this->codeo = copyin_obj(this->codep, PyCodeObject);
-+ this->filenamep = this->codeo->co_filename;
-+ this->fnamep = this->codeo->co_name;
-+ this->filenameo = copyin_obj(this->filenamep, PyStringObject);
-+ this->fnameo = copyin_obj(this->fnamep, PyStringObject);
-+
-+ this->len = 1 + this->filenameo->ob_size + 1 + 5 + 2 +
-+ this->fnameo->ob_size + 1 + 1;
-+
-+ this->result = (char *)alloca(this->len);
-+ this->pos = 0;
-+
-+ add_char('@');
-+ add_str(this->filenamep, this->filenameo);
-+ add_char(':');
-+ add_digit(this->lineno, 10000);
-+ add_digit(this->lineno, 1000);
-+ add_digit(this->lineno, 100);
-+ add_digit(this->lineno, 10);
-+ add_digit(this->lineno, 1);
-+ add_char(' ');
-+ add_char('(');
-+ add_str(this->fnamep, this->fnameo);
-+ add_char(')');
-+ this->result[this->pos] = '\0';
-+
-+ print_result(stringof(this->result));
-+}
-+
-+probe /!at_evalframe(arg0)/
-+{
-+ NULL;
-+}
-diff --git Python-2.6.4/Python/python.d Python-2.6.4/Python/python.d
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/Python/python.d
-@@ -0,0 +1,10 @@
-+provider python {
-+ probe function__entry(const char *, const char *, int);
-+ probe function__return(const char *, const char *, int);
-+};
-+
-+#pragma D attributes Evolving/Evolving/Common provider python provider
-+#pragma D attributes Private/Private/Common provider python module
-+#pragma D attributes Private/Private/Common provider python function
-+#pragma D attributes Evolving/Evolving/Common provider python name
-+#pragma D attributes Evolving/Evolving/Common provider python args
--- a/components/python/python26/Python26-08-ctypes.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-diff --git Python-2.6.4/Modules/_ctypes/callproc.c Python-2.6.4/Modules/_ctypes/callproc.c
---- Python-2.6.4/Modules/_ctypes/callproc.c
-+++ Python-2.6.4/Modules/_ctypes/callproc.c
-@@ -73,6 +73,8 @@
- #include <malloc.h>
- #endif
-
-+#include <alloca.h>
-+
- #include <ffi.h>
- #include "ctypes.h"
-
-diff --git Python-2.6.4/Modules/_ctypes/libffi/src/x86/ffitarget.h Python-2.6.4/Modules/_ctypes/libffi/src/x86/ffitarget.h
---- Python-2.6.4/Modules/_ctypes/libffi/src/x86/ffitarget.h
-+++ Python-2.6.4/Modules/_ctypes/libffi/src/x86/ffitarget.h
-@@ -54,10 +54,10 @@
- #endif
-
- /* ---- Intel x86 and AMD x86-64 - */
--#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__))
-+#if !defined(X86_WIN32) && (defined(__i386__) || defined(__i386) || defined(__x86_64__))
- FFI_SYSV,
- FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */
--#ifdef __i386__
-+#if defined (__i386__) || defined (__i386)
- FFI_DEFAULT_ABI = FFI_SYSV,
- #else
- FFI_DEFAULT_ABI = FFI_UNIX64,
--- a/components/python/python26/Python26-09-ucred.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2427 +0,0 @@
-diff --git Python-2.6.4/Modules/ucred.c Python-2.6.4/Modules/ucred.c
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/Modules/ucred.c
-@@ -0,0 +1,391 @@
-+/*
-+ * Permission is hereby granted, free of charge, to any person obtaining a copy
-+ * of this software and associated documentation files (the "Software"), to
-+ * deal in the Software without restriction, including without limitation the
-+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-+ * sell copies of the Software, and to permit persons to whom the Software is
-+ * furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included in
-+ * all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ * DEALINGS IN THE SOFTWARE.
-+ *
-+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+#include <Python.h>
-+
-+#include <stdio.h>
-+#include <priv.h>
-+#include <ucred.h>
-+#include <ctype.h>
-+#include <tsol/label.h>
-+
-+typedef struct {
-+ PyObject_HEAD
-+ ucred_t *ucred;
-+} pyucred_t;
-+
-+#define pyucred_getlongid(name, type) \
-+ static PyObject * \
-+ pyucred_get##name(pyucred_t *uc) \
-+ { \
-+ type val; \
-+ \
-+ if (uc->ucred == NULL) { \
-+ errno = EINVAL; \
-+ PyErr_SetFromErrno(PyExc_OSError); \
-+ return (NULL); \
-+ } \
-+ \
-+ if ((val = ucred_get##name(uc->ucred)) == -1) { \
-+ PyErr_SetFromErrno(PyExc_OSError); \
-+ return (NULL); \
-+ } \
-+ \
-+ return (Py_BuildValue("l", (long)val)); \
-+ }
-+
-+pyucred_getlongid(euid, uid_t)
-+pyucred_getlongid(ruid, uid_t)
-+pyucred_getlongid(suid, uid_t)
-+pyucred_getlongid(egid, gid_t)
-+pyucred_getlongid(rgid, gid_t)
-+pyucred_getlongid(sgid, gid_t)
-+pyucred_getlongid(pid, pid_t)
-+pyucred_getlongid(projid, projid_t)
-+pyucred_getlongid(zoneid, zoneid_t)
-+
-+static PyObject *
-+pyucred_getgroups(pyucred_t *uc)
-+{
-+ const gid_t *groups;
-+ PyObject *list;
-+ int len;
-+ int i;
-+
-+ if (uc->ucred == NULL) {
-+ errno = EINVAL;
-+ PyErr_SetFromErrno(PyExc_OSError);
-+ return (NULL);
-+ }
-+
-+ if ((len = ucred_getgroups(uc->ucred, &groups)) == -1) {
-+ PyErr_SetFromErrno(PyExc_OSError);
-+ return (NULL);
-+ }
-+
-+ if ((list = PyList_New(len)) == NULL)
-+ return (NULL);
-+
-+ for (i = 0; i < len; i++) {
-+ PyObject *gid = Py_BuildValue("l", (long)groups[i]);
-+ if (PyList_SetItem(list, i, gid) == -1)
-+ return (NULL);
-+ }
-+
-+ return (list);
-+}
-+
-+static PyObject *
-+pyucred_getlabel(pyucred_t *uc)
-+{
-+ m_label_t *label;
-+ PyObject *ret;
-+ char *str;
-+
-+ if (uc->ucred == NULL) {
-+ errno = EINVAL;
-+ PyErr_SetFromErrno(PyExc_OSError);
-+ return (NULL);
-+ }
-+
-+ label = ucred_getlabel(uc->ucred);
-+ if (label == NULL)
-+ return (Py_BuildValue("s", ""));
-+
-+ if (label_to_str(label, &str, M_LABEL, DEF_NAMES) == -1) {
-+ PyErr_SetFromErrno(PyExc_OSError);
-+ return (NULL);
-+ }
-+
-+ ret = Py_BuildValue("s", str);
-+ free(str);
-+ return (ret);
-+}
-+
-+static PyObject *
-+pyucred_getpflags(pyucred_t *uc, PyObject *args, PyObject *kwargs)
-+{
-+ static char *kwlist[] = { "flags", NULL };
-+ uint_t flags;
-+
-+ if (uc->ucred == NULL) {
-+ errno = EINVAL;
-+ PyErr_SetFromErrno(PyExc_OSError);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist,
-+ &flags))
-+ return (NULL);
-+
-+ if ((flags = ucred_getpflags(uc->ucred, flags)) == (uint_t)-1) {
-+ PyErr_SetFromErrno(PyExc_OSError);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("i", flags));
-+}
-+
-+static PyObject *
-+pyucred_has_priv(pyucred_t *uc, PyObject *args, PyObject *kwargs)
-+{
-+ static char *kwlist[] = { "set", "priv", NULL };
-+ const priv_set_t *privs;
-+ const char *set;
-+ const char *priv;
-+
-+ if (uc->ucred == NULL) {
-+ errno = EINVAL;
-+ PyErr_SetFromErrno(PyExc_OSError);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ss", kwlist,
-+ &set, &priv))
-+ return (NULL);
-+
-+ if ((privs = ucred_getprivset(uc->ucred, set)) == NULL) {
-+ PyErr_SetFromErrno(PyExc_OSError);
-+ return (NULL);
-+ }
-+
-+ if (priv_ismember(privs, priv)) {
-+ Py_INCREF(Py_True);
-+ return Py_True;
-+ }
-+
-+ Py_INCREF(Py_False);
-+ return Py_False;
-+}
-+
-+PyDoc_STRVAR(pyucred_getlabel_doc,
-+ "getlabel() -> string\n"
-+ "\n"
-+ "Return the Trusted Extensions label string, or an "
-+ "empty string if not available. The label string is "
-+ "converted using the default name and M_LABEL (human-readable). "
-+ "Raises OSError. See label_to_str(3TSOL).");
-+PyDoc_STRVAR(pyucred_getpflags_doc,
-+ "getpflags(flags) -> int\n"
-+ "\n"
-+ "Return the values of the specified privilege flags.");
-+PyDoc_STRVAR(pyucred_has_priv_doc,
-+ "has_priv(set, priv) -> bool\n"
-+ "\n"
-+ "Return true if the given privilege is set in the "
-+ "specified set. Raises OSError if the set or privilege is "
-+ "invalid, or a problem occurs.\n"
-+ "\n"
-+ "Currently, the following privilege sets are defined, as "
-+ "described in privileges(5):\n"
-+ "\n"
-+ "Effective\n"
-+ "Permitted\n"
-+ "Inheritable\n"
-+ "Limit\n");
-+
-+static PyMethodDef pyucred_methods[] = {
-+ { "geteuid", (PyCFunction)pyucred_geteuid, METH_NOARGS,
-+ "Return the effective user ID." },
-+ { "getruid", (PyCFunction)pyucred_getruid, METH_NOARGS,
-+ "Return the real user ID." },
-+ { "getsuid", (PyCFunction)pyucred_getsuid, METH_NOARGS,
-+ "Return the saved user ID." },
-+ { "getegid", (PyCFunction)pyucred_getegid, METH_NOARGS,
-+ "Return the effective group ID." },
-+ { "getrgid", (PyCFunction)pyucred_getrgid, METH_NOARGS,
-+ "Return the real group ID." },
-+ { "getsgid", (PyCFunction)pyucred_getsgid, METH_NOARGS,
-+ "Return the saved group ID." },
-+ { "getpid", (PyCFunction)pyucred_getpid, METH_NOARGS,
-+ "Return the effective user ID." },
-+ { "getprojid", (PyCFunction)pyucred_getprojid, METH_NOARGS,
-+ "Return the project ID." },
-+ { "getzoneid", (PyCFunction)pyucred_getzoneid, METH_NOARGS,
-+ "Return the zone ID." },
-+ { "getgroups", (PyCFunction)pyucred_getgroups, METH_NOARGS,
-+ "Return a list of group IDs." },
-+ { "getlabel", (PyCFunction)pyucred_getlabel, METH_NOARGS,
-+ pyucred_getlabel_doc },
-+ { "getpflags", (PyCFunction)pyucred_getpflags,
-+ METH_VARARGS|METH_KEYWORDS, pyucred_getpflags_doc },
-+ { "has_priv", (PyCFunction)pyucred_has_priv,
-+ METH_VARARGS|METH_KEYWORDS, pyucred_has_priv_doc },
-+ { NULL }
-+};
-+
-+static int
-+pyucred_init(PyObject *self, PyObject *args, PyObject *kwargs)
-+{
-+ pyucred_t *uc = (pyucred_t *)self;
-+ uc->ucred = NULL;
-+ return (0);
-+}
-+
-+static void
-+pyucred_dealloc(PyObject *self)
-+{
-+ pyucred_t *uc = (pyucred_t *)self;
-+ if (uc->ucred != NULL)
-+ ucred_free(uc->ucred);
-+ self->ob_type->tp_free(self);
-+}
-+
-+static PyTypeObject pyucred_type = {
-+ PyObject_HEAD_INIT(NULL)
-+ 0, /*ob_size*/
-+ "ucred.ucred", /*tp_name*/
-+ sizeof (pyucred_t), /*tp_basicsize*/
-+ 0, /*tp_itemsize*/
-+ pyucred_dealloc, /*tp_dealloc*/
-+ 0, /*tp_print*/
-+ 0, /*tp_getattr*/
-+ 0, /*tp_setattr*/
-+ 0, /*tp_compare*/
-+ 0, /*tp_repr*/
-+ 0, /*tp_as_number*/
-+ 0, /*tp_as_sequence*/
-+ 0, /*tp_as_mapping*/
-+ 0, /*tp_hash */
-+ 0, /*tp_call*/
-+ 0, /*tp_str*/
-+ 0, /*tp_getattro*/
-+ 0, /*tp_setattro*/
-+ 0, /*tp_as_buffer*/
-+ Py_TPFLAGS_DEFAULT, /*tp_flags*/
-+ "user credentials", /*tp_doc */
-+ 0, /* tp_traverse */
-+ 0, /* tp_clear */
-+ 0, /* tp_richcompare */
-+ 0, /* tp_weaklistoffset */
-+ 0, /* tp_iter */
-+ 0, /* tp_iternext */
-+ pyucred_methods, /* tp_methods */
-+ 0, /* tp_members */
-+ 0, /* tp_getset */
-+ 0, /* tp_base */
-+ 0, /* tp_dict */
-+ 0, /* tp_descr_get */
-+ 0, /* tp_descr_set */
-+ 0, /* tp_dictoffset */
-+ (initproc)pyucred_init, /* tp_init */
-+ 0, /* tp_alloc */
-+ 0, /* tp_new */
-+};
-+
-+static PyObject *
-+pyucred_new(const ucred_t *uc)
-+{
-+ pyucred_t *self;
-+
-+ self = (pyucred_t *)PyObject_CallObject((PyObject *)&pyucred_type, NULL);
-+
-+ if (self == NULL)
-+ return (NULL);
-+
-+ self->ucred = (ucred_t *)uc;
-+
-+ return ((PyObject *)self);
-+}
-+
-+static PyObject *
-+pyucred_get(PyObject *o, PyObject *args, PyObject *kwargs)
-+{
-+ static char *kwlist[] = { "pid", NULL };
-+ ucred_t *ucred = NULL;
-+ int pid;
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist,
-+ &pid))
-+ return (NULL);
-+
-+ ucred = ucred_get(pid);
-+
-+ if (ucred == NULL) {
-+ PyErr_SetFromErrno(PyExc_OSError);
-+ return (NULL);
-+ }
-+
-+ return (pyucred_new(ucred));
-+}
-+
-+static PyObject *
-+pyucred_getpeer(PyObject *o, PyObject *args, PyObject *kwargs)
-+{
-+ static char *kwlist[] = { "fd", NULL };
-+ ucred_t *ucred = NULL;
-+ int fd;
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist,
-+ &fd))
-+ return (NULL);
-+
-+ if (getpeerucred(fd, &ucred) == -1) {
-+ PyErr_SetFromErrno(PyExc_OSError);
-+ return (NULL);
-+ }
-+
-+ return (pyucred_new(ucred));
-+}
-+
-+PyDoc_STRVAR(pyucred_get_doc,
-+ "get(pid) -> ucred\n"
-+ "\n"
-+ "Return the credentials of the specified process ID. "
-+ "Raises OSError. See ucred_get(3C).");
-+PyDoc_STRVAR(pyucred_getpeer_doc,
-+ "getpeer(fd) -> ucred\n"
-+ "\n"
-+ "Return the credentials of the peer endpoint of a "
-+ "connection-oriented socket (SOCK_STREAM) or STREAM fd "
-+ "at the time the endpoint was created or the connection "
-+ "was established. Raises OSError. See getpeerucred(3C).");
-+
-+static struct PyMethodDef pyucred_module_methods[] = {
-+ { "get", (PyCFunction) pyucred_get,
-+ METH_VARARGS|METH_KEYWORDS, pyucred_get_doc },
-+ { "getpeer", (PyCFunction) pyucred_getpeer,
-+ METH_VARARGS|METH_KEYWORDS, pyucred_getpeer_doc },
-+ { NULL, NULL, 0, NULL }
-+};
-+
-+PyDoc_STRVAR(pyucred_module_doc,
-+ "This module provides an interface to the user credential access "
-+ "methods, obtainable either by process ID or file descriptor.");
-+
-+PyMODINIT_FUNC
-+initucred(void)
-+{
-+ PyObject *m;
-+
-+ m = Py_InitModule3("ucred", pyucred_module_methods,
-+ pyucred_module_doc);
-+
-+ pyucred_type.tp_new = PyType_GenericNew;
-+ if (PyType_Ready(&pyucred_type) < 0)
-+ return;
-+
-+ Py_INCREF(&pyucred_type);
-+
-+ PyModule_AddObject(m, "ucred", (PyObject *)&pyucred_type);
-+}
-diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
---- Python-2.6.4/setup.py
-+++ Python-2.6.4/setup.py
-@@ -1277,6 +1277,13 @@
- else:
- missing.append('dl')
-
-+ # ucred module (Solaris)
-+ ucred_inc = find_file('ucred.h', [], inc_dirs)
-+ tsol_inc = find_file('tsol/label.h', [], inc_dirs)
-+ if ucred_inc is not None and tsol_inc is not None:
-+ exts.append( Extension('ucred', ['ucred.c'],
-+ libraries = ['tsol']) )
-+
- # Thomas Heller's _ctypes module
- self.detect_ctypes(inc_dirs, lib_dirs)
-
-diff --git Python-2.6.4/setup.py.orig Python-2.6.4/setup.py.orig
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/setup.py.orig
-@@ -0,0 +1,1958 @@
-+# Autodetecting setup.py script for building the Python extensions
-+#
-+
-+__version__ = "$Revision: 75282 $"
-+
-+import sys, os, imp, re, optparse
-+from glob import glob
-+from platform import machine as platform_machine
-+
-+from distutils import log
-+from distutils import sysconfig
-+from distutils import text_file
-+from distutils.errors import *
-+from distutils.core import Extension, setup
-+from distutils.command.build_ext import build_ext
-+from distutils.command.install import install
-+from distutils.command.install_lib import install_lib
-+
-+# This global variable is used to hold the list of modules to be disabled.
-+disabled_module_list = []
-+
-+def add_dir_to_list(dirlist, dir):
-+ """Add the directory 'dir' to the list 'dirlist' (at the front) if
-+ 1) 'dir' is not already in 'dirlist'
-+ 2) 'dir' actually exists, and is a directory."""
-+ if dir is not None and os.path.isdir(dir) and dir not in dirlist:
-+ dirlist.insert(0, dir)
-+
-+def find_file(filename, std_dirs, paths):
-+ """Searches for the directory where a given file is located,
-+ and returns a possibly-empty list of additional directories, or None
-+ if the file couldn't be found at all.
-+
-+ 'filename' is the name of a file, such as readline.h or libcrypto.a.
-+ 'std_dirs' is the list of standard system directories; if the
-+ file is found in one of them, no additional directives are needed.
-+ 'paths' is a list of additional locations to check; if the file is
-+ found in one of them, the resulting list will contain the directory.
-+ """
-+
-+ # Check the standard locations
-+ for dir in std_dirs:
-+ f = os.path.join(dir, filename)
-+ if os.path.exists(f): return []
-+
-+ # Check the additional directories
-+ for dir in paths:
-+ f = os.path.join(dir, filename)
-+ if os.path.exists(f):
-+ return [dir]
-+
-+ # Not found anywhere
-+ return None
-+
-+def find_library_file(compiler, libname, std_dirs, paths):
-+ result = compiler.find_library_file(std_dirs + paths, libname)
-+ if result is None:
-+ return None
-+
-+ # Check whether the found file is in one of the standard directories
-+ dirname = os.path.dirname(result)
-+ for p in std_dirs:
-+ # Ensure path doesn't end with path separator
-+ p = p.rstrip(os.sep)
-+ if p == dirname:
-+ return [ ]
-+
-+ # Otherwise, it must have been in one of the additional directories,
-+ # so we have to figure out which one.
-+ for p in paths:
-+ # Ensure path doesn't end with path separator
-+ p = p.rstrip(os.sep)
-+ if p == dirname:
-+ return [p]
-+ else:
-+ assert False, "Internal error: Path not found in std_dirs or paths"
-+
-+def module_enabled(extlist, modname):
-+ """Returns whether the module 'modname' is present in the list
-+ of extensions 'extlist'."""
-+ extlist = [ext for ext in extlist if ext.name == modname]
-+ return len(extlist)
-+
-+def find_module_file(module, dirlist):
-+ """Find a module in a set of possible folders. If it is not found
-+ return the unadorned filename"""
-+ list = find_file(module, [], dirlist)
-+ if not list:
-+ return module
-+ if len(list) > 1:
-+ log.info("WARNING: multiple copies of %s found"%module)
-+ return os.path.join(list[0], module)
-+
-+class PyBuildExt(build_ext):
-+
-+ def __init__(self, dist):
-+ build_ext.__init__(self, dist)
-+ self.failed = []
-+
-+ def build_extensions(self):
-+
-+ # Detect which modules should be compiled
-+ missing = self.detect_modules()
-+
-+ # Remove modules that are present on the disabled list
-+ extensions = [ext for ext in self.extensions
-+ if ext.name not in disabled_module_list]
-+ # move ctypes to the end, it depends on other modules
-+ ext_map = dict((ext.name, i) for i, ext in enumerate(extensions))
-+ if "_ctypes" in ext_map:
-+ ctypes = extensions.pop(ext_map["_ctypes"])
-+ extensions.append(ctypes)
-+ self.extensions = extensions
-+
-+ # Fix up the autodetected modules, prefixing all the source files
-+ # with Modules/ and adding Python's include directory to the path.
-+ (srcdir,) = sysconfig.get_config_vars('srcdir')
-+ if not srcdir:
-+ # Maybe running on Windows but not using CYGWIN?
-+ raise ValueError("No source directory; cannot proceed.")
-+
-+ # Figure out the location of the source code for extension modules
-+ # (This logic is copied in distutils.test.test_sysconfig,
-+ # so building in a separate directory does not break test_distutils.)
-+ moddir = os.path.join(os.getcwd(), srcdir, 'Modules')
-+ moddir = os.path.normpath(moddir)
-+ srcdir, tail = os.path.split(moddir)
-+ srcdir = os.path.normpath(srcdir)
-+ moddir = os.path.normpath(moddir)
-+
-+ moddirlist = [moddir]
-+ incdirlist = ['./Include']
-+
-+ # Platform-dependent module source and include directories
-+ platform = self.get_platform()
-+ if platform in ('darwin', 'mac') and ("--disable-toolbox-glue" not in
-+ sysconfig.get_config_var("CONFIG_ARGS")):
-+ # Mac OS X also includes some mac-specific modules
-+ macmoddir = os.path.join(os.getcwd(), srcdir, 'Mac/Modules')
-+ moddirlist.append(macmoddir)
-+ incdirlist.append('./Mac/Include')
-+
-+ alldirlist = moddirlist + incdirlist
-+
-+ # Fix up the paths for scripts, too
-+ self.distribution.scripts = [os.path.join(srcdir, filename)
-+ for filename in self.distribution.scripts]
-+
-+ # Python header files
-+ headers = glob("Include/*.h") + ["pyconfig.h"]
-+
-+ for ext in self.extensions[:]:
-+ ext.sources = [ find_module_file(filename, moddirlist)
-+ for filename in ext.sources ]
-+ if ext.depends is not None:
-+ ext.depends = [find_module_file(filename, alldirlist)
-+ for filename in ext.depends]
-+ else:
-+ ext.depends = []
-+ # re-compile extensions if a header file has been changed
-+ ext.depends.extend(headers)
-+
-+ ext.include_dirs.append( '.' ) # to get config.h
-+ for incdir in incdirlist:
-+ ext.include_dirs.append( os.path.join(srcdir, incdir) )
-+
-+ # If a module has already been built statically,
-+ # don't build it here
-+ if ext.name in sys.builtin_module_names:
-+ self.extensions.remove(ext)
-+
-+ if platform != 'mac':
-+ # Parse Modules/Setup and Modules/Setup.local to figure out which
-+ # modules are turned on in the file.
-+ remove_modules = []
-+ for filename in ('Modules/Setup', 'Modules/Setup.local'):
-+ input = text_file.TextFile(filename, join_lines=1)
-+ while 1:
-+ line = input.readline()
-+ if not line: break
-+ line = line.split()
-+ remove_modules.append(line[0])
-+ input.close()
-+
-+ for ext in self.extensions[:]:
-+ if ext.name in remove_modules:
-+ self.extensions.remove(ext)
-+
-+ # When you run "make CC=altcc" or something similar, you really want
-+ # those environment variables passed into the setup.py phase. Here's
-+ # a small set of useful ones.
-+ compiler = os.environ.get('CC')
-+ args = {}
-+ # unfortunately, distutils doesn't let us provide separate C and C++
-+ # compilers
-+ if compiler is not None:
-+ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
-+ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
-+ self.compiler.set_executables(**args)
-+
-+ build_ext.build_extensions(self)
-+
-+ longest = max([len(e.name) for e in self.extensions])
-+ if self.failed:
-+ longest = max(longest, max([len(name) for name in self.failed]))
-+
-+ def print_three_column(lst):
-+ lst.sort(key=str.lower)
-+ # guarantee zip() doesn't drop anything
-+ while len(lst) % 3:
-+ lst.append("")
-+ for e, f, g in zip(lst[::3], lst[1::3], lst[2::3]):
-+ print "%-*s %-*s %-*s" % (longest, e, longest, f,
-+ longest, g)
-+
-+ if missing:
-+ print
-+ print "Failed to find the necessary bits to build these modules:"
-+ print_three_column(missing)
-+ print ("To find the necessary bits, look in setup.py in"
-+ " detect_modules() for the module's name.")
-+ print
-+
-+ if self.failed:
-+ failed = self.failed[:]
-+ print
-+ print "Failed to build these modules:"
-+ print_three_column(failed)
-+ print
-+
-+ def build_extension(self, ext):
-+
-+ if ext.name == '_ctypes':
-+ if not self.configure_ctypes(ext):
-+ return
-+
-+ try:
-+ build_ext.build_extension(self, ext)
-+ except (CCompilerError, DistutilsError), why:
-+ self.announce('WARNING: building of extension "%s" failed: %s' %
-+ (ext.name, sys.exc_info()[1]))
-+ self.failed.append(ext.name)
-+ return
-+ # Workaround for Mac OS X: The Carbon-based modules cannot be
-+ # reliably imported into a command-line Python
-+ if 'Carbon' in ext.extra_link_args:
-+ self.announce(
-+ 'WARNING: skipping import check for Carbon-based "%s"' %
-+ ext.name)
-+ return
-+
-+ if self.get_platform() == 'darwin' and (
-+ sys.maxint > 2**32 and '-arch' in ext.extra_link_args):
-+ # Don't bother doing an import check when an extension was
-+ # build with an explicit '-arch' flag on OSX. That's currently
-+ # only used to build 32-bit only extensions in a 4-way
-+ # universal build and loading 32-bit code into a 64-bit
-+ # process will fail.
-+ self.announce(
-+ 'WARNING: skipping import check for "%s"' %
-+ ext.name)
-+ return
-+
-+ # Workaround for Cygwin: Cygwin currently has fork issues when many
-+ # modules have been imported
-+ if self.get_platform() == 'cygwin':
-+ self.announce('WARNING: skipping import check for Cygwin-based "%s"'
-+ % ext.name)
-+ return
-+ ext_filename = os.path.join(
-+ self.build_lib,
-+ self.get_ext_filename(self.get_ext_fullname(ext.name)))
-+ try:
-+ imp.load_dynamic(ext.name, ext_filename)
-+ except ImportError, why:
-+ self.failed.append(ext.name)
-+ self.announce('*** WARNING: renaming "%s" since importing it'
-+ ' failed: %s' % (ext.name, why), level=3)
-+ assert not self.inplace
-+ basename, tail = os.path.splitext(ext_filename)
-+ newname = basename + "_failed" + tail
-+ if os.path.exists(newname):
-+ os.remove(newname)
-+ os.rename(ext_filename, newname)
-+
-+ # XXX -- This relies on a Vile HACK in
-+ # distutils.command.build_ext.build_extension(). The
-+ # _built_objects attribute is stored there strictly for
-+ # use here.
-+ # If there is a failure, _built_objects may not be there,
-+ # so catch the AttributeError and move on.
-+ try:
-+ for filename in self._built_objects:
-+ os.remove(filename)
-+ except AttributeError:
-+ self.announce('unable to remove files (ignored)')
-+ except:
-+ exc_type, why, tb = sys.exc_info()
-+ self.announce('*** WARNING: importing extension "%s" '
-+ 'failed with %s: %s' % (ext.name, exc_type, why),
-+ level=3)
-+ self.failed.append(ext.name)
-+
-+ def get_platform(self):
-+ # Get value of sys.platform
-+ for platform in ['cygwin', 'beos', 'darwin', 'atheos', 'osf1']:
-+ if sys.platform.startswith(platform):
-+ return platform
-+ return sys.platform
-+
-+ def detect_modules(self):
-+ if sys.platform != 'sunos5':
-+ # Ensure that /usr/local is always used
-+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
-+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
-+ # Add paths specified in the environment variables LDFLAGS and
-+ # CPPFLAGS for header and library files.
-+ # We must get the values from the Makefile and not the environment
-+ # directly since an inconsistently reproducible issue comes up where
-+ # the environment variable is not set even though the value were passed
-+ # into configure and stored in the Makefile (issue found on OS X 10.3).
-+ for env_var, arg_name, dir_list in (
-+ ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
-+ ('LDFLAGS', '-L', self.compiler.library_dirs),
-+ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
-+ env_val = sysconfig.get_config_var(env_var)
-+ if env_val:
-+ # To prevent optparse from raising an exception about any
-+ # options in env_val that it doesn't know about we strip out
-+ # all double dashes and any dashes followed by a character
-+ # that is not for the option we are dealing with.
-+ #
-+ # Please note that order of the regex is important! We must
-+ # strip out double-dashes first so that we don't end up with
-+ # substituting "--Long" to "-Long" and thus lead to "ong" being
-+ # used for a library directory.
-+ env_val = re.sub(r'(^|\s+)-(-|(?!%s))' % arg_name[1],
-+ ' ', env_val)
-+ parser = optparse.OptionParser()
-+ # Make sure that allowing args interspersed with options is
-+ # allowed
-+ parser.allow_interspersed_args = True
-+ parser.error = lambda msg: None
-+ parser.add_option(arg_name, dest="dirs", action="append")
-+ options = parser.parse_args(env_val.split())[0]
-+ if options.dirs:
-+ for directory in reversed(options.dirs):
-+ add_dir_to_list(dir_list, directory)
-+
-+ if os.path.normpath(sys.prefix) != '/usr':
-+ add_dir_to_list(self.compiler.library_dirs,
-+ sysconfig.get_config_var("LIBDIR"))
-+ add_dir_to_list(self.compiler.include_dirs,
-+ sysconfig.get_config_var("INCLUDEDIR"))
-+
-+ try:
-+ have_unicode = unicode
-+ except NameError:
-+ have_unicode = 0
-+
-+ # lib_dirs and inc_dirs are used to search for files;
-+ # if a file is found in one of those directories, it can
-+ # be assumed that no additional -I,-L directives are needed.
-+ lib_dirs = self.compiler.library_dirs + [
-+ '/lib64', '/usr/lib64',
-+ '/lib', '/usr/lib',
-+ ]
-+ inc_dirs = self.compiler.include_dirs + ['/usr/include']
-+ exts = []
-+ missing = []
-+
-+ config_h = sysconfig.get_config_h_filename()
-+ config_h_vars = sysconfig.parse_config_h(open(config_h))
-+
-+ platform = self.get_platform()
-+ (srcdir,) = sysconfig.get_config_vars('srcdir')
-+
-+ # Check for AtheOS which has libraries in non-standard locations
-+ if platform == 'atheos':
-+ lib_dirs += ['/system/libs', '/atheos/autolnk/lib']
-+ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
-+ inc_dirs += ['/system/include', '/atheos/autolnk/include']
-+ inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
-+
-+ # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
-+ if platform in ['osf1', 'unixware7', 'openunix8']:
-+ lib_dirs += ['/usr/ccs/lib']
-+
-+ if platform == 'darwin':
-+ # This should work on any unixy platform ;-)
-+ # If the user has bothered specifying additional -I and -L flags
-+ # in OPT and LDFLAGS we might as well use them here.
-+ # NOTE: using shlex.split would technically be more correct, but
-+ # also gives a bootstrap problem. Let's hope nobody uses directories
-+ # with whitespace in the name to store libraries.
-+ cflags, ldflags = sysconfig.get_config_vars(
-+ 'CFLAGS', 'LDFLAGS')
-+ for item in cflags.split():
-+ if item.startswith('-I'):
-+ inc_dirs.append(item[2:])
-+
-+ for item in ldflags.split():
-+ if item.startswith('-L'):
-+ lib_dirs.append(item[2:])
-+
-+ # Check for MacOS X, which doesn't need libm.a at all
-+ math_libs = ['m']
-+ if platform in ['darwin', 'beos', 'mac']:
-+ math_libs = []
-+
-+ # XXX Omitted modules: gl, pure, dl, SGI-specific modules
-+
-+ #
-+ # The following modules are all pretty straightforward, and compile
-+ # on pretty much any POSIXish platform.
-+ #
-+
-+ # Some modules that are normally always on:
-+ exts.append( Extension('_weakref', ['_weakref.c']) )
-+
-+ # array objects
-+ exts.append( Extension('array', ['arraymodule.c']) )
-+ # complex math library functions
-+ exts.append( Extension('cmath', ['cmathmodule.c'],
-+ libraries=math_libs) )
-+
-+ # math library functions, e.g. sin()
-+ exts.append( Extension('math', ['mathmodule.c'],
-+ libraries=math_libs) )
-+ # fast string operations implemented in C
-+ exts.append( Extension('strop', ['stropmodule.c']) )
-+ # time operations and variables
-+ exts.append( Extension('time', ['timemodule.c'],
-+ libraries=math_libs) )
-+ exts.append( Extension('datetime', ['datetimemodule.c', 'timemodule.c'],
-+ libraries=math_libs) )
-+ # fast iterator tools implemented in C
-+ exts.append( Extension("itertools", ["itertoolsmodule.c"]) )
-+ # code that will be builtins in the future, but conflict with the
-+ # current builtins
-+ exts.append( Extension('future_builtins', ['future_builtins.c']) )
-+ # random number generator implemented in C
-+ exts.append( Extension("_random", ["_randommodule.c"]) )
-+ # high-performance collections
-+ exts.append( Extension("_collections", ["_collectionsmodule.c"]) )
-+ # bisect
-+ exts.append( Extension("_bisect", ["_bisectmodule.c"]) )
-+ # heapq
-+ exts.append( Extension("_heapq", ["_heapqmodule.c"]) )
-+ # operator.add() and similar goodies
-+ exts.append( Extension('operator', ['operator.c']) )
-+ # Python 3.0 _fileio module
-+ exts.append( Extension("_fileio", ["_fileio.c"]) )
-+ # Python 3.0 _bytesio module
-+ exts.append( Extension("_bytesio", ["_bytesio.c"]) )
-+ # _functools
-+ exts.append( Extension("_functools", ["_functoolsmodule.c"]) )
-+ # _json speedups
-+ exts.append( Extension("_json", ["_json.c"]) )
-+ # Python C API test module
-+ exts.append( Extension('_testcapi', ['_testcapimodule.c'],
-+ depends=['testcapi_long.h']) )
-+ # profilers (_lsprof is for cProfile.py)
-+ exts.append( Extension('_hotshot', ['_hotshot.c']) )
-+ exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) )
-+ # static Unicode character database
-+ if have_unicode:
-+ exts.append( Extension('unicodedata', ['unicodedata.c']) )
-+ else:
-+ missing.append('unicodedata')
-+ # access to ISO C locale support
-+ data = open('pyconfig.h').read()
-+ m = re.search(r"#s*define\s+WITH_LIBINTL\s+1\s*", data)
-+ if m is not None:
-+ locale_libs = ['intl']
-+ else:
-+ locale_libs = []
-+ if platform == 'darwin':
-+ locale_extra_link_args = ['-framework', 'CoreFoundation']
-+ else:
-+ locale_extra_link_args = []
-+
-+
-+ exts.append( Extension('_locale', ['_localemodule.c'],
-+ libraries=locale_libs,
-+ extra_link_args=locale_extra_link_args) )
-+
-+ # Modules with some UNIX dependencies -- on by default:
-+ # (If you have a really backward UNIX, select and socket may not be
-+ # supported...)
-+
-+ # fcntl(2) and ioctl(2)
-+ exts.append( Extension('fcntl', ['fcntlmodule.c']) )
-+ if platform not in ['mac']:
-+ # pwd(3)
-+ exts.append( Extension('pwd', ['pwdmodule.c']) )
-+ # grp(3)
-+ exts.append( Extension('grp', ['grpmodule.c']) )
-+ # spwd, shadow passwords
-+ if (config_h_vars.get('HAVE_GETSPNAM', False) or
-+ config_h_vars.get('HAVE_GETSPENT', False)):
-+ exts.append( Extension('spwd', ['spwdmodule.c']) )
-+ else:
-+ missing.append('spwd')
-+ else:
-+ missing.extend(['pwd', 'grp', 'spwd'])
-+
-+ # select(2); not on ancient System V
-+ exts.append( Extension('select', ['selectmodule.c']) )
-+
-+ # Fred Drake's interface to the Python parser
-+ exts.append( Extension('parser', ['parsermodule.c']) )
-+
-+ # cStringIO and cPickle
-+ exts.append( Extension('cStringIO', ['cStringIO.c']) )
-+ exts.append( Extension('cPickle', ['cPickle.c']) )
-+
-+ # Memory-mapped files (also works on Win32).
-+ if platform not in ['atheos', 'mac']:
-+ exts.append( Extension('mmap', ['mmapmodule.c']) )
-+ else:
-+ missing.append('mmap')
-+
-+ # Lance Ellinghaus's syslog module
-+ if platform not in ['mac']:
-+ # syslog daemon interface
-+ exts.append( Extension('syslog', ['syslogmodule.c']) )
-+ else:
-+ missing.append('syslog')
-+
-+ # George Neville-Neil's timing module:
-+ # Deprecated in PEP 4 http://www.python.org/peps/pep-0004.html
-+ # http://mail.python.org/pipermail/python-dev/2006-January/060023.html
-+ #exts.append( Extension('timing', ['timingmodule.c']) )
-+
-+ #
-+ # Here ends the simple stuff. From here on, modules need certain
-+ # libraries, are platform-specific, or present other surprises.
-+ #
-+
-+ # Multimedia modules
-+ # These don't work for 64-bit platforms!!!
-+ # These represent audio samples or images as strings:
-+
-+ # Operations on audio samples
-+ # According to #993173, this one should actually work fine on
-+ # 64-bit platforms.
-+ exts.append( Extension('audioop', ['audioop.c']) )
-+
-+ # Disabled on 64-bit platforms
-+ if sys.maxint != 9223372036854775807L:
-+ # Operations on images
-+ exts.append( Extension('imageop', ['imageop.c']) )
-+ else:
-+ missing.extend(['imageop'])
-+
-+ # readline
-+ do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
-+ if platform == 'darwin': # and os.uname()[2] < '9.':
-+ # MacOSX 10.4 has a broken readline. Don't try to build
-+ # the readline module unless the user has installed a fixed
-+ # readline package
-+ # FIXME: The readline emulation on 10.5 is better, but the
-+ # readline module doesn't compile out of the box.
-+ if find_file('readline/rlconf.h', inc_dirs, []) is None:
-+ do_readline = False
-+ if do_readline:
-+ if sys.platform == 'darwin':
-+ # In every directory on the search path search for a dynamic
-+ # library and then a static library, instead of first looking
-+ # for dynamic libraries on the entiry path.
-+ # This way a staticly linked custom readline gets picked up
-+ # before the (broken) dynamic library in /usr/lib.
-+ readline_extra_link_args = ('-Wl,-search_paths_first',)
-+ else:
-+ readline_extra_link_args = ()
-+
-+ readline_libs = ['readline']
-+ if self.compiler.find_library_file(lib_dirs,
-+ 'ncursesw'):
-+ readline_libs.append('ncursesw')
-+ elif self.compiler.find_library_file(lib_dirs,
-+ 'ncurses'):
-+ readline_libs.append('ncurses')
-+ elif self.compiler.find_library_file(lib_dirs, 'curses'):
-+ readline_libs.append('curses')
-+ elif self.compiler.find_library_file(lib_dirs +
-+ ['/usr/lib/termcap'],
-+ 'termcap'):
-+ readline_libs.append('termcap')
-+ exts.append( Extension('readline', ['readline.c'],
-+ library_dirs=['/usr/lib/termcap'],
-+ extra_link_args=readline_extra_link_args,
-+ libraries=readline_libs) )
-+ else:
-+ missing.append('readline')
-+
-+ if platform not in ['mac']:
-+ # crypt module.
-+
-+ if self.compiler.find_library_file(lib_dirs, 'crypt'):
-+ libs = ['crypt']
-+ else:
-+ libs = []
-+ exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
-+ else:
-+ missing.append('crypt')
-+
-+ # CSV files
-+ exts.append( Extension('_csv', ['_csv.c']) )
-+
-+ # socket(2)
-+ socket_libs = []
-+ if self.compiler.find_library_file(lib_dirs,
-+ 'socket'):
-+ socket_libs.append('socket')
-+ if self.compiler.find_library_file(lib_dirs,
-+ 'nsl'):
-+ socket_libs.append('nsl')
-+ if self.compiler.find_library_file(lib_dirs,
-+ 'resolv'):
-+ socket_libs.append('resolv')
-+ exts.append( Extension('_socket', ['socketmodule.c'],
-+ depends = ['socketmodule.h'],
-+ libraries = socket_libs) )
-+ # Detect SSL support for the socket module (via _ssl)
-+ search_for_ssl_incs_in = [
-+ '/usr/sfw/include',
-+ '/usr/contrib/ssl/include/'
-+ ]
-+ ssl_incs = find_file('openssl/ssl.h', inc_dirs,
-+ search_for_ssl_incs_in
-+ )
-+ if ssl_incs is not None:
-+ krb5_h = find_file('krb5.h', inc_dirs,
-+ ['/usr/kerberos/include'])
-+ if krb5_h:
-+ ssl_incs += krb5_h
-+ if sys.maxint == 2147483647L:
-+ sfw_libdir = '/usr/sfw/lib';
-+ else:
-+ sfw_libdir = '/usr/sfw/lib/64';
-+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-+ [sfw_libdir,
-+ '/usr/contrib/ssl/lib/'
-+ ] )
-+
-+ if (ssl_incs is not None and
-+ ssl_libs is not None):
-+ exts.append( Extension('_ssl', ['_ssl.c'],
-+ include_dirs = ssl_incs,
-+ library_dirs = ssl_libs,
-+ runtime_library_dirs = ssl_libs,
-+ libraries = ['ssl', 'crypto'],
-+ depends = ['socketmodule.h']), )
-+ else:
-+ missing.append('_ssl')
-+
-+ # find out which version of OpenSSL we have
-+ openssl_ver = 0
-+ openssl_ver_re = re.compile(
-+ '^\s*#\s*define\s+OPENSSL_VERSION_NUMBER\s+(0x[0-9a-fA-F]+)' )
-+ for ssl_inc_dir in inc_dirs + search_for_ssl_incs_in:
-+ name = os.path.join(ssl_inc_dir, 'openssl', 'opensslv.h')
-+ if os.path.isfile(name):
-+ try:
-+ incfile = open(name, 'r')
-+ for line in incfile:
-+ m = openssl_ver_re.match(line)
-+ if m:
-+ openssl_ver = eval(m.group(1))
-+ break
-+ except IOError:
-+ pass
-+
-+ # first version found is what we'll use (as the compiler should)
-+ if openssl_ver:
-+ break
-+
-+ #print 'openssl_ver = 0x%08x' % openssl_ver
-+
-+ if (ssl_incs is not None and
-+ ssl_libs is not None and
-+ openssl_ver >= 0x00907000):
-+ # The _hashlib module wraps optimized implementations
-+ # of hash functions from the OpenSSL library.
-+ exts.append( Extension('_hashlib', ['_hashopenssl.c'],
-+ include_dirs = ssl_incs,
-+ library_dirs = ssl_libs,
-+ libraries = ['ssl', 'crypto']) )
-+ # these aren't strictly missing since they are unneeded.
-+ #missing.extend(['_sha', '_md5'])
-+ else:
-+ # The _sha module implements the SHA1 hash algorithm.
-+ exts.append( Extension('_sha', ['shamodule.c']) )
-+ # The _md5 module implements the RSA Data Security, Inc. MD5
-+ # Message-Digest Algorithm, described in RFC 1321. The
-+ # necessary files md5.c and md5.h are included here.
-+ exts.append( Extension('_md5',
-+ sources = ['md5module.c', 'md5.c'],
-+ depends = ['md5.h']) )
-+ missing.append('_hashlib')
-+
-+ if (openssl_ver < 0x00908000):
-+ # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
-+ exts.append( Extension('_sha256', ['sha256module.c']) )
-+ exts.append( Extension('_sha512', ['sha512module.c']) )
-+
-+ # Modules that provide persistent dictionary-like semantics. You will
-+ # probably want to arrange for at least one of them to be available on
-+ # your machine, though none are defined by default because of library
-+ # dependencies. The Python module anydbm.py provides an
-+ # implementation independent wrapper for these; dumbdbm.py provides
-+ # similar functionality (but slower of course) implemented in Python.
-+
-+ # Sleepycat^WOracle Berkeley DB interface.
-+ # http://www.oracle.com/database/berkeley-db/db/index.html
-+ #
-+ # This requires the Sleepycat^WOracle DB code. The supported versions
-+ # are set below. Visit the URL above to download
-+ # a release. Most open source OSes come with one or more
-+ # versions of BerkeleyDB already installed.
-+
-+ max_db_ver = (4, 7)
-+ min_db_ver = (3, 3)
-+ db_setup_debug = False # verbose debug prints from this script?
-+
-+ def allow_db_ver(db_ver):
-+ """Returns a boolean if the given BerkeleyDB version is acceptable.
-+
-+ Args:
-+ db_ver: A tuple of the version to verify.
-+ """
-+ if not (min_db_ver <= db_ver <= max_db_ver):
-+ return False
-+ # Use this function to filter out known bad configurations.
-+ if (4, 6) == db_ver[:2]:
-+ # BerkeleyDB 4.6.x is not stable on many architectures.
-+ arch = platform_machine()
-+ if arch not in ('i386', 'i486', 'i586', 'i686',
-+ 'x86_64', 'ia64'):
-+ return False
-+ return True
-+
-+ def gen_db_minor_ver_nums(major):
-+ if major == 4:
-+ for x in range(max_db_ver[1]+1):
-+ if allow_db_ver((4, x)):
-+ yield x
-+ elif major == 3:
-+ for x in (3,):
-+ if allow_db_ver((3, x)):
-+ yield x
-+ else:
-+ raise ValueError("unknown major BerkeleyDB version", major)
-+
-+ # construct a list of paths to look for the header file in on
-+ # top of the normal inc_dirs.
-+ db_inc_paths = [
-+ '/usr/include/db4',
-+ '/usr/local/include/db4',
-+ '/opt/sfw/include/db4',
-+ '/usr/include/db3',
-+ '/usr/local/include/db3',
-+ '/opt/sfw/include/db3',
-+ # Fink defaults (http://fink.sourceforge.net/)
-+ '/sw/include/db4',
-+ '/sw/include/db3',
-+ ]
-+ # 4.x minor number specific paths
-+ for x in gen_db_minor_ver_nums(4):
-+ db_inc_paths.append('/usr/include/db4%d' % x)
-+ db_inc_paths.append('/usr/include/db4.%d' % x)
-+ db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
-+ db_inc_paths.append('/usr/local/include/db4%d' % x)
-+ db_inc_paths.append('/pkg/db-4.%d/include' % x)
-+ db_inc_paths.append('/opt/db-4.%d/include' % x)
-+ # MacPorts default (http://www.macports.org/)
-+ db_inc_paths.append('/opt/local/include/db4%d' % x)
-+ # 3.x minor number specific paths
-+ for x in gen_db_minor_ver_nums(3):
-+ db_inc_paths.append('/usr/include/db3%d' % x)
-+ db_inc_paths.append('/usr/local/BerkeleyDB.3.%d/include' % x)
-+ db_inc_paths.append('/usr/local/include/db3%d' % x)
-+ db_inc_paths.append('/pkg/db-3.%d/include' % x)
-+ db_inc_paths.append('/opt/db-3.%d/include' % x)
-+
-+ # Add some common subdirectories for Sleepycat DB to the list,
-+ # based on the standard include directories. This way DB3/4 gets
-+ # picked up when it is installed in a non-standard prefix and
-+ # the user has added that prefix into inc_dirs.
-+ std_variants = []
-+ for dn in inc_dirs:
-+ std_variants.append(os.path.join(dn, 'db3'))
-+ std_variants.append(os.path.join(dn, 'db4'))
-+ for x in gen_db_minor_ver_nums(4):
-+ std_variants.append(os.path.join(dn, "db4%d"%x))
-+ std_variants.append(os.path.join(dn, "db4.%d"%x))
-+ for x in gen_db_minor_ver_nums(3):
-+ std_variants.append(os.path.join(dn, "db3%d"%x))
-+ std_variants.append(os.path.join(dn, "db3.%d"%x))
-+
-+ db_inc_paths = std_variants + db_inc_paths
-+ db_inc_paths = [p for p in db_inc_paths if os.path.exists(p)]
-+
-+ db_ver_inc_map = {}
-+
-+ class db_found(Exception): pass
-+ try:
-+ # See whether there is a Sleepycat header in the standard
-+ # search path.
-+ for d in inc_dirs + db_inc_paths:
-+ f = os.path.join(d, "db.h")
-+ if db_setup_debug: print "db: looking for db.h in", f
-+ if os.path.exists(f):
-+ f = open(f).read()
-+ m = re.search(r"#define\WDB_VERSION_MAJOR\W(\d+)", f)
-+ if m:
-+ db_major = int(m.group(1))
-+ m = re.search(r"#define\WDB_VERSION_MINOR\W(\d+)", f)
-+ db_minor = int(m.group(1))
-+ db_ver = (db_major, db_minor)
-+
-+ # Avoid 4.6 prior to 4.6.21 due to a BerkeleyDB bug
-+ if db_ver == (4, 6):
-+ m = re.search(r"#define\WDB_VERSION_PATCH\W(\d+)", f)
-+ db_patch = int(m.group(1))
-+ if db_patch < 21:
-+ print "db.h:", db_ver, "patch", db_patch,
-+ print "being ignored (4.6.x must be >= 4.6.21)"
-+ continue
-+
-+ if ( (not db_ver_inc_map.has_key(db_ver)) and
-+ allow_db_ver(db_ver) ):
-+ # save the include directory with the db.h version
-+ # (first occurrence only)
-+ db_ver_inc_map[db_ver] = d
-+ if db_setup_debug:
-+ print "db.h: found", db_ver, "in", d
-+ else:
-+ # we already found a header for this library version
-+ if db_setup_debug: print "db.h: ignoring", d
-+ else:
-+ # ignore this header, it didn't contain a version number
-+ if db_setup_debug:
-+ print "db.h: no version number version in", d
-+
-+ db_found_vers = db_ver_inc_map.keys()
-+ db_found_vers.sort()
-+
-+ while db_found_vers:
-+ db_ver = db_found_vers.pop()
-+ db_incdir = db_ver_inc_map[db_ver]
-+
-+ # check lib directories parallel to the location of the header
-+ db_dirs_to_check = [
-+ db_incdir.replace("include", 'lib64'),
-+ db_incdir.replace("include", 'lib'),
-+ ]
-+ db_dirs_to_check = filter(os.path.isdir, db_dirs_to_check)
-+
-+ # Look for a version specific db-X.Y before an ambiguoius dbX
-+ # XXX should we -ever- look for a dbX name? Do any
-+ # systems really not name their library by version and
-+ # symlink to more general names?
-+ for dblib in (('db-%d.%d' % db_ver),
-+ ('db%d%d' % db_ver),
-+ ('db%d' % db_ver[0])):
-+ dblib_file = self.compiler.find_library_file(
-+ db_dirs_to_check + lib_dirs, dblib )
-+ if dblib_file:
-+ dblib_dir = [ os.path.abspath(os.path.dirname(dblib_file)) ]
-+ raise db_found
-+ else:
-+ if db_setup_debug: print "db lib: ", dblib, "not found"
-+
-+ except db_found:
-+ if db_setup_debug:
-+ print "bsddb using BerkeleyDB lib:", db_ver, dblib
-+ print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir
-+ db_incs = [db_incdir]
-+ dblibs = [dblib]
-+ # We add the runtime_library_dirs argument because the
-+ # BerkeleyDB lib we're linking against often isn't in the
-+ # system dynamic library search path. This is usually
-+ # correct and most trouble free, but may cause problems in
-+ # some unusual system configurations (e.g. the directory
-+ # is on an NFS server that goes away).
-+ exts.append(Extension('_bsddb', ['_bsddb.c'],
-+ depends = ['bsddb.h'],
-+ library_dirs=dblib_dir,
-+ runtime_library_dirs=dblib_dir,
-+ include_dirs=db_incs,
-+ libraries=dblibs))
-+ else:
-+ if db_setup_debug: print "db: no appropriate library found"
-+ db_incs = None
-+ dblibs = []
-+ dblib_dir = None
-+ missing.append('_bsddb')
-+
-+ # The sqlite interface
-+ sqlite_setup_debug = False # verbose debug prints from this script?
-+
-+ # We hunt for #define SQLITE_VERSION "n.n.n"
-+ # We need to find >= sqlite version 3.0.8
-+ sqlite_incdir = sqlite_libdir = None
-+ sqlite_inc_paths = [ '/usr/include',
-+ '/usr/include/sqlite',
-+ '/usr/include/sqlite3',
-+ '/usr/local/include',
-+ '/usr/local/include/sqlite',
-+ '/usr/local/include/sqlite3',
-+ ]
-+ MIN_SQLITE_VERSION_NUMBER = (3, 0, 8)
-+ MIN_SQLITE_VERSION = ".".join([str(x)
-+ for x in MIN_SQLITE_VERSION_NUMBER])
-+
-+ # Scan the default include directories before the SQLite specific
-+ # ones. This allows one to override the copy of sqlite on OSX,
-+ # where /usr/include contains an old version of sqlite.
-+ for d in inc_dirs + sqlite_inc_paths:
-+ f = os.path.join(d, "sqlite3.h")
-+ if os.path.exists(f):
-+ if sqlite_setup_debug: print "sqlite: found %s"%f
-+ incf = open(f).read()
-+ m = re.search(
-+ r'\s*.*#\s*.*define\s.*SQLITE_VERSION\W*"(.*)"', incf)
-+ if m:
-+ sqlite_version = m.group(1)
-+ sqlite_version_tuple = tuple([int(x)
-+ for x in sqlite_version.split(".")])
-+ if sqlite_version_tuple >= MIN_SQLITE_VERSION_NUMBER:
-+ # we win!
-+ if sqlite_setup_debug:
-+ print "%s/sqlite3.h: version %s"%(d, sqlite_version)
-+ sqlite_incdir = d
-+ break
-+ else:
-+ if sqlite_setup_debug:
-+ print "%s: version %d is too old, need >= %s"%(d,
-+ sqlite_version, MIN_SQLITE_VERSION)
-+ elif sqlite_setup_debug:
-+ print "sqlite: %s had no SQLITE_VERSION"%(f,)
-+
-+ if sqlite_incdir:
-+ sqlite_dirs_to_check = [
-+ os.path.join(sqlite_incdir, '..', 'lib64'),
-+ os.path.join(sqlite_incdir, '..', 'lib'),
-+ os.path.join(sqlite_incdir, '..', '..', 'lib64'),
-+ os.path.join(sqlite_incdir, '..', '..', 'lib'),
-+ ]
-+ sqlite_libfile = self.compiler.find_library_file(
-+ sqlite_dirs_to_check + lib_dirs, 'sqlite3')
-+ if sqlite_libfile:
-+ sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))]
-+
-+ if sqlite_incdir and sqlite_libdir:
-+ sqlite_srcs = ['_sqlite/cache.c',
-+ '_sqlite/connection.c',
-+ '_sqlite/cursor.c',
-+ '_sqlite/microprotocols.c',
-+ '_sqlite/module.c',
-+ '_sqlite/prepare_protocol.c',
-+ '_sqlite/row.c',
-+ '_sqlite/statement.c',
-+ '_sqlite/util.c', ]
-+
-+ sqlite_defines = []
-+ if sys.platform != "win32":
-+ sqlite_defines.append(('MODULE_NAME', '"sqlite3"'))
-+ else:
-+ sqlite_defines.append(('MODULE_NAME', '\\"sqlite3\\"'))
-+
-+
-+ if sys.platform == 'darwin':
-+ # In every directory on the search path search for a dynamic
-+ # library and then a static library, instead of first looking
-+ # for dynamic libraries on the entiry path.
-+ # This way a staticly linked custom sqlite gets picked up
-+ # before the dynamic library in /usr/lib.
-+ sqlite_extra_link_args = ('-Wl,-search_paths_first',)
-+ else:
-+ sqlite_extra_link_args = ()
-+
-+ exts.append(Extension('_sqlite3', sqlite_srcs,
-+ define_macros=sqlite_defines,
-+ include_dirs=["Modules/_sqlite",
-+ sqlite_incdir],
-+ library_dirs=sqlite_libdir,
-+ runtime_library_dirs=sqlite_libdir,
-+ extra_link_args=sqlite_extra_link_args,
-+ libraries=["sqlite3",]))
-+ else:
-+ missing.append('_sqlite3')
-+
-+ # Look for Berkeley db 1.85. Note that it is built as a different
-+ # module name so it can be included even when later versions are
-+ # available. A very restrictive search is performed to avoid
-+ # accidentally building this module with a later version of the
-+ # underlying db library. May BSD-ish Unixes incorporate db 1.85
-+ # symbols into libc and place the include file in /usr/include.
-+ #
-+ # If the better bsddb library can be built (db_incs is defined)
-+ # we do not build this one. Otherwise this build will pick up
-+ # the more recent berkeleydb's db.h file first in the include path
-+ # when attempting to compile and it will fail.
-+ f = "/usr/include/db.h"
-+ if os.path.exists(f) and not db_incs:
-+ data = open(f).read()
-+ m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
-+ if m is not None:
-+ # bingo - old version used hash file format version 2
-+ ### XXX this should be fixed to not be platform-dependent
-+ ### but I don't have direct access to an osf1 platform and
-+ ### seemed to be muffing the search somehow
-+ libraries = platform == "osf1" and ['db'] or None
-+ if libraries is not None:
-+ exts.append(Extension('bsddb185', ['bsddbmodule.c'],
-+ libraries=libraries))
-+ else:
-+ exts.append(Extension('bsddb185', ['bsddbmodule.c']))
-+ else:
-+ missing.append('bsddb185')
-+ else:
-+ missing.append('bsddb185')
-+
-+ # The standard Unix dbm module:
-+ if platform not in ['cygwin']:
-+ if find_file("ndbm.h", inc_dirs, []) is not None:
-+ # Some systems have -lndbm, others don't
-+ if self.compiler.find_library_file(lib_dirs, 'ndbm'):
-+ ndbm_libs = ['ndbm']
-+ else:
-+ ndbm_libs = []
-+ exts.append( Extension('dbm', ['dbmmodule.c'],
-+ define_macros=[('HAVE_NDBM_H',None)],
-+ libraries = ndbm_libs ) )
-+ elif self.compiler.find_library_file(lib_dirs, 'gdbm'):
-+ gdbm_libs = ['gdbm']
-+ if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'):
-+ gdbm_libs.append('gdbm_compat')
-+ if find_file("gdbm/ndbm.h", inc_dirs, []) is not None:
-+ exts.append( Extension(
-+ 'dbm', ['dbmmodule.c'],
-+ define_macros=[('HAVE_GDBM_NDBM_H',None)],
-+ libraries = gdbm_libs ) )
-+ elif find_file("gdbm-ndbm.h", inc_dirs, []) is not None:
-+ exts.append( Extension(
-+ 'dbm', ['dbmmodule.c'],
-+ define_macros=[('HAVE_GDBM_DASH_NDBM_H',None)],
-+ libraries = gdbm_libs ) )
-+ else:
-+ missing.append('dbm')
-+ elif db_incs is not None:
-+ exts.append( Extension('dbm', ['dbmmodule.c'],
-+ library_dirs=dblib_dir,
-+ runtime_library_dirs=dblib_dir,
-+ include_dirs=db_incs,
-+ define_macros=[('HAVE_BERKDB_H',None),
-+ ('DB_DBM_HSEARCH',None)],
-+ libraries=dblibs))
-+ else:
-+ missing.append('dbm')
-+
-+ # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
-+ if (self.compiler.find_library_file(lib_dirs, 'gdbm')):
-+ exts.append( Extension('gdbm', ['gdbmmodule.c'],
-+ libraries = ['gdbm'] ) )
-+ else:
-+ missing.append('gdbm')
-+
-+ # Unix-only modules
-+ if platform not in ['mac', 'win32']:
-+ # Steen Lumholt's termios module
-+ exts.append( Extension('termios', ['termios.c']) )
-+ # Jeremy Hylton's rlimit interface
-+ if platform not in ['atheos']:
-+ exts.append( Extension('resource', ['resource.c']) )
-+ else:
-+ missing.append('resource')
-+
-+ # Sun yellow pages. Some systems have the functions in libc.
-+ if platform not in ['cygwin', 'atheos', 'qnx6']:
-+ if (self.compiler.find_library_file(lib_dirs, 'nsl')):
-+ libs = ['nsl']
-+ else:
-+ libs = []
-+ exts.append( Extension('nis', ['nismodule.c'],
-+ libraries = libs) )
-+ else:
-+ missing.append('nis')
-+ else:
-+ missing.extend(['nis', 'resource', 'termios'])
-+
-+ # Curses support, requiring the System V version of curses, often
-+ # provided by the ncurses library.
-+ curses_lib_dirs = []
-+ curses_inc_dirs = []
-+ if platform == 'sunos5':
-+ # look for ncurses in /usr/gnu on Solaris
-+ curses_inc_dirs.append('/usr/include/ncurses')
-+ curses_lib_dirs.append('/usr/gnu/lib')
-+ curses_lib_dirs.append('/usr/gnu/lib/amd64')
-+ curses_lib_dirs.append('/usr/gnu/lib/sparcv9')
-+ panel_library = 'panel'
-+ if (self.compiler.find_library_file(lib_dirs, 'ncursesw')):
-+ curses_libs = ['ncursesw']
-+ # Bug 1464056: If _curses.so links with ncursesw,
-+ # _curses_panel.so must link with panelw.
-+ panel_library = 'panelw'
-+ exts.append( Extension('_curses', ['_cursesmodule.c'],
-+ libraries = curses_libs) )
-+ elif (self.compiler.find_library_file(lib_dirs + curses_lib_dirs, 'ncurses')):
-+ curses_libs = ['ncurses']
-+ exts.append( Extension('_curses', ['_cursesmodule.c'],
-+ libraries = curses_libs,
-+ library_dirs = curses_lib_dirs,
-+ runtime_library_dirs = curses_lib_dirs,
-+ include_dirs = curses_inc_dirs ) )
-+ elif (self.compiler.find_library_file(lib_dirs, 'curses')
-+ and platform != 'darwin'):
-+ # OSX has an old Berkeley curses, not good enough for
-+ # the _curses module.
-+ if (self.compiler.find_library_file(lib_dirs, 'terminfo')):
-+ curses_libs = ['curses', 'terminfo']
-+ elif (self.compiler.find_library_file(lib_dirs, 'termcap')):
-+ curses_libs = ['curses', 'termcap']
-+ else:
-+ curses_libs = ['curses']
-+
-+ exts.append( Extension('_curses', ['_cursesmodule.c'],
-+ libraries = curses_libs) )
-+ else:
-+ missing.append('_curses')
-+
-+ # If the curses module is enabled, check for the panel module
-+ if (module_enabled(exts, '_curses') and
-+ self.compiler.find_library_file(lib_dirs + curses_lib_dirs, panel_library)):
-+ exts.append( Extension('_curses_panel', ['_curses_panel.c'],
-+ libraries = [panel_library] + curses_libs,
-+ include_dirs = curses_inc_dirs,
-+ library_dirs = curses_lib_dirs,
-+ runtime_library_dirs = curses_lib_dirs ) )
-+ else:
-+ missing.append('_curses_panel')
-+
-+ # Andrew Kuchling's zlib module. Note that some versions of zlib
-+ # 1.1.3 have security problems. See CERT Advisory CA-2002-07:
-+ # http://www.cert.org/advisories/CA-2002-07.html
-+ #
-+ # zlib 1.1.4 is fixed, but at least one vendor (RedHat) has decided to
-+ # patch its zlib 1.1.3 package instead of upgrading to 1.1.4. For
-+ # now, we still accept 1.1.3, because we think it's difficult to
-+ # exploit this in Python, and we'd rather make it RedHat's problem
-+ # than our problem <wink>.
-+ #
-+ # You can upgrade zlib to version 1.1.4 yourself by going to
-+ # http://www.gzip.org/zlib/
-+ zlib_inc = find_file('zlib.h', [], inc_dirs)
-+ have_zlib = False
-+ if zlib_inc is not None:
-+ zlib_h = zlib_inc[0] + '/zlib.h'
-+ version = '"0.0.0"'
-+ version_req = '"1.1.3"'
-+ fp = open(zlib_h)
-+ while 1:
-+ line = fp.readline()
-+ if not line:
-+ break
-+ if line.startswith('#define ZLIB_VERSION'):
-+ version = line.split()[2]
-+ break
-+ if version >= version_req:
-+ if (self.compiler.find_library_file(lib_dirs, 'z')):
-+ if sys.platform == "darwin":
-+ zlib_extra_link_args = ('-Wl,-search_paths_first',)
-+ else:
-+ zlib_extra_link_args = ()
-+ exts.append( Extension('zlib', ['zlibmodule.c'],
-+ libraries = ['z'],
-+ extra_link_args = zlib_extra_link_args))
-+ have_zlib = True
-+ else:
-+ missing.append('zlib')
-+ else:
-+ missing.append('zlib')
-+ else:
-+ missing.append('zlib')
-+
-+ # Helper module for various ascii-encoders. Uses zlib for an optimized
-+ # crc32 if we have it. Otherwise binascii uses its own.
-+ if have_zlib:
-+ extra_compile_args = ['-DUSE_ZLIB_CRC32']
-+ libraries = ['z']
-+ extra_link_args = zlib_extra_link_args
-+ else:
-+ extra_compile_args = []
-+ libraries = []
-+ extra_link_args = []
-+ exts.append( Extension('binascii', ['binascii.c'],
-+ extra_compile_args = extra_compile_args,
-+ libraries = libraries,
-+ extra_link_args = extra_link_args) )
-+
-+ # Gustavo Niemeyer's bz2 module.
-+ if (self.compiler.find_library_file(lib_dirs, 'bz2')):
-+ if sys.platform == "darwin":
-+ bz2_extra_link_args = ('-Wl,-search_paths_first',)
-+ else:
-+ bz2_extra_link_args = ()
-+ exts.append( Extension('bz2', ['bz2module.c'],
-+ libraries = ['bz2'],
-+ extra_link_args = bz2_extra_link_args) )
-+ else:
-+ missing.append('bz2')
-+
-+ # Interface to the Expat XML parser
-+ #
-+ # Expat was written by James Clark and is now maintained by a
-+ # group of developers on SourceForge; see www.libexpat.org for
-+ # more information. The pyexpat module was written by Paul
-+ # Prescod after a prototype by Jack Jansen. The Expat source
-+ # is included in Modules/expat/. Usage of a system
-+ # shared libexpat.so/expat.dll is not advised.
-+ #
-+ # More information on Expat can be found at www.libexpat.org.
-+ #
-+ expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')
-+ define_macros = [
-+ ('HAVE_EXPAT_CONFIG_H', '1'),
-+ ]
-+
-+ exts.append(Extension('pyexpat',
-+ define_macros = define_macros,
-+ include_dirs = [expatinc],
-+ sources = ['pyexpat.c',
-+ 'expat/xmlparse.c',
-+ 'expat/xmlrole.c',
-+ 'expat/xmltok.c',
-+ ],
-+ ))
-+
-+ # Fredrik Lundh's cElementTree module. Note that this also
-+ # uses expat (via the CAPI hook in pyexpat).
-+
-+ if os.path.isfile(os.path.join(srcdir, 'Modules', '_elementtree.c')):
-+ define_macros.append(('USE_PYEXPAT_CAPI', None))
-+ exts.append(Extension('_elementtree',
-+ define_macros = define_macros,
-+ include_dirs = [expatinc],
-+ sources = ['_elementtree.c'],
-+ ))
-+ else:
-+ missing.append('_elementtree')
-+
-+ # Hye-Shik Chang's CJKCodecs modules.
-+ if have_unicode:
-+ exts.append(Extension('_multibytecodec',
-+ ['cjkcodecs/multibytecodec.c']))
-+ for loc in ('kr', 'jp', 'cn', 'tw', 'hk', 'iso2022'):
-+ exts.append(Extension('_codecs_%s' % loc,
-+ ['cjkcodecs/_codecs_%s.c' % loc]))
-+ else:
-+ missing.append('_multibytecodec')
-+ for loc in ('kr', 'jp', 'cn', 'tw', 'hk', 'iso2022'):
-+ missing.append('_codecs_%s' % loc)
-+
-+ # Dynamic loading module
-+ if sys.maxint == 0x7fffffff:
-+ # This requires sizeof(int) == sizeof(long) == sizeof(char*)
-+ dl_inc = find_file('dlfcn.h', [], inc_dirs)
-+ if (dl_inc is not None) and (platform not in ['atheos']):
-+ exts.append( Extension('dl', ['dlmodule.c']) )
-+ else:
-+ missing.append('dl')
-+ else:
-+ missing.append('dl')
-+
-+ # Thomas Heller's _ctypes module
-+ self.detect_ctypes(inc_dirs, lib_dirs)
-+
-+ # Richard Oudkerk's multiprocessing module
-+ if platform == 'win32': # Windows
-+ macros = dict()
-+ libraries = ['ws2_32']
-+
-+ elif platform == 'darwin': # Mac OSX
-+ macros = dict(
-+ HAVE_SEM_OPEN=1,
-+ HAVE_SEM_TIMEDWAIT=0,
-+ HAVE_FD_TRANSFER=1,
-+ HAVE_BROKEN_SEM_GETVALUE=1
-+ )
-+ libraries = []
-+
-+ elif platform == 'cygwin': # Cygwin
-+ macros = dict(
-+ HAVE_SEM_OPEN=1,
-+ HAVE_SEM_TIMEDWAIT=1,
-+ HAVE_FD_TRANSFER=0,
-+ HAVE_BROKEN_SEM_UNLINK=1
-+ )
-+ libraries = []
-+
-+ elif platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
-+ # FreeBSD's P1003.1b semaphore support is very experimental
-+ # and has many known problems. (as of June 2008)
-+ macros = dict( # FreeBSD
-+ HAVE_SEM_OPEN=0,
-+ HAVE_SEM_TIMEDWAIT=0,
-+ HAVE_FD_TRANSFER=1,
-+ )
-+ libraries = []
-+
-+ elif platform.startswith('openbsd'):
-+ macros = dict( # OpenBSD
-+ HAVE_SEM_OPEN=0, # Not implemented
-+ HAVE_SEM_TIMEDWAIT=0,
-+ HAVE_FD_TRANSFER=1,
-+ )
-+ libraries = []
-+
-+ elif platform.startswith('netbsd'):
-+ macros = dict( # at least NetBSD 5
-+ HAVE_SEM_OPEN=1,
-+ HAVE_SEM_TIMEDWAIT=0,
-+ HAVE_FD_TRANSFER=1,
-+ HAVE_BROKEN_SEM_GETVALUE=1
-+ )
-+ libraries = []
-+
-+ else: # Linux and other unices
-+ macros = dict(
-+ HAVE_SEM_OPEN=1,
-+ HAVE_SEM_TIMEDWAIT=1,
-+ HAVE_FD_TRANSFER=1
-+ )
-+ libraries = ['rt']
-+
-+ if platform == 'win32':
-+ multiprocessing_srcs = [ '_multiprocessing/multiprocessing.c',
-+ '_multiprocessing/semaphore.c',
-+ '_multiprocessing/pipe_connection.c',
-+ '_multiprocessing/socket_connection.c',
-+ '_multiprocessing/win32_functions.c'
-+ ]
-+
-+ else:
-+ multiprocessing_srcs = [ '_multiprocessing/multiprocessing.c',
-+ '_multiprocessing/socket_connection.c'
-+ ]
-+
-+ if macros.get('HAVE_SEM_OPEN', False):
-+ multiprocessing_srcs.append('_multiprocessing/semaphore.c')
-+
-+ multiproc_libs = []
-+ if platform == 'sunos5':
-+ multiproc_libs = [ "xnet" ]
-+
-+ exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
-+ define_macros=macros.items(),
-+ libraries=multiproc_libs,
-+ include_dirs=["Modules/_multiprocessing"]))
-+ # End multiprocessing
-+
-+
-+ # Platform-specific libraries
-+ if platform == 'linux2':
-+ # Linux-specific modules
-+ exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
-+ else:
-+ missing.append('linuxaudiodev')
-+
-+ if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
-+ 'freebsd7', 'freebsd8'):
-+ exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
-+ else:
-+ missing.append('ossaudiodev')
-+
-+ if platform == 'sunos5':
-+ # SunOS specific modules
-+ exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
-+ else:
-+ missing.append('sunaudiodev')
-+
-+ if platform == 'darwin':
-+ # _scproxy
-+ exts.append(Extension("_scproxy", [os.path.join(srcdir, "Mac/Modules/_scproxy.c")],
-+ extra_link_args= [
-+ '-framework', 'SystemConfiguration',
-+ '-framework', 'CoreFoundation'
-+ ]))
-+
-+
-+ if platform == 'darwin' and ("--disable-toolbox-glue" not in
-+ sysconfig.get_config_var("CONFIG_ARGS")):
-+
-+ if os.uname()[2] > '8.':
-+ # We're on Mac OS X 10.4 or later, the compiler should
-+ # support '-Wno-deprecated-declarations'. This will
-+ # surpress deprecation warnings for the Carbon extensions,
-+ # these extensions wrap the Carbon APIs and even those
-+ # parts that are deprecated.
-+ carbon_extra_compile_args = ['-Wno-deprecated-declarations']
-+ else:
-+ carbon_extra_compile_args = []
-+
-+ # Mac OS X specific modules.
-+ def macSrcExists(name1, name2=''):
-+ if not name1:
-+ return None
-+ names = (name1,)
-+ if name2:
-+ names = (name1, name2)
-+ path = os.path.join(srcdir, 'Mac', 'Modules', *names)
-+ return os.path.exists(path)
-+
-+ def addMacExtension(name, kwds, extra_srcs=[]):
-+ dirname = ''
-+ if name[0] == '_':
-+ dirname = name[1:].lower()
-+ cname = name + '.c'
-+ cmodulename = name + 'module.c'
-+ # Check for NNN.c, NNNmodule.c, _nnn/NNN.c, _nnn/NNNmodule.c
-+ if macSrcExists(cname):
-+ srcs = [cname]
-+ elif macSrcExists(cmodulename):
-+ srcs = [cmodulename]
-+ elif macSrcExists(dirname, cname):
-+ # XXX(nnorwitz): If all the names ended with module, we
-+ # wouldn't need this condition. ibcarbon is the only one.
-+ srcs = [os.path.join(dirname, cname)]
-+ elif macSrcExists(dirname, cmodulename):
-+ srcs = [os.path.join(dirname, cmodulename)]
-+ else:
-+ raise RuntimeError("%s not found" % name)
-+
-+ # Here's the whole point: add the extension with sources
-+ exts.append(Extension(name, srcs + extra_srcs, **kwds))
-+
-+ # Core Foundation
-+ core_kwds = {'extra_compile_args': carbon_extra_compile_args,
-+ 'extra_link_args': ['-framework', 'CoreFoundation'],
-+ }
-+ addMacExtension('_CF', core_kwds, ['cf/pycfbridge.c'])
-+ addMacExtension('autoGIL', core_kwds)
-+
-+
-+
-+ # Carbon
-+ carbon_kwds = {'extra_compile_args': carbon_extra_compile_args,
-+ 'extra_link_args': ['-framework', 'Carbon'],
-+ }
-+ CARBON_EXTS = ['ColorPicker', 'gestalt', 'MacOS', 'Nav',
-+ 'OSATerminology', 'icglue',
-+ # All these are in subdirs
-+ '_AE', '_AH', '_App', '_CarbonEvt', '_Cm', '_Ctl',
-+ '_Dlg', '_Drag', '_Evt', '_File', '_Folder', '_Fm',
-+ '_Help', '_Icn', '_IBCarbon', '_List',
-+ '_Menu', '_Mlte', '_OSA', '_Res', '_Qd', '_Qdoffs',
-+ '_Scrap', '_Snd', '_TE',
-+ ]
-+ for name in CARBON_EXTS:
-+ addMacExtension(name, carbon_kwds)
-+
-+ # Workaround for a bug in the version of gcc shipped with Xcode 3.
-+ # The _Win extension should build just like the other Carbon extensions, but
-+ # this actually results in a hard crash of the linker.
-+ #
-+ if '-arch ppc64' in cflags and '-arch ppc' in cflags:
-+ win_kwds = {'extra_compile_args': carbon_extra_compile_args + ['-arch', 'i386', '-arch', 'ppc'],
-+ 'extra_link_args': ['-framework', 'Carbon', '-arch', 'i386', '-arch', 'ppc'],
-+ }
-+ addMacExtension('_Win', win_kwds)
-+ else:
-+ addMacExtension('_Win', carbon_kwds)
-+
-+
-+ # Application Services & QuickTime
-+ app_kwds = {'extra_compile_args': carbon_extra_compile_args,
-+ 'extra_link_args': ['-framework','ApplicationServices'],
-+ }
-+ addMacExtension('_Launch', app_kwds)
-+ addMacExtension('_CG', app_kwds)
-+
-+ exts.append( Extension('_Qt', ['qt/_Qtmodule.c'],
-+ extra_compile_args=carbon_extra_compile_args,
-+ extra_link_args=['-framework', 'QuickTime',
-+ '-framework', 'Carbon']) )
-+
-+
-+ self.extensions.extend(exts)
-+
-+ # Call the method for detecting whether _tkinter can be compiled
-+ self.detect_tkinter(inc_dirs, lib_dirs)
-+
-+ if '_tkinter' not in [e.name for e in self.extensions]:
-+ missing.append('_tkinter')
-+
-+ return missing
-+
-+ def detect_tkinter_darwin(self, inc_dirs, lib_dirs):
-+ # The _tkinter module, using frameworks. Since frameworks are quite
-+ # different the UNIX search logic is not sharable.
-+ from os.path import join, exists
-+ framework_dirs = [
-+ '/Library/Frameworks',
-+ '/System/Library/Frameworks/',
-+ join(os.getenv('HOME'), '/Library/Frameworks')
-+ ]
-+
-+ # Find the directory that contains the Tcl.framework and Tk.framework
-+ # bundles.
-+ # XXX distutils should support -F!
-+ for F in framework_dirs:
-+ # both Tcl.framework and Tk.framework should be present
-+ for fw in 'Tcl', 'Tk':
-+ if not exists(join(F, fw + '.framework')):
-+ break
-+ else:
-+ # ok, F is now directory with both frameworks. Continure
-+ # building
-+ break
-+ else:
-+ # Tk and Tcl frameworks not found. Normal "unix" tkinter search
-+ # will now resume.
-+ return 0
-+
-+ # For 8.4a2, we must add -I options that point inside the Tcl and Tk
-+ # frameworks. In later release we should hopefully be able to pass
-+ # the -F option to gcc, which specifies a framework lookup path.
-+ #
-+ include_dirs = [
-+ join(F, fw + '.framework', H)
-+ for fw in 'Tcl', 'Tk'
-+ for H in 'Headers', 'Versions/Current/PrivateHeaders'
-+ ]
-+
-+ # For 8.4a2, the X11 headers are not included. Rather than include a
-+ # complicated search, this is a hard-coded path. It could bail out
-+ # if X11 libs are not found...
-+ include_dirs.append('/usr/X11R6/include')
-+ frameworks = ['-framework', 'Tcl', '-framework', 'Tk']
-+
-+ # All existing framework builds of Tcl/Tk don't support 64-bit
-+ # architectures.
-+ cflags = sysconfig.get_config_vars('CFLAGS')[0]
-+ archs = re.findall('-arch\s+(\w+)', cflags)
-+ fp = os.popen("file %s/Tk.framework/Tk | grep 'for architecture'"%(F,))
-+ detected_archs = []
-+ for ln in fp:
-+ a = ln.split()[-1]
-+ if a in archs:
-+ detected_archs.append(ln.split()[-1])
-+ fp.close()
-+
-+ for a in detected_archs:
-+ frameworks.append('-arch')
-+ frameworks.append(a)
-+
-+ ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
-+ define_macros=[('WITH_APPINIT', 1)],
-+ include_dirs = include_dirs,
-+ libraries = [],
-+ extra_compile_args = frameworks[2:],
-+ extra_link_args = frameworks,
-+ )
-+ self.extensions.append(ext)
-+ return 1
-+
-+
-+ def detect_tkinter(self, inc_dirs, lib_dirs):
-+ # The _tkinter module.
-+
-+ # Rather than complicate the code below, detecting and building
-+ # AquaTk is a separate method. Only one Tkinter will be built on
-+ # Darwin - either AquaTk, if it is found, or X11 based Tk.
-+ platform = self.get_platform()
-+ if (platform == 'darwin' and
-+ self.detect_tkinter_darwin(inc_dirs, lib_dirs)):
-+ return
-+
-+ # Assume we haven't found any of the libraries or include files
-+ # The versions with dots are used on Unix, and the versions without
-+ # dots on Windows, for detection by cygwin.
-+ added_lib_dirs = []
-+ tcl_tk_lib_dirs = ['/usr/sfw/lib']
-+ tcl_tk_inc_dirs = ['/usr/sfw/include']
-+ tcllib = tklib = tcl_includes = tk_includes = None
-+ for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
-+ '82', '8.1', '81', '8.0', '80']:
-+ tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version, tcl_tk_lib_dirs)
-+ tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version, tcl_tk_lib_dirs)
-+ if tklib and tcllib:
-+ # Exit the loop when we've found the Tcl/Tk libraries
-+ break
-+
-+ tklib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tk' + version)
-+ tcllib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tcl' + version)
-+ if tklib and tcllib:
-+ # found the libs in a non-standard dir
-+ added_lib_dirs.append(os.path.dirname(tcllib))
-+ # Exit the loop when we've found the Tcl/Tk libraries
-+ break
-+
-+ # Now check for the header files
-+ if tklib and tcllib:
-+ # Check for the include files on Debian and {Free,Open}BSD, where
-+ # they're put in /usr/include/{tcl,tk}X.Y
-+ dotversion = version
-+ if '.' not in dotversion and "bsd" in sys.platform.lower():
-+ # OpenBSD and FreeBSD use Tcl/Tk library names like libtcl83.a,
-+ # but the include subdirs are named like .../include/tcl8.3.
-+ dotversion = dotversion[:-1] + '.' + dotversion[-1]
-+ tcl_include_sub = []
-+ tk_include_sub = []
-+ for dir in inc_dirs:
-+ tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
-+ tk_include_sub += [dir + os.sep + "tk" + dotversion]
-+ tcl_include_sub += tcl_tk_inc_dirs
-+ tk_include_sub += tcl_include_sub
-+ tcl_includes = find_file('tcl.h', inc_dirs, tcl_include_sub)
-+ tk_includes = find_file('tk.h', inc_dirs, tk_include_sub)
-+
-+ if (tcllib is None or tklib is None or
-+ tcl_includes is None or tk_includes is None):
-+ self.announce("INFO: Can't locate Tcl/Tk libs and/or headers", 2)
-+ return
-+
-+ # OK... everything seems to be present for Tcl/Tk.
-+
-+ include_dirs = [] ; libs = [] ; defs = [] ; added_lib_dirs = []
-+ for dir in tcl_includes + tk_includes:
-+ if dir not in include_dirs:
-+ include_dirs.append(dir)
-+
-+ # Check for various platform-specific directories
-+ if platform == 'sunos5':
-+ include_dirs.append('/usr/openwin/include')
-+ added_lib_dirs.append('/usr/openwin/lib')
-+ elif os.path.exists('/usr/X11R6/include'):
-+ include_dirs.append('/usr/X11R6/include')
-+ added_lib_dirs.append('/usr/X11R6/lib64')
-+ added_lib_dirs.append('/usr/X11R6/lib')
-+ elif os.path.exists('/usr/X11R5/include'):
-+ include_dirs.append('/usr/X11R5/include')
-+ added_lib_dirs.append('/usr/X11R5/lib')
-+ else:
-+ # Assume default location for X11
-+ include_dirs.append('/usr/X11/include')
-+ added_lib_dirs.append('/usr/X11/lib')
-+
-+ # If Cygwin, then verify that X is installed before proceeding
-+ if platform == 'cygwin':
-+ x11_inc = find_file('X11/Xlib.h', [], include_dirs)
-+ if x11_inc is None:
-+ return
-+
-+ # Check for BLT extension
-+ if self.compiler.find_library_file(lib_dirs + added_lib_dirs,
-+ 'BLT8.0'):
-+ defs.append( ('WITH_BLT', 1) )
-+ libs.append('BLT8.0')
-+ elif self.compiler.find_library_file(lib_dirs + added_lib_dirs,
-+ 'BLT'):
-+ defs.append( ('WITH_BLT', 1) )
-+ libs.append('BLT')
-+
-+ # Add the Tcl/Tk libraries
-+ libs.append('tk'+ version)
-+ libs.append('tcl'+ version)
-+
-+ if platform in ['aix3', 'aix4']:
-+ libs.append('ld')
-+
-+ # Finally, link with the X11 libraries (not appropriate on cygwin)
-+ if platform != "cygwin":
-+ libs.append('X11')
-+
-+ ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
-+ define_macros=[('WITH_APPINIT', 1)] + defs,
-+ include_dirs = include_dirs,
-+ libraries = libs,
-+ library_dirs = added_lib_dirs,
-+ runtime_library_dirs = added_lib_dirs
-+ )
-+ self.extensions.append(ext)
-+
-+## # Uncomment these lines if you want to play with xxmodule.c
-+## ext = Extension('xx', ['xxmodule.c'])
-+## self.extensions.append(ext)
-+
-+ # XXX handle these, but how to detect?
-+ # *** Uncomment and edit for PIL (TkImaging) extension only:
-+ # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \
-+ # *** Uncomment and edit for TOGL extension only:
-+ # -DWITH_TOGL togl.c \
-+ # *** Uncomment these for TOGL extension only:
-+ # -lGL -lGLU -lXext -lXmu \
-+
-+ def configure_ctypes_darwin(self, ext):
-+ # Darwin (OS X) uses preconfigured files, in
-+ # the Modules/_ctypes/libffi_osx directory.
-+ (srcdir,) = sysconfig.get_config_vars('srcdir')
-+ ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules',
-+ '_ctypes', 'libffi_osx'))
-+ sources = [os.path.join(ffi_srcdir, p)
-+ for p in ['ffi.c',
-+ 'x86/darwin64.S',
-+ 'x86/x86-darwin.S',
-+ 'x86/x86-ffi_darwin.c',
-+ 'x86/x86-ffi64.c',
-+ 'powerpc/ppc-darwin.S',
-+ 'powerpc/ppc-darwin_closure.S',
-+ 'powerpc/ppc-ffi_darwin.c',
-+ 'powerpc/ppc64-darwin_closure.S',
-+ ]]
-+
-+ # Add .S (preprocessed assembly) to C compiler source extensions.
-+ self.compiler.src_extensions.append('.S')
-+
-+ include_dirs = [os.path.join(ffi_srcdir, 'include'),
-+ os.path.join(ffi_srcdir, 'powerpc')]
-+ ext.include_dirs.extend(include_dirs)
-+ ext.sources.extend(sources)
-+ return True
-+
-+ def configure_ctypes(self, ext):
-+ if not self.use_system_libffi:
-+ if sys.platform == 'darwin':
-+ return self.configure_ctypes_darwin(ext)
-+
-+ (srcdir,) = sysconfig.get_config_vars('srcdir')
-+ ffi_builddir = os.path.join(self.build_temp, 'libffi')
-+ ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules',
-+ '_ctypes', 'libffi'))
-+ ffi_configfile = os.path.join(ffi_builddir, 'fficonfig.py')
-+
-+ from distutils.dep_util import newer_group
-+
-+ config_sources = [os.path.join(ffi_srcdir, fname)
-+ for fname in os.listdir(ffi_srcdir)
-+ if os.path.isfile(os.path.join(ffi_srcdir, fname))]
-+ if self.force or newer_group(config_sources,
-+ ffi_configfile):
-+ from distutils.dir_util import mkpath
-+ mkpath(ffi_builddir)
-+ config_args = []
-+
-+ # Pass empty CFLAGS because we'll just append the resulting
-+ # CFLAGS to Python's; -g or -O2 is to be avoided.
-+ cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
-+ % (ffi_builddir, ffi_srcdir, " ".join(config_args))
-+
-+ res = os.system(cmd)
-+ if res or not os.path.exists(ffi_configfile):
-+ print "Failed to configure _ctypes module"
-+ return False
-+
-+ fficonfig = {}
-+ execfile(ffi_configfile, globals(), fficonfig)
-+ ffi_srcdir = os.path.join(fficonfig['ffi_srcdir'], 'src')
-+
-+ # Add .S (preprocessed assembly) to C compiler source extensions.
-+ self.compiler.src_extensions.append('.S')
-+
-+ include_dirs = [os.path.join(ffi_builddir, 'include'),
-+ ffi_builddir, ffi_srcdir]
-+ extra_compile_args = fficonfig['ffi_cflags'].split()
-+
-+ ext.sources.extend(fficonfig['ffi_sources'])
-+ ext.include_dirs.extend(include_dirs)
-+ ext.extra_compile_args.extend(extra_compile_args)
-+ return True
-+
-+ def detect_ctypes(self, inc_dirs, lib_dirs):
-+ self.use_system_libffi = False
-+ include_dirs = []
-+ extra_compile_args = []
-+ extra_link_args = []
-+ sources = ['_ctypes/_ctypes.c',
-+ '_ctypes/callbacks.c',
-+ '_ctypes/callproc.c',
-+ '_ctypes/stgdict.c',
-+ '_ctypes/cfield.c',
-+ '_ctypes/malloc_closure.c']
-+ depends = ['_ctypes/ctypes.h']
-+
-+ if sys.platform == 'darwin':
-+ sources.append('_ctypes/darwin/dlfcn_simple.c')
-+ extra_compile_args.append('-DMACOSX')
-+ include_dirs.append('_ctypes/darwin')
-+# XXX Is this still needed?
-+## extra_link_args.extend(['-read_only_relocs', 'warning'])
-+
-+ elif sys.platform == 'sunos5':
-+ # XXX This shouldn't be necessary; it appears that some
-+ # of the assembler code is non-PIC (i.e. it has relocations
-+ # when it shouldn't. The proper fix would be to rewrite
-+ # the assembler code to be PIC.
-+ # This only works with GCC; the Sun compiler likely refuses
-+ # this option. If you want to compile ctypes with the Sun
-+ # compiler, please research a proper solution, instead of
-+ # finding some -z option for the Sun compiler.
-+ extra_link_args.append('-mimpure-text')
-+
-+ elif sys.platform.startswith('hp-ux'):
-+ extra_link_args.append('-fPIC')
-+
-+ ext = Extension('_ctypes',
-+ include_dirs=include_dirs,
-+ extra_compile_args=extra_compile_args,
-+ extra_link_args=extra_link_args,
-+ libraries=[],
-+ sources=sources,
-+ depends=depends)
-+ ext_test = Extension('_ctypes_test',
-+ sources=['_ctypes/_ctypes_test.c'])
-+ self.extensions.extend([ext, ext_test])
-+
-+ if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
-+ return
-+
-+ if sys.platform == 'darwin':
-+ # OS X 10.5 comes with libffi.dylib; the include files are
-+ # in /usr/include/ffi
-+ inc_dirs.append('/usr/include/ffi')
-+
-+ ffi_inc = find_file('ffi.h', [], inc_dirs)
-+ if ffi_inc is not None:
-+ ffi_h = ffi_inc[0] + '/ffi.h'
-+ fp = open(ffi_h)
-+ while 1:
-+ line = fp.readline()
-+ if not line:
-+ ffi_inc = None
-+ break
-+ if line.startswith('#define LIBFFI_H'):
-+ break
-+ ffi_lib = None
-+ if ffi_inc is not None:
-+ for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
-+ if (self.compiler.find_library_file(lib_dirs, lib_name)):
-+ ffi_lib = lib_name
-+ break
-+
-+ if ffi_inc and ffi_lib:
-+ ext.include_dirs.extend(ffi_inc)
-+ ext.libraries.append(ffi_lib)
-+ self.use_system_libffi = True
-+
-+
-+class PyBuildInstall(install):
-+ # Suppress the warning about installation into the lib_dynload
-+ # directory, which is not in sys.path when running Python during
-+ # installation:
-+ def initialize_options (self):
-+ install.initialize_options(self)
-+ self.warn_dir=0
-+
-+class PyBuildInstallLib(install_lib):
-+ # Do exactly what install_lib does but make sure correct access modes get
-+ # set on installed directories and files. All installed files with get
-+ # mode 644 unless they are a shared library in which case they will get
-+ # mode 755. All installed directories will get mode 755.
-+
-+ so_ext = sysconfig.get_config_var("SO")
-+
-+ def install(self):
-+ outfiles = install_lib.install(self)
-+ self.set_file_modes(outfiles, 0644, 0755)
-+ self.set_dir_modes(self.install_dir, 0755)
-+ return outfiles
-+
-+ def set_file_modes(self, files, defaultMode, sharedLibMode):
-+ if not self.is_chmod_supported(): return
-+ if not files: return
-+
-+ for filename in files:
-+ if os.path.islink(filename): continue
-+ mode = defaultMode
-+ if filename.endswith(self.so_ext): mode = sharedLibMode
-+ log.info("changing mode of %s to %o", filename, mode)
-+ if not self.dry_run: os.chmod(filename, mode)
-+
-+ def set_dir_modes(self, dirname, mode):
-+ if not self.is_chmod_supported(): return
-+ os.path.walk(dirname, self.set_dir_modes_visitor, mode)
-+
-+ def set_dir_modes_visitor(self, mode, dirname, names):
-+ if os.path.islink(dirname): return
-+ log.info("changing mode of %s to %o", dirname, mode)
-+ if not self.dry_run: os.chmod(dirname, mode)
-+
-+ def is_chmod_supported(self):
-+ return hasattr(os, 'chmod')
-+
-+SUMMARY = """
-+Python is an interpreted, interactive, object-oriented programming
-+language. It is often compared to Tcl, Perl, Scheme or Java.
-+
-+Python combines remarkable power with very clear syntax. It has
-+modules, classes, exceptions, very high level dynamic data types, and
-+dynamic typing. There are interfaces to many system calls and
-+libraries, as well as to various windowing systems (X11, Motif, Tk,
-+Mac, MFC). New built-in modules are easily written in C or C++. Python
-+is also usable as an extension language for applications that need a
-+programmable interface.
-+
-+The Python implementation is portable: it runs on many brands of UNIX,
-+on Windows, DOS, OS/2, Mac, Amiga... If your favorite system isn't
-+listed here, it may still be supported, if there's a C compiler for
-+it. Ask around on comp.lang.python -- or just try compiling Python
-+yourself.
-+"""
-+
-+CLASSIFIERS = """
-+Development Status :: 6 - Mature
-+License :: OSI Approved :: Python Software Foundation License
-+Natural Language :: English
-+Programming Language :: C
-+Programming Language :: Python
-+Topic :: Software Development
-+"""
-+
-+def main():
-+ # turn off warnings when deprecated modules are imported
-+ import warnings
-+ warnings.filterwarnings("ignore",category=DeprecationWarning)
-+ setup(# PyPI Metadata (PEP 301)
-+ name = "Python",
-+ version = sys.version.split()[0],
-+ url = "http://www.python.org/%s" % sys.version[:3],
-+ maintainer = "Guido van Rossum and the Python community",
-+ maintainer_email = "[email protected]",
-+ description = "A high-level object-oriented programming language",
-+ long_description = SUMMARY.strip(),
-+ license = "PSF license",
-+ classifiers = filter(None, CLASSIFIERS.split("\n")),
-+ platforms = ["Many"],
-+
-+ # Build info
-+ cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall,
-+ 'install_lib':PyBuildInstallLib},
-+ # The struct module is defined here, because build_ext won't be
-+ # called unless there's at least one extension module defined.
-+ ext_modules=[Extension('_struct', ['_struct.c'])],
-+
-+ # Scripts to install
-+ scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
-+ 'Tools/scripts/2to3',
-+ 'Lib/smtpd.py']
-+ )
-+
-+# --install-platlib
-+if __name__ == '__main__':
-+ main()
-
-diff --git Python-2.6.4/Lib/test/ucredtext.py Python-2.6.4/Lib/test/ucredtext.py
-new file mode 100644
---- /dev/null 2011-02-12 03:14:16.000000000 -0600
-+++ Python-2.6.4/Lib/test/ucredtest.py 2011-01-20 13:52:42.945657919 -0600
-@@ -0,0 +1,45 @@
-+#!/usr/bin/python2.6
-+
-+import ucred
-+import os
-+
-+uc = ucred.get(os.getpid())
-+
-+print "pid = %d" % uc.getpid()
-+print "euid = %d" % uc.geteuid()
-+print "ruid = %d" % uc.getruid()
-+print "suid = %d" % uc.getsuid()
-+print "egid = %d" % uc.getegid()
-+print "rgid = %d" % uc.getrgid()
-+print "sgid = %d" % uc.getsgid()
-+print "zoneid = %d" % uc.getzoneid()
-+print "projid = %d" % uc.getprojid()
-+print "groups = %s" % uc.getgroups()
-+print "label = %s" % uc.getlabel()
-+
-+print "getpflags(0x1) = %d" % uc.getpflags(0x1)
-+print "getpflags(0x2) = %d" % uc.getpflags(0x2)
-+print "has_priv(Effective, proc_fork) = %d" % uc.has_priv("Effective", "proc_fork")
-+print "has_priv(Permitted, proc_fork) = %d" % uc.has_priv("Permitted", "proc_fork")
-+print "has_priv(Inheritable, proc_fork) = %d" % uc.has_priv("Inheritable", "proc_fork")
-+print "has_priv(Limit, file_setid) = %d" % uc.has_priv("Limit", "file_setid")
-+print "has_priv(Effective, file_setid) = %d" % uc.has_priv("Effective", "file_setid")
-+try:
-+ uc.has_priv("Effective", "proc_bork")
-+except OSError, e:
-+ print e
-+try:
-+ uc.has_priv("Defective", "proc_fork")
-+except OSError, e:
-+ print e
-+try:
-+ uc.has_priv("Defective", "proc_bork")
-+except OSError, e:
-+ print e
-+
-+del uc
-+uc = ucred.ucred()
-+try:
-+ uc.getpid()
-+except OSError, e:
-+ print e
--- a/components/python/python26/Python26-10-gethostname.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-diff --git Python-2.6.4/Include/pyport.h Python-2.6.4/Include/pyport.h
---- Python-2.6.4/Include/pyport.h
-+++ Python-2.6.4/Include/pyport.h
-@@ -449,11 +449,6 @@
- in platform-specific #ifdefs.
- **************************************************************************/
-
--#ifdef SOLARIS
--/* Unchecked */
--extern int gethostname(char *, int);
--#endif
--
- #ifdef __BEOS__
- /* Unchecked */
- /* It's in the libs, but not the headers... - [cjh] */
--- a/components/python/python26/Python26-11-dlpi.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1328 +0,0 @@
-diff --git Python-2.6.4/Modules/dlpimodule.c Python-2.6.4/Modules/dlpimodule.c
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/Modules/dlpimodule.c
-@@ -0,0 +1,1206 @@
-+/*
-+ * Permission is hereby granted, free of charge, to any person obtaining a copy
-+ * of this software and associated documentation files (the "Software"), to
-+ * deal in the Software without restriction, including without limitation the
-+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-+ * sell copies of the Software, and to permit persons to whom the Software is
-+ * furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice shall be included in
-+ * all copies or substantial portions of the Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ * DEALINGS IN THE SOFTWARE.
-+ *
-+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+#include <Python.h>
-+#include <stdio.h>
-+#include <libdlpi.h>
-+
-+typedef struct {
-+ PyObject_HEAD
-+ dlpi_handle_t dlpihdl;
-+} pylink_t;
-+
-+typedef struct {
-+ PyObject *pyfunc;
-+ PyObject *pyarg;
-+} callback_data_t;
-+
-+/*
-+ * dlpi_err: the only exception raised for libdlpi related error.
-+ * The accompanying value is:
-+ * (dlpi_error_number, string), when it's a dlpi specific error,
-+ * or, (DL_SYSERR, errno, string), when it's coming from a system call.
-+ */
-+static PyObject *dlpi_err;
-+
-+static void
-+dlpi_raise_exception(int err)
-+{
-+ PyObject *e = NULL;
-+
-+ if (err == DL_SYSERR) {
-+ e = Py_BuildValue("(iis)", DL_SYSERR, errno, strerror(errno));
-+ } else {
-+ e = Py_BuildValue("(is)", err, dlpi_strerror(err));
-+ }
-+ if (e != NULL) {
-+ PyErr_SetObject(dlpi_err, e);
-+ Py_DECREF(e);
-+ }
-+}
-+
-+PyDoc_STRVAR(link_doc,
-+ "link(linkname[, flags]) -> link object\n"
-+ "\n"
-+ "Open linkname with specified flags.\n"
-+ "Three flags are supported: PASSIVE, RAW, NATIVE.\n"
-+ "And these flags can be bitwise-OR'ed together(default flag is 0).\n"
-+ "You need sys_net_rawaccess privilege to open a link.\n"
-+ "See dlpi_open(3DLPI).\n"
-+);
-+static int
-+link_init(PyObject *self, PyObject *args, PyObject *kwds)
-+{
-+ uint_t flags = 0;
-+ dlpi_handle_t dh;
-+ char *linkname;
-+ int rval;
-+ static char *keywords[] = {"linkname", "flags", NULL};
-+ pylink_t *link = (pylink_t *)self;
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|I", keywords,
-+ &linkname, &flags))
-+ return (-1);
-+
-+ if ((rval = dlpi_open(linkname, &dh, flags)) != DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (-1);
-+ }
-+
-+ link->dlpihdl = dh;
-+
-+ return (0);
-+}
-+
-+static void
-+link_dealloc(pylink_t *link)
-+{
-+ if (link->dlpihdl != NULL)
-+ dlpi_close(link->dlpihdl);
-+ link->ob_type->tp_free((PyObject *)link);
-+}
-+
-+PyDoc_STRVAR(bind_doc,
-+ "bind(sap) -> unsigned int\n"
-+ "\n"
-+ "Attempts to bind the link to specified SAP, or ANY_SAP.\n"
-+ "Returns the SAP that the function actually bound to, which\n"
-+ "could be different from the SAP requested.\n"
-+ "See dlpi_bind(3DLPI).\n"
-+);
-+static PyObject *
-+link_bind(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ uint_t sap = 0, boundsap = 0;
-+ static char *keywords[] = {"sap", NULL};
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "I", keywords, &sap))
-+ return (NULL);
-+
-+ if ((rval = dlpi_bind(link->dlpihdl, sap, &boundsap)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("I", boundsap));
-+}
-+
-+PyDoc_STRVAR(unbind_doc,
-+ "unbind() -> None\n"
-+ "\n"
-+ "Attempts to unbind the link from previously bound sap.\n"
-+ "See dlpi_unbind(3DLPI).\n"
-+);
-+static PyObject *
-+link_unbind(pylink_t *link)
-+{
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((rval = dlpi_unbind(link->dlpihdl)) != DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ Py_INCREF(Py_None);
-+ return (Py_None);
-+}
-+
-+PyDoc_STRVAR(send_doc,
-+ "send(destaddr, message[, sap, minpri, maxpri]) -> None\n"
-+ "\n"
-+ "Attempts to send message over this link to sap on destaddr.\n"
-+ "If SAP is not specified, the bound SAP is used\n"
-+ "You can also specify priority range (minpri, maxpri).\n"
-+ "See dlpi_send(3DLPI).\n"
-+);
-+static PyObject *
-+link_send(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ char *daddr = NULL, *msgbuf = NULL;
-+ size_t daddrlen = 0, msglen = 0;
-+ t_scalar_t minpri = DL_QOS_DONT_CARE, maxpri = DL_QOS_DONT_CARE;
-+ uint_t sap = DLPI_ANY_SAP;
-+ dlpi_sendinfo_t ds, *dsp = NULL;
-+ static char *keywords[] =
-+ {"destaddr", "message", "sap", "minpri", "maxpri", NULL};
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s#s#|Iii", keywords,
-+ &daddr, &daddrlen, &msgbuf, &msglen, &sap, &minpri, &maxpri))
-+ return (NULL);
-+
-+ if ((sap != DLPI_ANY_SAP) || (minpri != DL_QOS_DONT_CARE) ||
-+ (maxpri != DL_QOS_DONT_CARE)) {
-+ ds.dsi_sap = sap;
-+ ds.dsi_prio.dl_min = minpri;
-+ ds.dsi_prio.dl_max = maxpri;
-+ dsp = &ds;
-+ }
-+
-+ if ((rval = dlpi_send(link->dlpihdl, daddr, daddrlen,
-+ msgbuf, msglen, dsp)) != DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ Py_INCREF(Py_None);
-+ return (Py_None);
-+}
-+
-+PyDoc_STRVAR(recv_doc,
-+ "recv(msglen[, timeout]) -> (string, string), or (None, None)\n"
-+ "\n"
-+ "Attempts to receive message over this link.\n"
-+ "You need to specify the message length for the received message.\n"
-+ "And you can specify timeout value in milliseconds.\n"
-+ "The default timeout value is -1 (wait forever).\n"
-+ "Returns (source address, message data), or (None, None) when error occurs.\n"
-+ "See dlpi_recv(3DLPI).\n"
-+);
-+static PyObject *
-+link_recv(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ PyObject *obj;
-+ char *saddr = NULL, *msgbuf = NULL;
-+ size_t saddrlen = 0, msglen = 0, *saddrlenp = NULL, *msglenp = NULL;
-+ int msec = -1; /* block until receive data */
-+ static char *keywords[] = {"msglen", "timeout", NULL};
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "k|i",
-+ keywords, &msglen, &msec))
-+ return (NULL);
-+
-+ if (msglen > 0) {
-+ msgbuf = malloc(msglen);
-+ if (msgbuf == NULL) {
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+ saddrlen = DLPI_PHYSADDR_MAX;
-+ saddr = malloc(saddrlen);
-+ if (saddr == NULL) {
-+ dlpi_raise_exception(DL_SYSERR);
-+ free(msgbuf);
-+ return (NULL);
-+ }
-+ msglenp = &msglen;
-+ saddrlenp = &saddrlen;
-+ }
-+
-+ if ((rval = dlpi_recv(link->dlpihdl, saddr, saddrlenp, msgbuf,
-+ msglenp, msec, NULL)) != DLPI_SUCCESS) {
-+ if (msgbuf != NULL)
-+ free(msgbuf);
-+ if (saddr != NULL)
-+ free(saddr);
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ obj = Py_BuildValue("s#s#", saddr, saddrlen, msgbuf, msglen);
-+ if (msgbuf != NULL)
-+ free(msgbuf);
-+ if (saddr != NULL)
-+ free(saddr);
-+ return (obj);
-+}
-+
-+PyDoc_STRVAR(disabmulti_doc,
-+ "disabmulti(address) -> None\n"
-+ "\n"
-+ "Disable a specified multicast address on this link.\n"
-+ "See dlpi_disabmulti(3DLPI).\n"
-+);
-+static PyObject *
-+link_disabmulti(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ char *addr = NULL;
-+ size_t addrlen = 0;
-+ static char *keywords[] = {"address", NULL};
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s#", keywords,
-+ &addr, &addrlen))
-+ return (NULL);
-+
-+ if ((addrlen == 0) || (addrlen > DLPI_PHYSADDR_MAX)) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((rval = dlpi_disabmulti(link->dlpihdl, addr, addrlen)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ Py_INCREF(Py_None);
-+ return (Py_None);
-+}
-+
-+PyDoc_STRVAR(enabmulti_doc,
-+ "enabmulti(address) -> None\n"
-+ "\n"
-+ "Enable a specified multicast address on this link.\n"
-+ "See dlpi_enabmulti(3DLPI).\n"
-+);
-+static PyObject *
-+link_enabmulti(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ char *addr = NULL;
-+ size_t addrlen = 0;
-+ static char *keywords[] = {"address", NULL};
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s#", keywords,
-+ &addr, &addrlen))
-+ return (NULL);
-+
-+ if ((addrlen == 0) || (addrlen > DLPI_PHYSADDR_MAX)) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((rval = dlpi_enabmulti(link->dlpihdl, addr, addrlen)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ Py_INCREF(Py_None);
-+ return (Py_None);
-+}
-+
-+static void
-+dlpi_callback(dlpi_handle_t hdl, dlpi_notifyinfo_t *ni, void *arg)
-+{
-+ callback_data_t *cd = (callback_data_t *)arg;
-+ PyObject *arglist, *result;
-+
-+ switch (ni->dni_note) {
-+ case DL_NOTE_SPEED:
-+ arglist = Py_BuildValue("(OII)",
-+ cd->pyarg, ni->dni_note, ni->dni_speed);
-+ break;
-+ case DL_NOTE_SDU_SIZE:
-+ arglist = Py_BuildValue("(OII)",
-+ cd->pyarg, ni->dni_note, ni->dni_size);
-+ break;
-+ case DL_NOTE_PHYS_ADDR:
-+ arglist = Py_BuildValue("(OIs#)",
-+ cd->pyarg, ni->dni_note, ni->dni_physaddr,
-+ ni->dni_physaddrlen);
-+ break;
-+ default:
-+ arglist = Py_BuildValue("(OIO)", cd->pyarg, ni->dni_note,
-+ Py_None);
-+ }
-+
-+ result = PyEval_CallObject(cd->pyfunc, arglist);
-+ Py_DECREF(arglist);
-+ if (result == NULL) {
-+ PyErr_Clear(); /* cannot raise error */
-+ }
-+ Py_DECREF(result);
-+ Py_DECREF(cd->pyfunc);
-+ Py_XDECREF(cd->pyarg);
-+ free(cd);
-+}
-+
-+PyDoc_STRVAR(enabnotify_doc,
-+ "enabnotify(events, function[, arg]) -> unsigned long\n"
-+ "\n"
-+ "Enables a notification callback for the set of specified events,\n"
-+ "which must be one or more (by a logical OR) events listed as below:\n"
-+ "NOTE_LINK_DOWN Notify when link has gone down\n"
-+ "NOTE_LINK_UP Notify when link has come up\n"
-+ "NOTE_PHYS_ADDR Notify when address changes\n"
-+ "NOTE_SDU_SIZE Notify when MTU changes\n"
-+ "NOTE_SPEED Notify when speed changes\n"
-+ "NOTE_PROMISC_ON_PHYS Notify when PROMISC_PHYS is set\n"
-+ "NOTE_PROMISC_OFF_PHYS Notify when PROMISC_PHYS is cleared\n"
-+ "Returns a handle for this registration.\n"
-+ "See dlpi_enabnotify(3DLPI).\n"
-+);
-+static PyObject *
-+link_enabnotify(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ PyObject *func = NULL, *arg = NULL;
-+ callback_data_t *cd;
-+ uint_t notes = 0;
-+ static char *keywords[] = {"events", "function", "arg", NULL};
-+ dlpi_notifyid_t id;
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "IO|O",
-+ keywords, ¬es, &func, &arg))
-+ return (NULL);
-+
-+ if (!PyCallable_Check(func)) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ cd = malloc(sizeof(callback_data_t));
-+ if (cd == NULL) {
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+ Py_INCREF(func);
-+ Py_XINCREF(arg);
-+ cd->pyfunc = func;
-+ cd->pyarg = arg;
-+
-+ if ((rval = dlpi_enabnotify(link->dlpihdl, notes, dlpi_callback,
-+ cd, &id)) != DLPI_SUCCESS) {
-+ free(cd);
-+ Py_DECREF(func);
-+ Py_XDECREF(arg);
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("k", id));
-+}
-+
-+PyDoc_STRVAR(disabnotify_doc,
-+ "disabnotify(handle) -> argument object, or None\n"
-+ "\n"
-+ "Disables the notification registration associated with handle.\n"
-+ "You should get this handle by calling enabnotify().\n"
-+ "Returns the argument passed in when registering the callback, or None.\n"
-+ "See dlpi_disabnotify(3DLPI).\n"
-+);
-+static PyObject *
-+link_disabnotify(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ dlpi_notifyid_t id;
-+ callback_data_t *arg;
-+ PyObject *pyargsaved;
-+ static char *keywords[] = {"handle", NULL};
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "k", keywords, &id))
-+ return (NULL);
-+
-+ if ((rval = dlpi_disabnotify(link->dlpihdl, id, (void **)&arg)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ /* clean up */
-+ pyargsaved = arg->pyarg;
-+ Py_XINCREF(pyargsaved);
-+ Py_XDECREF(arg->pyarg);
-+ Py_DECREF(arg->pyfunc);
-+ free(arg);
-+
-+ if (pyargsaved != NULL)
-+ return (pyargsaved);
-+
-+ Py_INCREF(Py_None);
-+ return (Py_None);
-+}
-+
-+PyDoc_STRVAR(get_sap_doc,
-+ "get_sap() -> unsigned int\n"
-+ "\n"
-+ "Returns the sap bound to this link.\n"
-+ "See dlpi_info(3DLPI).\n"
-+);
-+static PyObject *
-+link_get_sap(pylink_t *link)
-+{
-+ dlpi_info_t info;
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("I", info.di_sap));
-+}
-+
-+PyDoc_STRVAR(get_fd_doc,
-+ "get_fd() -> int\n"
-+ "\n"
-+ "Returns the integer file descriptor that can be used to directly\n"
-+ "operate on the link.\n"
-+ "See dlpi_fd(3DLPI).\n"
-+);
-+static PyObject *
-+link_get_fd(pylink_t *link)
-+{
-+ int fd;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((fd = dlpi_fd(link->dlpihdl)) == -1) {
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("i", fd));
-+}
-+
-+PyDoc_STRVAR(get_linkname_doc,
-+ "get_linkname() -> string\n"
-+ "\n"
-+ "Returns the name of the link.\n"
-+ "See dlpi_linkname(3DLPI).\n"
-+);
-+static PyObject *
-+link_get_linkname(pylink_t *link)
-+{
-+ const char *name = NULL;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((name = dlpi_linkname(link->dlpihdl)) == NULL) {
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("s", name));
-+}
-+
-+PyDoc_STRVAR(get_bcastaddr_doc,
-+ "get_bcastaddr() -> string, or None\n"
-+ "\n"
-+ "Returns the broadcast address of the link.\n"
-+ "Returns None if the broadcast address is empty.\n"
-+ "See dlpi_info(3DLPI).\n"
-+);
-+static PyObject *
-+link_get_bcastaddr(pylink_t *link)
-+{
-+ char *addr[DLPI_PHYSADDR_MAX];
-+ size_t addrlen = 0;
-+ dlpi_info_t info;
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ if (info.di_bcastaddrlen == 0) {
-+ Py_INCREF(Py_None);
-+ return (Py_None);
-+ }
-+
-+ return (Py_BuildValue("s#", info.di_bcastaddr, info.di_bcastaddrlen));
-+}
-+
-+PyDoc_STRVAR(get_physaddr_doc,
-+ "get_physaddr(addrtype) -> string, or None\n"
-+ "\n"
-+ "Addrtype can be any one of the value listed below:\n"
-+ "FACT_PHYS_ADDR Factory physical address\n"
-+ "CURR_PHYS_ADDR Current physical address\n"
-+ "Returns the corresponding physical address of the link.\n"
-+ "See dlpi_get_physaddr(3DLPI).\n"
-+);
-+static PyObject *
-+link_get_physaddr(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ char *addr[DLPI_PHYSADDR_MAX];
-+ size_t addrlen = DLPI_PHYSADDR_MAX;
-+ static char *keywords[] = {"addrtype", NULL};
-+ uint_t type;
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "I", keywords, &type))
-+ return (NULL);
-+
-+ if ((rval = dlpi_get_physaddr(link->dlpihdl, type, addr, &addrlen)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("s#", addr, addrlen));
-+}
-+
-+PyDoc_STRVAR(set_physaddr_doc,
-+ "set_physaddr(address) -> None\n"
-+ "\n"
-+ "Sets the physical address of the link.\n"
-+ "See dlpi_set_physaddr(3DLPI).\n"
-+);
-+static PyObject *
-+link_set_physaddr(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ char *addr = NULL;
-+ size_t addrlen = 0;
-+ static char *keywords[] = {"address", NULL};
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s#", keywords,
-+ &addr, &addrlen))
-+ return (NULL);
-+
-+ if ((rval = dlpi_set_physaddr(link->dlpihdl, DL_CURR_PHYS_ADDR,
-+ addr, addrlen)) != DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ Py_INCREF(Py_None);
-+ return (Py_None);
-+}
-+
-+PyDoc_STRVAR(promiscon_doc,
-+ "promiscon([level]) -> None\n"
-+ "\n"
-+ "Enables promiscuous mode for the link at levels:\n"
-+ "PROMISC_PHYS Promiscuous mode at the physical level(default)\n"
-+ "PROMISC_SAP Promiscuous mode at the SAP level\n"
-+ "PROMISC_MULTI Promiscuous mode for all multicast addresses\n"
-+ "See dlpi_promiscon(3DLPI).\n"
-+);
-+static PyObject *
-+link_promiscon(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ uint_t level = DL_PROMISC_PHYS;
-+ static char *keywords[] = {"level", NULL};
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|I", keywords, &level))
-+ return (NULL);
-+
-+ if ((rval = dlpi_promiscon(link->dlpihdl, level)) != DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ Py_INCREF(Py_None);
-+ return (Py_None);
-+}
-+
-+PyDoc_STRVAR(promiscoff_doc,
-+ "promiscoff([level]) -> None\n"
-+ "\n"
-+ "Disables promiscuous mode for the link at levels:\n"
-+ "PROMISC_PHYS Promiscuous mode at the physical level(default)\n"
-+ "PROMISC_SAP Promiscuous mode at the SAP level\n"
-+ "PROMISC_MULTI Promiscuous mode for all multicast addresses\n"
-+ "See dlpi_promiscoff(3DLPI).\n"
-+);
-+static PyObject *
-+link_promiscoff(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ uint_t level = DL_PROMISC_PHYS;
-+ static char *keywords[] = {"level", NULL};
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|I", keywords, &level))
-+ return (NULL);
-+
-+ if ((rval = dlpi_promiscoff(link->dlpihdl, level)) != DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ Py_INCREF(Py_None);
-+ return (Py_None);
-+}
-+
-+PyDoc_STRVAR(get_timeout_doc,
-+ "get_timeout() -> int\n"
-+ "\n"
-+ "Returns current time out value of the link.\n"
-+ "See dlpi_info(3DLPI).\n"
-+);
-+static PyObject *
-+link_get_timeout(pylink_t *link)
-+{
-+ dlpi_info_t info;
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("i", info.di_timeout));
-+}
-+
-+PyDoc_STRVAR(get_mactype_doc,
-+ "get_mactype() -> unsigned char\n"
-+ "\n"
-+ "Returns MAC type of the link.\n"
-+ "See <sys/dlpi.h> for the list of possible MAC types.\n"
-+ "See dlpi_info(3DLPI).\n"
-+);
-+static PyObject *
-+link_get_mactype(pylink_t *link)
-+{
-+ dlpi_info_t info;
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("B", info.di_mactype));
-+}
-+
-+PyDoc_STRVAR(set_timeout_doc,
-+ "set_timeout(timeout) -> None\n"
-+ "\n"
-+ "Sets time out value of the link (default value: DEF_TIMEOUT).\n"
-+ "See dlpi_set_timeout(3DLPI).\n"
-+);
-+static PyObject *
-+link_set_timeout(pylink_t *link, PyObject *args, PyObject *kwds)
-+{
-+ int timeout = DLPI_DEF_TIMEOUT;
-+ static char *keywords[] = {"timeout", NULL};
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", keywords, &timeout))
-+ return (NULL);
-+
-+ if ((rval = dlpi_set_timeout(link->dlpihdl, timeout)) != DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ Py_INCREF(Py_None);
-+ return (Py_None);
-+}
-+
-+PyDoc_STRVAR(get_sdu_doc,
-+ "get_sdu() -> (unsigned int, unsigned int)\n"
-+ "\n"
-+ "Returns (min sdu, max sdu).\n"
-+ "See dlpi_info(3DLPI).\n"
-+);
-+static PyObject *
-+link_get_sdu(pylink_t *link)
-+{
-+ dlpi_info_t info;
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("II", info.di_min_sdu, info.di_max_sdu));
-+}
-+
-+PyDoc_STRVAR(get_state_doc,
-+ "get_state() -> unsigned int\n"
-+ "\n"
-+ "Returns current state of the link (either UNBOUND or IDLE).\n"
-+ "See dlpi_info(3DLPI).\n"
-+);
-+static PyObject *
-+link_get_state(pylink_t *link)
-+{
-+ dlpi_info_t info;
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("I", info.di_state));
-+}
-+
-+PyDoc_STRVAR(get_qos_select_doc,
-+ "get_qos_select() -> (unsigned int, int, int, int)\n"
-+ "\n"
-+ "Returns (qos type, trans delay, priority, residul err).\n"
-+ "Unsupported QOS parameters are set to UNKNOWN.\n"
-+ "See dlpi_info(3DLPI).\n"
-+);
-+static PyObject *
-+link_get_qos_select(pylink_t *link)
-+{
-+ dlpi_info_t info;
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("Iiiii",
-+ info.di_qos_sel.dl_qos_type,
-+ info.di_qos_sel.dl_trans_delay,
-+ info.di_qos_sel.dl_priority,
-+ info.di_qos_sel.dl_residual_error));
-+}
-+
-+PyDoc_STRVAR(get_qos_range_doc,
-+ "get_qos_range() -> \n"
-+ " (unsigned int, (int, int), (int, int), (int, int), int)\n"
-+ "\n"
-+ "Returns (qos type, (trans delay target, trans delay accept),\n"
-+ "(min priority, max priority), (min protection, max protection),\n"
-+ "residual err).\n"
-+ "Unsupported QOS range values are set to UNKNOWN.\n"
-+ "See dlpi_info(3DLPI).\n"
-+);
-+static PyObject *
-+link_get_qos_range(pylink_t *link)
-+{
-+ dlpi_info_t info;
-+ int rval;
-+
-+ if (link->dlpihdl == NULL) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
-+ DLPI_SUCCESS) {
-+ dlpi_raise_exception(rval);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("I(ii)(ii)(ii)i",
-+ info.di_qos_range.dl_qos_type,
-+ info.di_qos_range.dl_trans_delay.dl_target_value,
-+ info.di_qos_range.dl_trans_delay.dl_accept_value,
-+ info.di_qos_range.dl_priority.dl_min,
-+ info.di_qos_range.dl_priority.dl_max,
-+ info.di_qos_range.dl_protection.dl_min,
-+ info.di_qos_range.dl_protection.dl_max,
-+ info.di_qos_range.dl_residual_error));
-+}
-+
-+static PyMethodDef pylink_methods[] = {
-+ {"bind", (PyCFunction)link_bind, METH_VARARGS|METH_KEYWORDS, bind_doc},
-+ {"unbind", (PyCFunction)link_unbind, METH_NOARGS, unbind_doc},
-+ {"send", (PyCFunction)link_send, METH_VARARGS|METH_KEYWORDS,
-+ send_doc},
-+ {"recv", (PyCFunction)link_recv, METH_VARARGS|METH_KEYWORDS,
-+ recv_doc},
-+ {"disabmulti", (PyCFunction)link_disabmulti, METH_VARARGS|METH_KEYWORDS,
-+ disabmulti_doc},
-+ {"enabmulti", (PyCFunction)link_enabmulti, METH_VARARGS|METH_KEYWORDS,
-+ enabmulti_doc},
-+ {"enabnotify", (PyCFunction)link_enabnotify,
-+ METH_VARARGS|METH_KEYWORDS, enabnotify_doc},
-+ {"disabnotify", (PyCFunction)link_disabnotify,
-+ METH_VARARGS|METH_KEYWORDS, disabnotify_doc},
-+ {"get_fd", (PyCFunction)link_get_fd, METH_NOARGS, get_fd_doc},
-+ {"get_sap", (PyCFunction)link_get_sap, METH_NOARGS, get_sap_doc},
-+ {"get_mactype", (PyCFunction)link_get_mactype, METH_NOARGS,
-+ get_mactype_doc},
-+ {"get_linkname", (PyCFunction)link_get_linkname, METH_NOARGS,
-+ get_linkname_doc},
-+ {"get_bcastaddr", (PyCFunction)link_get_bcastaddr, METH_NOARGS,
-+ get_bcastaddr_doc},
-+ {"get_physaddr", (PyCFunction)link_get_physaddr,
-+ METH_VARARGS|METH_KEYWORDS, get_physaddr_doc},
-+ {"set_physaddr", (PyCFunction)link_set_physaddr,
-+ METH_VARARGS|METH_KEYWORDS, set_physaddr_doc},
-+ {"promiscon", (PyCFunction)link_promiscon, METH_VARARGS|METH_KEYWORDS,
-+ promiscon_doc},
-+ {"promiscoff", (PyCFunction)link_promiscoff, METH_VARARGS|METH_KEYWORDS,
-+ promiscoff_doc},
-+ {"get_timeout", (PyCFunction)link_get_timeout, METH_NOARGS,
-+ get_timeout_doc},
-+ {"set_timeout", (PyCFunction)link_set_timeout,
-+ METH_VARARGS|METH_KEYWORDS, set_timeout_doc},
-+ {"get_sdu", (PyCFunction)link_get_sdu, METH_NOARGS, get_sdu_doc},
-+ {"get_state", (PyCFunction)link_get_state, METH_NOARGS,
-+ get_state_doc},
-+ {"get_qos_select", (PyCFunction)link_get_qos_select, METH_NOARGS,
-+ get_qos_select_doc},
-+ {"get_qos_range", (PyCFunction)link_get_qos_range, METH_NOARGS,
-+ get_qos_range_doc},
-+ {NULL}
-+};
-+
-+static PyTypeObject pylink_type = {
-+ PyObject_HEAD_INIT(0) /* Must fill in type value later */
-+ 0, /* ob_size */
-+ "dlpi.link", /* tp_name */
-+ sizeof(pylink_t), /* tp_basicsize */
-+ 0, /* tp_itemsize */
-+ (destructor)link_dealloc, /* tp_dealloc */
-+ 0, /* tp_print */
-+ 0, /* tp_getattr */
-+ 0, /* tp_setattr */
-+ 0, /* tp_compare */
-+ 0, /* tp_repr */
-+ 0, /* tp_as_number */
-+ 0, /* tp_as_sequence */
-+ 0, /* tp_as_mapping */
-+ 0, /* tp_hash */
-+ 0, /* tp_call */
-+ 0, /* tp_str */
-+ 0, /* tp_getattro */
-+ 0, /* tp_setattro */
-+ 0, /* tp_as_buffer */
-+ Py_TPFLAGS_DEFAULT, /* tp_flags */
-+ link_doc, /* tp_doc */
-+ 0, /* tp_traverse */
-+ 0, /* tp_clear */
-+ 0, /* tp_richcompare */
-+ 0, /* tp_weaklistoffset */
-+ 0, /* tp_iter */
-+ 0, /* tp_iternext */
-+ pylink_methods, /* tp_methods */
-+ 0, /* tp_members */
-+ 0, /* tp_getset */
-+ 0, /* tp_base */
-+ 0, /* tp_dict */
-+ 0, /* tp_descr_get */
-+ 0, /* tp_descr_set */
-+ 0, /* tp_dictoffset */
-+ (initproc)link_init, /* tp_init */
-+ 0, /* tp_alloc */
-+ PyType_GenericNew, /* tp_new */
-+ 0, /* tp_free */
-+};
-+
-+PyDoc_STRVAR(arptype_doc,
-+ "arptype(arptype) -> unsigned int\n"
-+ "\n"
-+ "Converts a DLPI MAC type to an ARP hardware type defined\n"
-+ " in <netinet/arp.h>\n"
-+ "See dlpi_arptype(3DLPI)\n"
-+);
-+static PyObject *
-+arptype(PyObject *dlpi, PyObject *args, PyObject *kwds)
-+{
-+ static char *keywords[] = {"arptype", NULL};
-+ uint_t dlpityp, arptyp;
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "I", keywords, &dlpityp))
-+ return (NULL);
-+
-+ if ((arptyp = dlpi_arptype(dlpityp)) == 0) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("I", arptyp));
-+}
-+
-+PyDoc_STRVAR(iftype_doc,
-+ "iftype(iftype) -> unsigned int\n"
-+ "\n"
-+ "Converts a DLPI MAC type to a BSD socket interface type\n"
-+ "defined in <net/if_types.h>\n"
-+ "See dlpi_iftype(3DLPI)\n"
-+);
-+static PyObject *
-+iftype(PyObject *dlpi, PyObject *args, PyObject *kwds)
-+{
-+ static char *keywords[] = {"iftype", NULL};
-+ uint_t dlpityp, iftyp;
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "I", keywords, &dlpityp))
-+ return (NULL);
-+
-+ if ((iftyp = dlpi_iftype(dlpityp)) == 0) {
-+ errno = EINVAL;
-+ dlpi_raise_exception(DL_SYSERR);
-+ return (NULL);
-+ }
-+
-+ return (Py_BuildValue("I", iftyp));
-+}
-+
-+PyDoc_STRVAR(mactype_doc,
-+ "mactype(mactype) -> string\n"
-+ "\n"
-+ "Returns a string that describes the specified mactype.\n"
-+ "Valid mac types are defined in <sys/dlpi.h>.\n"
-+ "See dlpi_mactype(3DLPI)\n"
-+);
-+static PyObject *
-+mactype(PyObject *dlpi, PyObject *args, PyObject *kwds)
-+{
-+ static char *keywords[] = {"mactype", NULL};
-+ uint_t mactyp;
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "I", keywords, &mactyp))
-+ return (NULL);
-+
-+ return (Py_BuildValue("s", dlpi_mactype(mactyp)));
-+}
-+
-+static boolean_t
-+link_walker(const char *name, void *arg)
-+{
-+ PyObject *linkname;
-+ PyObject *list = (PyObject *)arg;
-+
-+ if ((list == NULL) || !PyList_Check(list))
-+ return (_B_FALSE);
-+
-+ linkname = Py_BuildValue("s", name);
-+ if (PyList_Append(list, linkname) == -1)
-+ return (_B_TRUE);
-+
-+ Py_DECREF(linkname);
-+ return (_B_FALSE);
-+}
-+
-+PyDoc_STRVAR(listlink_doc,
-+ "listlink() -> list\n"
-+ "\n"
-+ "Returns a list containing link names of all links on the system.\n"
-+);
-+static PyObject *
-+listlink(PyObject *dlpi)
-+{
-+ PyObject *list;
-+
-+ if ((list = PyList_New(0)) == NULL)
-+ return (NULL);
-+
-+ dlpi_walk(link_walker, list, 0);
-+ return (list);
-+}
-+
-+static PyMethodDef dlpi_methods[] = {
-+ {"arptype", (PyCFunction)arptype, METH_VARARGS|METH_KEYWORDS,
-+ arptype_doc},
-+ {"iftype", (PyCFunction)iftype, METH_VARARGS|METH_KEYWORDS,
-+ iftype_doc},
-+ {"mactype", (PyCFunction)mactype, METH_VARARGS|METH_KEYWORDS,
-+ mactype_doc},
-+ {"listlink", (PyCFunction)listlink, METH_NOARGS, listlink_doc},
-+ {NULL}
-+};
-+
-+PyMODINIT_FUNC
-+initdlpi(void)
-+{
-+ PyObject *mod;
-+
-+ if (PyType_Ready(&pylink_type) < 0)
-+ return;
-+
-+ mod = Py_InitModule("dlpi", dlpi_methods);
-+ if (mod == NULL)
-+ return;
-+
-+ dlpi_err = PyErr_NewException("dlpi.error", NULL, NULL);
-+ if (dlpi_err == NULL)
-+ return;
-+ PyModule_AddObject(mod, "error", dlpi_err);
-+
-+ Py_INCREF(&pylink_type);
-+ PyModule_AddObject(mod, "link", (PyObject *)&pylink_type);
-+ PyModule_AddIntConstant(mod, "PASSIVE", DLPI_PASSIVE);
-+ PyModule_AddIntConstant(mod, "RAW", DLPI_RAW);
-+ PyModule_AddIntConstant(mod, "NATIVE", DLPI_NATIVE);
-+ PyModule_AddIntConstant(mod, "ANY_SAP", DLPI_ANY_SAP);
-+ PyModule_AddIntConstant(mod, "DEF_TIMEOUT", DLPI_DEF_TIMEOUT);
-+ PyModule_AddIntConstant(mod, "NOTE_LINK_DOWN", DL_NOTE_LINK_DOWN);
-+ PyModule_AddIntConstant(mod, "NOTE_LINK_UP", DL_NOTE_LINK_UP);
-+ PyModule_AddIntConstant(mod, "NOTE_PHYS_ADDR", DL_NOTE_PHYS_ADDR);
-+ PyModule_AddIntConstant(mod, "NOTE_SDU_SIZE", DL_NOTE_SDU_SIZE);
-+ PyModule_AddIntConstant(mod, "NOTE_SPEED", DL_NOTE_SPEED);
-+ PyModule_AddIntConstant(mod, "NOTE_PROMISC_ON_PHYS",
-+ DL_NOTE_PROMISC_ON_PHYS);
-+ PyModule_AddIntConstant(mod, "NOTE_PROMISC_OFF_PHYS",
-+ DL_NOTE_PROMISC_OFF_PHYS);
-+ PyModule_AddIntConstant(mod, "FACT_PHYS_ADDR", DL_FACT_PHYS_ADDR);
-+ PyModule_AddIntConstant(mod, "CURR_PHYS_ADDR", DL_CURR_PHYS_ADDR);
-+ PyModule_AddIntConstant(mod, "PROMISC_PHYS", DL_PROMISC_PHYS);
-+ PyModule_AddIntConstant(mod, "PROMISC_SAP", DL_PROMISC_SAP);
-+ PyModule_AddIntConstant(mod, "PROMISC_MULTI", DL_PROMISC_MULTI);
-+ PyModule_AddIntConstant(mod, "UNKNOWN", DL_UNKNOWN);
-+ PyModule_AddIntConstant(mod, "UNBOUND", DL_UNBOUND);
-+ PyModule_AddIntConstant(mod, "IDLE", DL_IDLE);
-+ PyModule_AddIntConstant(mod, "SYSERR", DL_SYSERR);
-+}
-diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
---- Python-2.6.4/setup.py
-+++ Python-2.6.4/setup.py
-@@ -1284,6 +1284,12 @@
- exts.append( Extension('ucred', ['ucred.c'],
- libraries = ['tsol']) )
-
-+ # dlpi module (Solaris)
-+ dlpi_inc = find_file('libdlpi.h', [], inc_dirs)
-+ if dlpi_inc is not None:
-+ exts.append( Extension('dlpi', ['dlpimodule.c'],
-+ libraries = ['dlpi']) )
-+
- # Thomas Heller's _ctypes module
- self.detect_ctypes(inc_dirs, lib_dirs)
-
-diff --git Python-2.6.4/lib/test/dlpitest.py Python-2.6.4/Lib/test/dlpitest.py
-new file mode 100644
---- /dev/null 2011-02-12 03:13:26.000000000 -0600
-+++ Python-2.6.4/Lib/test/dlpitest.py 2011-01-20 13:52:42.895865414 -0600
-@@ -0,0 +1,96 @@
-+#!/usr/bin/python2.6
-+
-+import dlpi
-+import sys
-+import time
-+import struct
-+
-+#test listlink
-+linklist = dlpi.listlink()
-+print "Found %d links:" % len(linklist)
-+print linklist
-+
-+#pick up the first data link for below testing
-+linkname = linklist[0]
-+
-+#open link
-+print "opening link: " + linkname + "..."
-+testlink = dlpi.link(linkname)
-+
-+#read some info of testlink
-+print "linkname is %s" % testlink.get_linkname()
-+print "link fd is %d" % testlink.get_fd()
-+mactype = testlink.get_mactype()
-+print "dlpi mactype is %d" % mactype
-+print "after convert:"
-+print "\tmactype is %s" % dlpi.mactype(mactype)
-+print "\tiftype is %d" % dlpi.iftype(mactype)
-+print "\tarptype is %d" % dlpi.arptype(mactype)
-+bcastaddr = testlink.get_bcastaddr()
-+print "broadcast addr is: ",
-+print struct.unpack("BBBBBB",bcastaddr)
-+physaddr = testlink.get_physaddr(dlpi.FACT_PHYS_ADDR)
-+print "factory physical address is: ",
-+print struct.unpack("BBBBBB",physaddr)
-+print "current timeout value is %d" % testlink.get_timeout()
-+print "sdu is:",
-+print testlink.get_sdu()
-+print "qos select is:",
-+print testlink.get_qos_select()
-+print "qos range is:",
-+print testlink.get_qos_range()
-+
-+#set some config value of testlink and read them again
-+print "setting current physiacal addr to aa:0:10:13:27:5"
-+testlink.set_physaddr('\xaa\0\x10\x13\x27\5')
-+physaddr = testlink.get_physaddr(dlpi.CURR_PHYS_ADDR)
-+print "current physical addr is: ",
-+print struct.unpack("BBBBBB",physaddr)
-+print "set timeout value to 6..."
-+testlink.set_timeout(6)
-+print "timeout value is %d" % testlink.get_timeout()
-+
-+#test enable/disable multicast
-+print "enable/disable multicast address 1:0:5e:0:0:5"
-+testlink.enabmulti('\1\0\x5e\0\0\5')
-+testlink.disabmulti('\1\0\x5e\0\0\5')
-+
-+#test bind
-+print "binding to SAP 0x9000..."
-+testlink.bind(0x9000)
-+print "sap is %x" % testlink.get_sap()
-+print "state is: %d" % testlink.get_state()
-+
-+#test send
-+print "sending broadcast loopback packet..."
-+testlink.send(bcastaddr, '\0\1\2\3\4\5')
-+
-+#test notify functionality
-+arg = "notification callback arg"
-+def notify(arg, notes, value):
-+ print "NOTE_PROMISC_ON_PHYS notification received with arg: '%s'" % arg
-+print "enabled notification on NOTE_PROMISC_ON_PHYS"
-+id = testlink.enabnotify(dlpi.NOTE_PROMISC_ON_PHYS, notify, arg) #enable notification
-+testlink.promiscon() #trigger the event (will be seen while receiving pkt below)
-+
-+#test receive
-+print "testing receiving..."
-+try:
-+ testlink.recv(0, 0) #should see NOTE_PROMISC_ON_PHYS event here
-+except dlpi.error, err:
-+ errnum, errinfo = err
-+ if errnum == 10006:
-+ pass #timeout error is expected here
-+ else: #test fails if reach here
-+ print "test failed",
-+ print errnum,
-+ print err
-+
-+testlink.promiscoff()
-+testlink.disabnotify(id) #disable notification
-+
-+#test unbind
-+print "unbinding..."
-+testlink.unbind()
-+print "sap is %x" % testlink.get_sap()
-+print "state is: %d" % testlink.get_state()
--- a/components/python/python26/Python26-12-encoding-alias.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-diff --git Python-2.6.4/Lib/encodings/aliases.py Python-2.6.4/Lib/encodings/aliases.py
---- Python-2.6.4/Lib/encodings/aliases.py
-+++ Python-2.6.4/Lib/encodings/aliases.py
-@@ -73,6 +73,7 @@
-
- # cp1251 codec
- '1251' : 'cp1251',
-+ 'ansi_1251' : 'cp1251',
- 'windows_1251' : 'cp1251',
-
- # cp1252 codec
-@@ -217,6 +218,7 @@
- 'u_jis' : 'euc_jp',
-
- # euc_kr codec
-+ '5601' : 'euc_kr',
- 'euckr' : 'euc_kr',
- 'korean' : 'euc_kr',
- 'ksc5601' : 'euc_kr',
-@@ -457,6 +459,7 @@
- 'shiftjis' : 'shift_jis',
- 'sjis' : 'shift_jis',
- 's_jis' : 'shift_jis',
-+ 'pck' : 'shift_jis',
-
- # shift_jis_2004 codec
- 'shiftjis2004' : 'shift_jis_2004',
-@@ -476,6 +479,7 @@
- 'tis_620_0' : 'tis_620',
- 'tis_620_2529_0' : 'tis_620',
- 'tis_620_2529_1' : 'tis_620',
-+ 'tis620.2533' : 'tis_620',
- 'iso_ir_166' : 'tis_620',
-
- # utf_16 codec
--- a/components/python/python26/Python26-13-cflags.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-diff --git Python-2.6.4/configure.in Python-2.6.4/configure.in
---- Python-2.6.4/configure.in
-+++ Python-2.6.4/configure.in
-@@ -1110,6 +1110,8 @@
- # environment?
- Darwin*)
- ;;
-+ SunOS*)
-+ ;;
- *)
- BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
- ;;
--- a/components/python/python26/Python26-14-ctypes-util-find-library.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-diff --git Python-2.6.4/Lib/ctypes/util.py Python-2.6.4/Lib/ctypes/util.py
---- Python-2.6.4/Lib/ctypes/util.py
-+++ Python-2.6.4/Lib/ctypes/util.py
-@@ -164,6 +164,35 @@
- res.sort(cmp= lambda x,y: cmp(_num_version(x), _num_version(y)))
- return res[-1]
-
-+ elif sys.platform == "sunos5":
-+
-+ def _findLib_crle(name, is64):
-+ if not os.path.exists('/usr/bin/crle'):
-+ return None
-+
-+ if is64:
-+ cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null'
-+ else:
-+ cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null'
-+
-+ for line in os.popen(cmd).readlines():
-+ line = line.strip()
-+ if (line.startswith('Default Library Path (ELF):')):
-+ paths = line.split()[4]
-+
-+ if not paths:
-+ return None
-+
-+ for dir in paths.split(":"):
-+ libfile = os.path.join(dir, "lib%s.so" % name)
-+ if os.path.exists(libfile):
-+ return libfile
-+
-+ return None
-+
-+ def find_library(name, is64 = False):
-+ return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
-+
- else:
-
- def _findLib_ldconfig(name):
--- a/components/python/python26/Python26-15-getcwd.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-diff --git Python-2.6.4/Modules/posixmodule.c Python-2.6.4/Modules/posixmodule.c
---- Python-2.6.4/Modules/posixmodule.c
-+++ Python-2.6.4/Modules/posixmodule.c
-@@ -1978,6 +1978,8 @@
- char *res = NULL;
- PyObject *dynamic_return;
-
-+ int maxsize = pathconf(".", _PC_PATH_MAX);
-+
- Py_BEGIN_ALLOW_THREADS
- do {
- bufsize = bufsize + bufsize_incr;
-@@ -1994,7 +1996,7 @@
- if (res == NULL) {
- free(tmpbuf);
- }
-- } while ((res == NULL) && (errno == ERANGE));
-+ } while ((res == NULL) && (errno == ERANGE) && (bufsize < maxsize));
- Py_END_ALLOW_THREADS
-
- if (res == NULL)
--- a/components/python/python26/Python26-16-privrbac.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1581 +0,0 @@
-diff --git Python-2.6.4/Modules/authattr.c Python-2.6.4/Modules/authattr.c
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/Modules/authattr.c
-@@ -0,0 +1,262 @@
-+/*
-+ * CDDL HEADER START
-+ *
-+ * The contents of this file are subject to the terms of the
-+ * Common Development and Distribution License (the "License").
-+ * You may not use this file except in compliance with the License.
-+ *
-+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+ * or http://www.opensolaris.org/os/licensing.
-+ * See the License for the specific language governing permissions
-+ * and limitations under the License.
-+ *
-+ * When distributing Covered Code, include this CDDL HEADER in each
-+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+ * If applicable, add the following below this CDDL HEADER, with the
-+ * fields enclosed by brackets "[]" replaced with your own identifying
-+ * information: Portions Copyright [yyyy] [name of copyright owner]
-+ *
-+ * CDDL HEADER END
-+ */
-+
-+/*
-+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+/*
-+ * RBAC Bindings for Python - auth_attr functions
-+ */
-+
-+#include <auth_attr.h>
-+#include "Python.h"
-+#include "pyrbac.h"
-+
-+static PyObject*
-+pyrbac_setauthattr(PyObject* self, PyObject* args) {
-+ setauthattr();
-+ return Py_None;
-+}
-+
-+static PyObject*
-+pyrbac_endauthattr(PyObject* self, PyObject* args) {
-+ endauthattr();
-+ return Py_None;
-+}
-+
-+PyObject*
-+pyrbac_getauthnamattr(PyObject* self, char* authname, int mode) {
-+
-+
-+
-+ authattr_t * ret_authattr = (mode == PYRBAC_NAM_MODE) ? getauthnam(authname) : getauthattr();
-+ if (ret_authattr == NULL)
-+ return Py_None;
-+
-+ PyObject* kv_data = PyDict_New();
-+ if (kv_data == NULL) {
-+ free_authattr(ret_authattr);
-+ return NULL;
-+ }
-+
-+ if(ret_authattr->attr != NULL) {
-+ int len;
-+ for(len = 0; len < ret_authattr->attr->length; len++) {
-+ kv_t current = ret_authattr->attr->data[len];
-+
-+ PyObject* set = PyList_New(NULL);
-+ char* saveptr;
-+ char* item = strtok_r(current.value, ",", &saveptr);
-+ PyList_Append(set, PyString_FromString(item));
-+
-+ while((item = strtok_r(NULL, ",", &saveptr)) != NULL) {
-+ if(PyList_Append(set, PyString_FromString(item)) != 0) {
-+ Py_XDECREF(set);
-+ Py_XDECREF(kv_data);
-+ free_authattr(ret_authattr);
-+ return NULL;
-+ }
-+ }
-+ if(PyDict_SetItemString(kv_data, current.key, set)) {
-+ free_authattr(ret_authattr);
-+ return NULL;
-+ }
-+ }
-+ }
-+ PyObject * retval = Py_BuildValue("{s:s,s:s,s:s,s:s,s:s,s:O}",
-+ "name",ret_authattr->name,
-+ "res1",ret_authattr->res1,
-+ "res2",ret_authattr->res2,
-+ "short",ret_authattr->short_desc,
-+ "long",ret_authattr->long_desc,
-+ "attributes",kv_data);
-+
-+ free_authattr(ret_authattr);
-+ return retval;
-+
-+}
-+
-+static PyObject*
-+pyrbac_getauthattr(PyObject* self, PyObject* args) {
-+ return(pyrbac_getauthnamattr(self, NULL, PYRBAC_ATTR_MODE));
-+}
-+
-+static PyObject*
-+pyrbac_getauthnam(PyObject* self, PyObject* args) {
-+ char* name = NULL;
-+ if(!PyArg_ParseTuple(args, "s:getauthnam", &name))
-+ return NULL;
-+ return(pyrbac_getauthnamattr(self, name, PYRBAC_NAM_MODE));
-+}
-+
-+static PyObject *
-+pyrbac_chkauthattr(PyObject* self, PyObject* args) {
-+ char* authstring = NULL;
-+ char* username = NULL;
-+ if(!PyArg_ParseTuple(args, "ss:chkauthattr", &authstring, &username))
-+ return NULL;
-+ return PyBool_FromLong((long)chkauthattr(authstring, username));
-+}
-+
-+static PyObject*
-+pyrbac_authattr_next(PyObject* self, PyObject* args) {
-+ PyObject* retval = pyrbac_getauthattr(self, args);
-+ if( retval == Py_None ) {
-+ setauthattr();
-+ return NULL;
-+ }
-+ return retval;
-+}
-+static PyObject*
-+pyrbac_authattr__iter__(PyObject* self, PyObject* args) {
-+ return self;
-+}
-+
-+typedef struct {
-+ PyObject_HEAD
-+} Authattr;
-+
-+static void
-+Authattr_dealloc(Authattr* self) {
-+ endauthattr();
-+ self->ob_type->tp_free((PyObject*) self);
-+}
-+
-+static PyObject*
-+Authattr_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
-+ Authattr *self;
-+ self = (Authattr*)type->tp_alloc(type, 0);
-+
-+ return ((PyObject *) self);
-+}
-+
-+static int
-+Authattr_init(Authattr* self, PyObject *args, PyObject *kwargs) {
-+ setauthattr();
-+ return 0;
-+}
-+
-+static char pyrbac_authattr__doc__[];
-+
-+PyDoc_STRVAR(pyrbac_authattr__doc__, """provides interfaces to the auth_attr \
-+database. may be iterated over to return all auth_attr entries\n\n\
-+Methods provided:\n\
-+setauthattr\n\
-+endauthattr\n\
-+getauthattr\n\
-+chkauthattr\n\
-+getauthnam""");
-+
-+static char pyrbac_setauthattr__doc__[];
-+static char pyrbac_endauthattr__doc__[];
-+static char pyrbac_getauthattr__doc__[];
-+static char pyrbac_chkauthattr__doc__[];
-+
-+PyDoc_STRVAR(pyrbac_setauthattr__doc__,
-+"\"rewinds\" the auth_attr functions to the first entry in the db. Called \
-+automatically by the constructor\n\tArguments: None\n\tReturns: None");
-+
-+PyDoc_STRVAR(pyrbac_endauthattr__doc__,
-+"closes the auth_attr database, cleans up storage. called automatically by \
-+the destructor\n\tArguments: None\n\tReturns: None");
-+
-+PyDoc_STRVAR(pyrbac_chkauthattr__doc__, "verifies if a user has a given \
-+authorization.\n\tArguments: 2 Python strings, 'authname' and 'username'\n\
-+\tReturns: True if the user is authorized, False otherwise");
-+
-+PyDoc_STRVAR(pyrbac_getauthattr__doc__,
-+"return one entry from the auth_attr database\n\
-+\tArguments: None\n\
-+\tReturns: a dict representing the authattr_t struct:\n\
-+\t\t\"name\": Authorization Name\n\
-+\t\t\"res1\": reserved\n\
-+\t\t\"res2\": reserved\n\
-+\t\t\"short\": Short Description\n\
-+\t\t\"long\": Long Description\n\
-+\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
-+or a string depending on value");
-+
-+PyDoc_STRVAR(pyrbac_getauthnam__doc__,
-+"searches the auth_attr database for a given authorization name\n\
-+\tArguments: a Python string containing the auth name\n\
-+\tReturns: a dict representing the authattr_t struct:\n\
-+\t\t\"name\": Authorization Name\n\
-+\t\t\"res1\": reserved\n\
-+\t\t\"res2\": reserved\n\
-+\t\t\"short\": Short Description\n\
-+\t\t\"long\": Long Description\n\
-+\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
-+or a string depending on value");
-+
-+static PyMethodDef Authattr_methods[] = {
-+ {"setauthattr", pyrbac_setauthattr, METH_NOARGS, pyrbac_setauthattr__doc__},
-+ {"endauthattr", pyrbac_endauthattr, METH_NOARGS, pyrbac_endauthattr__doc__},
-+ {"chkauthattr", pyrbac_chkauthattr, METH_VARARGS, pyrbac_chkauthattr__doc__},
-+ {"getauthattr", pyrbac_getauthattr, METH_NOARGS, pyrbac_getauthattr__doc__},
-+ {"getauthnam", pyrbac_getauthnam, METH_VARARGS, pyrbac_getauthnam__doc__},
-+ {NULL}
-+};
-+
-+PyTypeObject AuthattrType = {
-+ PyObject_HEAD_INIT(NULL)
-+ 0, /*ob_size*/
-+ "rbac.authattr", /*tp_name*/
-+ sizeof(Authattr), /*tp_basicsize*/
-+ 0, /*tp_itemsize*/
-+ (destructor)Authattr_dealloc, /*tp_dealloc*/
-+ 0, /*tp_print*/
-+ 0, /*tp_getattr*/
-+ 0, /*tp_setattr*/
-+ 0, /*tp_compare*/
-+ 0, /*tp_repr*/
-+ 0, /*tp_as_number*/
-+ 0, /*tp_as_sequence*/
-+ 0, /*tp_as_mapping*/
-+ 0, /*tp_hash */
-+ 0, /*tp_call*/
-+ 0, /*tp_str*/
-+ 0, /*tp_getattro*/
-+ 0, /*tp_setattro*/
-+ 0, /*tp_as_buffer*/
-+ Py_TPFLAGS_DEFAULT |
-+ Py_TPFLAGS_BASETYPE |
-+ Py_TPFLAGS_HAVE_ITER, /*tp_flags*/
-+ pyrbac_authattr__doc__, /* tp_doc */
-+ 0, /* tp_traverse */
-+ 0, /* tp_clear */
-+ 0, /* tp_richcompare */
-+ 0, /* tp_weaklistoffset */
-+ pyrbac_authattr__iter__, /* tp_iter */
-+ pyrbac_authattr_next, /* tp_iternext */
-+ Authattr_methods, /* tp_methods */
-+ 0, /* tp_members */
-+ 0, /* tp_getset */
-+ 0, /* tp_base */
-+ 0, /* tp_dict */
-+ 0, /* tp_descr_get */
-+ 0, /* tp_descr_set */
-+ 0, /* tp_dictoffset */
-+ (initproc)Authattr_init, /* tp_init */
-+ 0, /* tp_alloc */
-+ Authattr_new, /* tp_new */
-+};
-diff --git Python-2.6.4/Modules/execattr.c Python-2.6.4/Modules/execattr.c
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/Modules/execattr.c
-@@ -0,0 +1,314 @@
-+/*
-+ * CDDL HEADER START
-+ *
-+ * The contents of this file are subject to the terms of the
-+ * Common Development and Distribution License (the "License").
-+ * You may not use this file except in compliance with the License.
-+ *
-+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+ * or http://www.opensolaris.org/os/licensing.
-+ * See the License for the specific language governing permissions
-+ * and limitations under the License.
-+ *
-+ * When distributing Covered Code, include this CDDL HEADER in each
-+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+ * If applicable, add the following below this CDDL HEADER, with the
-+ * fields enclosed by brackets "[]" replaced with your own identifying
-+ * information: Portions Copyright [yyyy] [name of copyright owner]
-+ *
-+ * CDDL HEADER END
-+ */
-+
-+/*
-+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+/*
-+ * RBAC Bindings for Python - exec_attr functions
-+ */
-+
-+#include <exec_attr.h>
-+#include "Python.h"
-+#include "pyrbac.h"
-+
-+static PyObject *
-+pyrbac_setexecattr(PyObject* self, PyObject* args) {
-+ setexecattr();
-+ return Py_None;
-+}
-+
-+static PyObject *
-+pyrbac_endexecattr(PyObject* self, PyObject* args) {
-+ endexecattr();
-+ return Py_None;
-+}
-+
-+PyObject *
-+pyrbac_getexecuserprofattr(PyObject* self, char* userprofname, char* type, char* id, int mode) {
-+
-+ PyObject* ep_data = (mode == PYRBAC_ATTR_MODE) ? NULL : PyList_New(0);
-+
-+ if (ep_data == NULL && mode != PYRBAC_ATTR_MODE )
-+ return NULL;
-+
-+ execattr_t *execprof;
-+ if (mode == PYRBAC_USER_MODE)
-+ execprof = getexecuser(userprofname, type, id, GET_ALL);
-+ else if (mode == PYRBAC_PROF_MODE)
-+ execprof = getexecprof(userprofname, type, id, GET_ALL);
-+ else if (mode == PYRBAC_ATTR_MODE)
-+ execprof = getexecattr();
-+ else
-+ return NULL;
-+
-+ if (execprof == NULL)
-+ return Py_None;
-+
-+ execattr_t *execprof_head = execprof;
-+
-+ while(execprof != NULL) {
-+
-+ PyObject* kv_data = PyDict_New();
-+
-+ if(execprof->attr != NULL) {
-+ int len;
-+ for(len = 0; len < execprof->attr->length; len++) {
-+ kv_t current = execprof->attr->data[len];
-+
-+ PyObject* set = PyList_New(NULL);
-+ char* saveptr;
-+ char* item = strtok_r(current.value, ",", &saveptr);
-+ PyList_Append(set, PyString_FromString(item));
-+
-+ while((item = strtok_r(NULL, ",", &saveptr)) != NULL) {
-+ if(PyList_Append(set, PyString_FromString(item)) != 0) {
-+ Py_XDECREF(set);
-+ Py_XDECREF(kv_data);
-+ free_execattr(execprof_head);
-+ return NULL;
-+ }
-+ }
-+ if(PyDict_SetItemString(kv_data, current.key, set)) {
-+ free_execattr(execprof_head);
-+ return NULL;
-+ }
-+ }
-+ }
-+ PyObject* entry = Py_BuildValue("{s:s,s:s,s:s,s:s,s:s,s:s,s:O}",
-+ "name", execprof->name,
-+ "type", execprof->type,
-+ "policy", execprof->policy,
-+ "res1", execprof->res1,
-+ "res2", execprof->res2,
-+ "id", execprof->id,
-+ "attributes", kv_data);
-+
-+ if (entry == NULL) {
-+ Py_XDECREF(kv_data);
-+ free_execattr(execprof_head);
-+ return NULL;
-+ }
-+
-+ if (mode == PYRBAC_ATTR_MODE) {
-+ free_execattr(execprof_head);
-+ return(entry);
-+ }
-+ PyList_Append(ep_data, entry);
-+ execprof = execprof->next;
-+ }
-+
-+ free_execattr(execprof_head);
-+ return(ep_data);
-+
-+}
-+
-+static PyObject *
-+pyrbac_getexecuser(PyObject* self, PyObject* args) {
-+ char* username = NULL;
-+ char* type = NULL;
-+ char* id = NULL;
-+
-+ if(!PyArg_ParseTuple(args, "sss:getexecuser", &username, &type, &id))
-+ return NULL;
-+
-+ return (pyrbac_getexecuserprofattr(self, username, type, id, PYRBAC_USER_MODE));
-+}
-+
-+static PyObject *
-+pyrbac_getexecprof(PyObject* self, PyObject* args) {
-+
-+ char* profname = NULL;
-+ char* type = NULL;
-+ char* id = NULL;
-+
-+ if(!PyArg_ParseTuple(args, "sss:getexecprof", &profname, &type, &id))
-+ return NULL;
-+
-+ return (pyrbac_getexecuserprofattr(self, profname, type, id, PYRBAC_PROF_MODE));
-+}
-+
-+static PyObject*
-+pyrbac_getexecattr(PyObject* self, PyObject* args) {
-+ return pyrbac_getexecuserprofattr(self, NULL, NULL, NULL, PYRBAC_ATTR_MODE);
-+}
-+
-+static PyObject*
-+pyrbac_execattr_next(PyObject* self, PyObject* args) {
-+ PyObject* retval = pyrbac_getexecattr(self, args);
-+ if( retval == Py_None ) {
-+ setexecattr();
-+ return NULL;
-+ }
-+ return retval;
-+}
-+static PyObject*
-+pyrbac_execattr__iter__(PyObject* self, PyObject* args) {
-+ return self;
-+}
-+
-+typedef struct {
-+ PyObject_HEAD
-+} Execattr;
-+
-+static void
-+Execattr_dealloc(Execattr* self) {
-+ endexecattr();
-+ self->ob_type->tp_free((PyObject*) self);
-+}
-+
-+static PyObject*
-+Execattr_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
-+ Execattr *self;
-+ self = (Execattr*)type->tp_alloc(type, 0);
-+
-+ return ((PyObject *) self);
-+}
-+
-+static int
-+Execattr_init(Execattr* self, PyObject *args, PyObject *kwargs) {
-+ setexecattr();
-+ return 0;
-+}
-+
-+static char pyrbac_execattr__doc__[];
-+
-+PyDoc_STRVAR(pyrbac_execattr__doc__, "provides functions for \
-+interacting with the execution profiles database. May be iterated over to \
-+enumerate exec_attr(4) entries\n\n\
-+Methods provided:\n\
-+setexecattr\n\
-+endexecattr\n\
-+getexecattr\n\
-+getexecprof\n\
-+getexecuser");
-+
-+
-+static char pyrbac_getexecuser__doc__[];
-+static char pyrbac_getexecprof__doc__[];
-+static char pyrbac_getexecattr__doc__[];
-+static char pyrbac_setexecattr__doc__[];
-+static char pyrbac_endexecattr__doc__[];
-+
-+PyDoc_STRVAR(pyrbac_setexecattr__doc__,
-+"\"rewinds\" the exec_attr functions to the first entry in the db. Called \
-+automatically by the constructor.\n\
-+\tArguments: None\
-+\tReturns: None");
-+
-+PyDoc_STRVAR(pyrbac_endexecattr__doc__,
-+"closes the exec_attr database, cleans up storage. called automatically by \
-+the destructor.\n\
-+\tArguments: None\
-+\tReturns: None");
-+
-+PyDoc_STRVAR(pyrbac_getexecuser__doc__, "corresponds with getexecuser(3SECDB)\
-+\nTakes: \'username\', \'type\', \'id\'\n\
-+Return: a single exec_attr entry\n\
-+\tArguments: None\n\
-+\tReturns: a dict representation of an execattr_t struct:\n\
-+\t\t\"name\": Authorization Name\n\
-+\t\t\"type\": Profile Type\n\
-+\t\t\"policy\": Policy attributes are relevant in\n\
-+\t\t\"res1\": reserved\n\
-+\t\t\"res2\": reserved\n\
-+\t\t\"id\": unique identifier\n\
-+\t\t\"attributes\": A Python dict keyed by attribute & valued as\
-+either a list or a string depending on value");
-+
-+PyDoc_STRVAR(pyrbac_getexecprof__doc__, "corresponds with getexecprof(3SECDB)\
-+\nTakes: \'profile name\', \'type\', \'id\'\n\
-+\tReturns: a dict representation of an execattr_t struct:\n\
-+\t\t\"name\": Authorization Name\n\
-+\t\t\"type\": Profile Type\n\
-+\t\t\"policy\": Policy attributes are relevant in\n\
-+\t\t\"res1\": reserved\n\
-+\t\t\"res2\": reserved\n\
-+\t\t\"id\": unique identifier\n\
-+\t\t\"attributes\": A Python dict keyed by attribute & valued as\
-+either a list or a string depending on value");
-+
-+PyDoc_STRVAR(pyrbac_getexecattr__doc__, "corresponds with getexecattr(3SECDB)\
-+\nTakes 0 arguments\n\
-+\tReturns: a dict representation of an execattr_t struct:\n\
-+\t\t\"name\": Authorization Name\n\
-+\t\t\"type\": Profile Type\n\
-+\t\t\"policy\": Policy attributes are relevant in\n\
-+\t\t\"res1\": reserved\n\
-+\t\t\"res2\": reserved\n\
-+\t\t\"id\": unique identifier\n\
-+\t\t\"attributes\": A Python dict keyed by attribute & valued as\
-+either a list or a string depending on value");
-+
-+static PyMethodDef Execattr_methods[] = {
-+ {"setexecattr", pyrbac_setexecattr, METH_NOARGS, pyrbac_setexecattr__doc__},
-+ {"endexecattr", pyrbac_endexecattr, METH_NOARGS, pyrbac_endexecattr__doc__},
-+ {"getexecprof", pyrbac_getexecprof, METH_VARARGS, pyrbac_getexecprof__doc__},
-+ {"getexecuser", pyrbac_getexecuser, METH_VARARGS, pyrbac_getexecuser__doc__},
-+ {"getexecattr", pyrbac_getexecattr, METH_NOARGS, pyrbac_getexecattr__doc__},
-+ {NULL}
-+};
-+
-+PyTypeObject ExecattrType = {
-+ PyObject_HEAD_INIT(NULL)
-+ 0, /*ob_size*/
-+ "rbac.execattr", /*tp_name*/
-+ sizeof(Execattr), /*tp_basicsize*/
-+ 0, /*tp_itemsize*/
-+ (destructor)Execattr_dealloc, /*tp_dealloc*/
-+ 0, /*tp_print*/
-+ 0, /*tp_getattr*/
-+ 0, /*tp_setattr*/
-+ 0, /*tp_compare*/
-+ 0, /*tp_repr*/
-+ 0, /*tp_as_number*/
-+ 0, /*tp_as_sequence*/
-+ 0, /*tp_as_mapping*/
-+ 0, /*tp_hash */
-+ 0, /*tp_call*/
-+ 0, /*tp_str*/
-+ 0, /*tp_getattro*/
-+ 0, /*tp_setattro*/
-+ 0, /*tp_as_buffer*/
-+ Py_TPFLAGS_DEFAULT |
-+ Py_TPFLAGS_BASETYPE |
-+ Py_TPFLAGS_HAVE_ITER, /*tp_flags*/
-+ pyrbac_execattr__doc__, /* tp_doc */
-+ 0, /* tp_traverse */
-+ 0, /* tp_clear */
-+ 0, /* tp_richcompare */
-+ 0, /* tp_weaklistoffset */
-+ pyrbac_execattr__iter__, /* tp_iter */
-+ pyrbac_execattr_next, /* tp_iternext */
-+ Execattr_methods, /* tp_methods */
-+ 0, /* tp_members */
-+ 0, /* tp_getset */
-+ 0, /* tp_base */
-+ 0, /* tp_dict */
-+ 0, /* tp_descr_get */
-+ 0, /* tp_descr_set */
-+ 0, /* tp_dictoffset */
-+ (initproc)Execattr_init, /* tp_init */
-+ 0, /* tp_alloc */
-+ Execattr_new, /* tp_new */
-+};
-diff --git Python-2.6.4/Modules/privileges.c Python-2.6.4/Modules/privileges.c
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/Modules/privileges.c
-@@ -0,0 +1,230 @@
-+/*
-+ * CDDL HEADER START
-+ *
-+ * The contents of this file are subject to the terms of the
-+ * Common Development and Distribution License (the "License").
-+ * You may not use this file except in compliance with the License.
-+ *
-+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+ * or http://www.opensolaris.org/os/licensing.
-+ * See the License for the specific language governing permissions
-+ * and limitations under the License.
-+ *
-+ * When distributing Covered Code, include this CDDL HEADER in each
-+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+ * If applicable, add the following below this CDDL HEADER, with the
-+ * fields enclosed by brackets "[]" replaced with your own identifying
-+ * information: Portions Copyright [yyyy] [name of copyright owner]
-+ *
-+ * CDDL HEADER END
-+ */
-+
-+/*
-+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+/*
-+ * privileges(5) bindings for Python
-+ */
-+
-+#include <priv.h>
-+#include "Python.h"
-+
-+static PyObject *
-+pyprivileges_setppriv( PyObject *self, PyObject *args) {
-+ priv_op_t op = -1 ;
-+ priv_ptype_t which = NULL;
-+
-+ PyObject* set_list = NULL;
-+
-+ priv_set_t * set = NULL;
-+
-+ if(!PyArg_ParseTuple(args, "iiO:setppriv", &op, &which, &set_list))
-+ return NULL;
-+
-+ if((op != PRIV_ON && op != PRIV_OFF && op != PRIV_SET) ||
-+ (which != PRIV_PERMITTED && which != PRIV_EFFECTIVE &&
-+ which != PRIV_INHERITABLE && which != PRIV_LIMIT))
-+ return NULL;
-+
-+ PyObject* set_string = PyList_GetItem(set_list, 0);
-+ int i;
-+ for (i = 1; i < PyList_Size(set_list); ++i) {
-+ PyString_Concat(&set_string, PyString_FromString(","));
-+ PyString_Concat(&set_string, PyList_GetItem(set_list, i));
-+ }
-+
-+ set = priv_str_to_set(PyString_AsString(set_string), ",", NULL );
-+
-+ if ( set == NULL )
-+ return NULL;
-+
-+ long ret = (long) setppriv(op, which, set);
-+ priv_freeset(set);
-+ // Python inverts true & false
-+ if(ret)
-+ Py_RETURN_FALSE;
-+
-+ Py_RETURN_TRUE;
-+}
-+
-+static PyObject *
-+pyprivileges_getppriv( PyObject *self, PyObject *args) {
-+
-+ char* set_str = NULL;
-+ priv_ptype_t which = NULL;
-+ priv_set_t * set = priv_allocset();
-+ if (set == NULL)
-+ return NULL;
-+
-+ if(!PyArg_ParseTuple(args, "i:getppriv", &which))
-+ return NULL;
-+
-+ if (which != PRIV_PERMITTED && which != PRIV_EFFECTIVE &&
-+ which != PRIV_INHERITABLE && which != PRIV_LIMIT)
-+ return NULL;
-+
-+ if (getppriv(which, set) != 0)
-+ return NULL;
-+
-+ set_str = priv_set_to_str(set, ',', PRIV_STR_LIT);
-+ priv_freeset(set);
-+
-+ PyObject* set_list = PyList_New(NULL);
-+ char* saveptr;
-+ char* item = strtok_r(set_str, ",", &saveptr);
-+ PyList_Append(set_list, PyString_FromString(item));
-+
-+ while((item = strtok_r(NULL, ",", &saveptr)) != NULL) {
-+ if(PyList_Append(set_list, PyString_FromString(item)) != 0) {
-+ Py_XDECREF(set_list);
-+ return NULL;
-+ }
-+ }
-+
-+ return(set_list);
-+}
-+
-+static PyObject *
-+pyprivileges_priv_inverse( PyObject *self, PyObject *args ) {
-+
-+ PyObject* set_list_in = NULL;
-+ if(!PyArg_ParseTuple(args, "O:priv_inverse", &set_list_in))
-+ return NULL;
-+
-+ PyObject* set_string = PyList_GetItem(set_list_in, 0);
-+ int i;
-+ for (i = 1; i < PyList_Size(set_list_in); ++i) {
-+ PyString_Concat(set_string, PyString_FromString(","));
-+ PyString_Concat(set_string, PyList_GetItem(set_list_in, i));
-+ }
-+
-+ priv_set_t * set = priv_str_to_set(PyString_AsString(set_string), ",", NULL);
-+ if (set == NULL)
-+ return NULL;
-+ priv_inverse(set);
-+ char * ret_str = priv_set_to_str(set, ',', PRIV_STR_LIT);
-+ priv_freeset(set);
-+
-+ PyObject* set_list_out = PyList_New(NULL);
-+ char* saveptr;
-+ char* item = strtok_r(ret_str, ",", &saveptr);
-+ PyList_Append(set_list_out, PyString_FromString(item));
-+
-+ while((item = strtok_r(NULL, ",", &saveptr)) != NULL) {
-+ if(PyList_Append(set_list_out, PyString_FromString(item)) != 0) {
-+ Py_XDECREF(set_list_out);
-+ return NULL;
-+ }
-+ }
-+
-+ Py_XDECREF(set_list_in);
-+
-+ return(set_list_out);
-+}
-+
-+/* priv_ineffect is a convienient wrapper to priv_get
-+ * however priv_set is, in the context of python, not
-+ * much of a convienience, so it's omitted
-+ */
-+static PyObject *
-+pyprivileges_priv_ineffect(PyObject* self, PyObject* args) {
-+ char* privstring=NULL;
-+ if (!PyArg_ParseTuple(args, "s:priv_ineffect", &privstring))
-+ return NULL;
-+ return PyBool_FromLong(priv_ineffect(privstring));
-+}
-+
-+
-+static char pyprivileges__doc__[];
-+PyDoc_STRVAR(pyprivileges__doc__,
-+"Provides functions for interacting with the Solaris privileges(5) framework\n\
-+Functions provided:\n\
-+setppriv\n\
-+getppriv\n\
-+priv_ineffect\n\
-+priv_inverse");
-+
-+static char pyprivileges_setppriv__doc__[];
-+static char pyprivileges_getppriv__doc__[];
-+static char pyprivileges_priv_ineffect__doc__[];
-+static char pyprivileges_priv_inverse__doc__[];
-+
-+PyDoc_STRVAR(pyprivileges_setppriv__doc__,
-+"Facilitates setting the permitted/inheritable/limit/effective privileges set\n\
-+\tArguments:\n\
-+\t\tone of (PRIV_ON|PRIV_OFF|PRIV_SET)\n\
-+\t\tone of (PRIV_PERMITTED|PRIV_INHERITABLE|PRIV_LIMIT|PRIV_EFFECTIVE)\n\
-+\t\tset of privileges: a list of strings\n\
-+\tReturns: True on success, False on failure\
-+");
-+
-+PyDoc_STRVAR(pyprivileges_getppriv__doc__,
-+"Return the process privilege set\n\
-+\tArguments:\n\
-+\t\tone of (PRIV_PERMITTED|PRIV_INHERITABLE|PRIV_LIMIT|PRIV_EFFECTIVE)\n\
-+\tReturns: a Python list of strings");
-+
-+PyDoc_STRVAR(pyprivileges_priv_ineffect__doc__,
-+"Checks for a privileges presence in the effective set\n\
-+\tArguments: a String\n\
-+\tReturns: True if the privilege is in effect, False otherwise");
-+
-+PyDoc_STRVAR(pyprivileges_priv_inverse__doc__,
-+"The complement of the set of privileges\n\
-+\tArguments: a list of strings\n\tReturns: a list of strings");
-+
-+static PyMethodDef module_methods[] = {
-+ {"setppriv", pyprivileges_setppriv, METH_VARARGS, pyprivileges_setppriv__doc__},
-+ {"getppriv", pyprivileges_getppriv, METH_VARARGS, pyprivileges_getppriv__doc__},
-+ {"priv_ineffect", pyprivileges_priv_ineffect, METH_VARARGS, pyprivileges_priv_ineffect__doc__},
-+ {"priv_inverse", pyprivileges_priv_inverse, METH_VARARGS, pyprivileges_priv_inverse__doc__},
-+ {NULL}
-+};
-+
-+
-+#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
-+#define PyMODINIT_FUNC void
-+#endif
-+PyMODINIT_FUNC
-+initprivileges(void) {
-+ PyObject* m;
-+
-+ m = Py_InitModule3("privileges", module_methods, pyprivileges__doc__);
-+ if ( m == NULL )
-+ return;
-+
-+ PyObject* d = PyModule_GetDict(m);
-+ if (d == NULL)
-+ return;
-+
-+ PyDict_SetItemString(d, "PRIV_ON", PyInt_FromLong((long)PRIV_ON));
-+ PyDict_SetItemString(d, "PRIV_OFF", PyInt_FromLong((long)PRIV_OFF));
-+ PyDict_SetItemString(d, "PRIV_SET", PyInt_FromLong((long)PRIV_SET));
-+
-+ PyDict_SetItemString(d, "PRIV_PERMITTED", PyInt_FromLong((long)PRIV_PERMITTED));
-+ PyDict_SetItemString(d, "PRIV_INHERITABLE", PyInt_FromLong((long)PRIV_INHERITABLE));
-+ PyDict_SetItemString(d, "PRIV_LIMIT", PyInt_FromLong((long)PRIV_LIMIT));
-+ PyDict_SetItemString(d, "PRIV_EFFECTIVE", PyInt_FromLong((long)PRIV_EFFECTIVE));
-+}
-diff --git Python-2.6.4/Modules/pyrbac.c Python-2.6.4/Modules/pyrbac.c
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/Modules/pyrbac.c
-@@ -0,0 +1,69 @@
-+/*
-+ * CDDL HEADER START
-+ *
-+ * The contents of this file are subject to the terms of the
-+ * Common Development and Distribution License (the "License").
-+ * You may not use this file except in compliance with the License.
-+ *
-+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+ * or http://www.opensolaris.org/os/licensing.
-+ * See the License for the specific language governing permissions
-+ * and limitations under the License.
-+ *
-+ * When distributing Covered Code, include this CDDL HEADER in each
-+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+ * If applicable, add the following below this CDDL HEADER, with the
-+ * fields enclosed by brackets "[]" replaced with your own identifying
-+ * information: Portions Copyright [yyyy] [name of copyright owner]
-+ *
-+ * CDDL HEADER END
-+ */
-+
-+/*
-+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+/*
-+ * RBAC Bindings for Python
-+ */
-+
-+#include <Python.h>
-+#include "pyrbac.h"
-+
-+static PyMethodDef module_methods[] = {NULL};
-+static char pyrbac__doc__[];
-+
-+PyDoc_STRVAR(pyrbac__doc__, "provides access to some objects \
-+for interaction with the Solaris Role-Based Access Control \
-+framework.\n\nDynamic objects:\n\
-+userattr -- for interacting with user_attr(4)\n\
-+authattr -- for interacting with auth_attr(4)\n\
-+execattr -- for interacting with exec_attr(4)\n");
-+
-+#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
-+#define PyMODINIT_FUNC void
-+#endif
-+PyMODINIT_FUNC
-+initrbac(void) {
-+ PyObject* m;
-+ if (PyType_Ready(&AuthattrType) < 0 ||
-+ PyType_Ready(&ExecattrType) < 0 ||
-+ PyType_Ready(&UserattrType) < 0 )
-+ return;
-+
-+ m = Py_InitModule3("rbac", module_methods, pyrbac__doc__);
-+ if ( m == NULL )
-+ return;
-+
-+ Py_INCREF(&AuthattrType);
-+ PyModule_AddObject(m, "authattr", (PyObject*)&AuthattrType);
-+
-+ Py_INCREF(&ExecattrType);
-+ PyModule_AddObject(m, "execattr", (PyObject*)&ExecattrType);
-+
-+ Py_INCREF(&UserattrType);
-+ PyModule_AddObject(m, "userattr", (PyObject*)&UserattrType);
-+
-+}
-+
-diff --git Python-2.6.4/Modules/pyrbac.h Python-2.6.4/Modules/pyrbac.h
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/Modules/pyrbac.h
-@@ -0,0 +1,46 @@
-+/*
-+ * CDDL HEADER START
-+ *
-+ * The contents of this file are subject to the terms of the
-+ * Common Development and Distribution License (the "License").
-+ * You may not use this file except in compliance with the License.
-+ *
-+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+ * or http://www.opensolaris.org/os/licensing.
-+ * See the License for the specific language governing permissions
-+ * and limitations under the License.
-+ *
-+ * When distributing Covered Code, include this CDDL HEADER in each
-+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+ * If applicable, add the following below this CDDL HEADER, with the
-+ * fields enclosed by brackets "[]" replaced with your own identifying
-+ * information: Portions Copyright [yyyy] [name of copyright owner]
-+ *
-+ * CDDL HEADER END
-+ */
-+
-+/*
-+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+/*
-+ * RBAC bindings for python
-+ */
-+#ifndef PYRBAC_H
-+#define PYRBAC_H
-+
-+#include <secdb.h>
-+
-+
-+#define PYRBAC_USER_MODE 1
-+#define PYRBAC_PROF_MODE 2
-+#define PYRBAC_ATTR_MODE 3
-+#define PYRBAC_NAM_MODE 4
-+#define PYRBAC_UID_MODE 5
-+
-+PyTypeObject AuthattrType;
-+PyTypeObject ExecattrType;
-+PyTypeObject UserattrType;
-+
-+#endif
-diff --git Python-2.6.4/Modules/userattr.c Python-2.6.4/Modules/userattr.c
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/Modules/userattr.c
-@@ -0,0 +1,309 @@
-+/*
-+ * CDDL HEADER START
-+ *
-+ * The contents of this file are subject to the terms of the
-+ * Common Development and Distribution License (the "License").
-+ * You may not use this file except in compliance with the License.
-+ *
-+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+ * or http://www.opensolaris.org/os/licensing.
-+ * See the License for the specific language governing permissions
-+ * and limitations under the License.
-+ *
-+ * When distributing Covered Code, include this CDDL HEADER in each
-+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+ * If applicable, add the following below this CDDL HEADER, with the
-+ * fields enclosed by brackets "[]" replaced with your own identifying
-+ * information: Portions Copyright [yyyy] [name of copyright owner]
-+ *
-+ * CDDL HEADER END
-+ */
-+
-+/*
-+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+/*
-+ * RBAC Bindings for Python - user_attr functions
-+ */
-+
-+#include <stdio.h>
-+#include <user_attr.h>
-+#include "Python.h"
-+#include "pyrbac.h"
-+
-+static PyObject*
-+pyrbac_setuserattr(PyObject* self, PyObject* args) {
-+ setuserattr();
-+ return Py_None;
-+}
-+
-+static PyObject*
-+pyrbac_enduserattr(PyObject* self, PyObject* args) {
-+ enduserattr();
-+ return Py_None;
-+}
-+
-+PyObject*
-+pyrbac_getuseruidnamattr(PyObject* self, void* arg, int mode, char* filename) {
-+
-+ userattr_t *ret_userattr;
-+
-+ if (mode == PYRBAC_ATTR_MODE) {
-+ if (filename != NULL) {
-+ FILE* file = fopen(filename, "r");
-+ if (file == NULL)
-+ return NULL;
-+ ret_userattr = fgetuserattr(file);
-+ if (fclose(file))
-+ return NULL;
-+ }
-+ else
-+ ret_userattr = getuserattr();
-+ }
-+ else if (mode == PYRBAC_NAM_MODE)
-+ ret_userattr = getusernam((char*) arg);
-+ else if (mode == PYRBAC_UID_MODE)
-+ ret_userattr = getuseruid(*((uid_t*) arg));
-+
-+ if (ret_userattr == NULL)
-+ return Py_None;
-+
-+ PyObject* entry = PyTuple_New(5);
-+ if (entry == NULL) {
-+ free_userattr(ret_userattr);
-+ return NULL;
-+ }
-+
-+ PyObject* kv_data = PyDict_New();
-+
-+ if(ret_userattr->attr != NULL) {
-+ int len;
-+ for(len = 0; len < ret_userattr->attr->length; len++) {
-+ kv_t current = ret_userattr->attr->data[len];
-+
-+ PyObject* set = PyList_New(NULL);
-+ char* saveptr;
-+ char* item = strtok_r(current.value, ",", &saveptr);
-+ PyList_Append(set, PyString_FromString(item));
-+
-+ while((item = strtok_r(NULL, ",", &saveptr)) != NULL) {
-+ if(PyList_Append(set, PyString_FromString(item)) != 0) {
-+ Py_XDECREF(set);
-+ Py_XDECREF(kv_data);
-+ free_userattr(ret_userattr);
-+ return NULL;
-+ }
-+ }
-+ if(PyDict_SetItemString(kv_data, current.key, set)) {
-+ free_userattr(ret_userattr);
-+ return NULL;
-+ }
-+ }
-+ }
-+ entry = Py_BuildValue("{s:s,s:s,s:s,s:s,s:O}",
-+ "name", ret_userattr->name,
-+ "qualifier", ret_userattr->qualifier,
-+ "res1", ret_userattr->res1,
-+ "res2", ret_userattr->res2,
-+ "attributes", kv_data);
-+
-+ free_userattr(ret_userattr);
-+
-+ return entry;
-+}
-+
-+
-+static PyObject*
-+pyrbac_getuserattr(PyObject* self, PyObject* args) {
-+ return(pyrbac_getuseruidnamattr(self, (void*) NULL, PYRBAC_ATTR_MODE, NULL));
-+}
-+
-+static PyObject*
-+pyrbac_fgetuserattr(PyObject* self, PyObject* args) {
-+ char* filename = NULL;
-+ if(!PyArg_ParseTuple(args, "s:fgetuserattr", &filename))
-+ return NULL;
-+ return(pyrbac_getuseruidnamattr(self, NULL, PYRBAC_ATTR_MODE, filename));
-+}
-+
-+static PyObject*
-+pyrbac_getusernam(PyObject* self, PyObject* args) {
-+ char* name = NULL;
-+ if(!PyArg_ParseTuple(args, "s:getusernam", &name))
-+ return NULL;
-+ return(pyrbac_getuseruidnamattr(self, (void*) name, PYRBAC_NAM_MODE, NULL));
-+}
-+
-+static PyObject*
-+pyrbac_getuseruid(PyObject* self, PyObject* args) {
-+ uid_t uid;
-+ if(!PyArg_ParseTuple(args, "i:getuseruid", &uid))
-+ return NULL;
-+ return(pyrbac_getuseruidnamattr(self, (void*) &uid, PYRBAC_UID_MODE, NULL));
-+}
-+
-+static PyObject*
-+pyrbac_userattr_next(PyObject* self, PyObject* args) {
-+ PyObject* retval = pyrbac_getuserattr(self, args);
-+ if( retval == Py_None ) {
-+ setuserattr();
-+ return NULL;
-+ }
-+ return retval;
-+}
-+static PyObject*
-+pyrbac_userattr__iter__(PyObject* self, PyObject* args) {
-+ return self;
-+}
-+
-+typedef struct {
-+ PyObject_HEAD
-+} Userattr;
-+
-+static void
-+Userattr_dealloc(Userattr* self) {
-+ enduserattr();
-+ self->ob_type->tp_free((PyObject*) self);
-+}
-+
-+static PyObject*
-+Userattr_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
-+ Userattr *self;
-+ self = (Userattr*)type->tp_alloc(type, 0);
-+
-+ return ((PyObject *) self);
-+}
-+
-+static int
-+Userattr_init(Userattr* self, PyObject *args, PyObject *kwargs) {
-+ setuserattr();
-+ return 0;
-+}
-+
-+static char pyrbac_userattr__doc__[];
-+PyDoc_STRVAR(pyrbac_userattr__doc__, "provides functions for \
-+interacting with the extended user attributes database. May be iterated over \
-+to enumerate user_attr(4) entries\n\n\
-+Methods provided:\n\
-+setuserattr\n\
-+enduserattr\n\
-+getuserattr\n\
-+fgetuserattr\n\
-+getusernam\n\
-+getuseruid");
-+
-+static char pyrbac_setuserattr__doc__[];
-+static char pyrbac_enduserattr__doc__[];
-+static char pyrbac_getuserattr__doc__[];
-+static char pyrbac_getusernam__doc__[];
-+static char pyrbac_getuseruid__doc__[];
-+
-+PyDoc_STRVAR(pyrbac_setuserattr__doc__, "\"rewinds\" the user_attr functions \
-+to the first entry in the db. Called automatically by the constructor.\n\
-+\tArguments: None\n\
-+\tReturns: None");
-+
-+PyDoc_STRVAR(pyrbac_enduserattr__doc__, "closes the user_attr database, \
-+cleans up storage. called automatically by the destructor\n\
-+\tArguments: None\n\
-+\tReturns: None");
-+
-+PyDoc_STRVAR(pyrbac_getuserattr__doc__, "Return a single user_attr entry\n \
-+\tArguments: None\n\
-+\tReturns: a dict representation of a userattr_t struct:\n\
-+\t\t\"name\": username\n\
-+\t\t\"qualifier\": reserved\n\
-+\t\t\"res1\": reserved\n\
-+\t\t\"res2\": reserved\n\
-+\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
-+or a string depending on value"
-+);
-+
-+PyDoc_STRVAR(pyrbac_fgetuserattr__doc__, "Return a single user_attr entry \
-+from a file, bypassing nsswitch.conf\n\
-+\tArguments: \'filename\'\n\
-+\tReturns: a dict representation of a userattr_t struct:\n\
-+\t\t\"name\": username\n\
-+\t\t\"qualifier\": reserved\n\
-+\t\t\"res1\": reserved\n\
-+\t\t\"res2\": reserved\n\
-+\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
-+or a string depending on value");
-+
-+PyDoc_STRVAR(pyrbac_getusernam__doc__, "Searches for a user_attr entry with a \
-+given user name\n\
-+\tArgument: \'username\'\n\
-+\tReturns: a dict representation of a userattr_t struct:\n\
-+\t\t\"name\": username\n\
-+\t\t\"qualifier\": reserved\n\
-+\t\t\"res1\": reserved\n\
-+\t\t\"res2\": reserved\n\
-+\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
-+or a string depending on value");
-+
-+PyDoc_STRVAR(pyrbac_getuseruid__doc__, "Searches for a user_attr entry with a \
-+given uid\n\
-+\tArgument: uid\n\
-+\tReturns: a dict representation of a userattr_t struct:\n\
-+\t\t\"name\": username\n\
-+\t\t\"qualifier\": reserved\n\
-+\t\t\"res1\": reserved\n\
-+\t\t\"res2\": reserved\n\
-+\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
-+or a string depending on value");
-+
-+static PyMethodDef Userattr_methods[] = {
-+ {"setuserattr", pyrbac_setuserattr, METH_NOARGS, pyrbac_setuserattr__doc__},
-+ {"enduserattr", pyrbac_enduserattr, METH_NOARGS, pyrbac_enduserattr__doc__},
-+ {"getuserattr", pyrbac_getuserattr, METH_NOARGS, pyrbac_getuserattr__doc__},
-+ {"fgetuserattr", pyrbac_fgetuserattr, METH_VARARGS, pyrbac_fgetuserattr__doc__},
-+ {"getusernam", pyrbac_getusernam, METH_VARARGS, pyrbac_getusernam__doc__},
-+ {"getuseruid", pyrbac_getuseruid, METH_VARARGS, pyrbac_getuseruid__doc__},
-+ {NULL}
-+};
-+
-+PyTypeObject UserattrType = {
-+ PyObject_HEAD_INIT(NULL)
-+ 0, /*ob_size*/
-+ "rbac.userattr", /*tp_name*/
-+ sizeof(Userattr), /*tp_basicsize*/
-+ 0, /*tp_itemsize*/
-+ (destructor)Userattr_dealloc, /*tp_dealloc*/
-+ 0, /*tp_print*/
-+ 0, /*tp_getattr*/
-+ 0, /*tp_setattr*/
-+ 0, /*tp_compare*/
-+ 0, /*tp_repr*/
-+ 0, /*tp_as_number*/
-+ 0, /*tp_as_sequence*/
-+ 0, /*tp_as_mapping*/
-+ 0, /*tp_hash */
-+ 0, /*tp_call*/
-+ 0, /*tp_str*/
-+ 0, /*tp_getattro*/
-+ 0, /*tp_setattro*/
-+ 0, /*tp_as_buffer*/
-+ Py_TPFLAGS_DEFAULT |
-+ Py_TPFLAGS_BASETYPE |
-+ Py_TPFLAGS_HAVE_ITER, /*tp_flags*/
-+ pyrbac_userattr__doc__, /* tp_doc */
-+ 0, /* tp_traverse */
-+ 0, /* tp_clear */
-+ 0, /* tp_richcompare */
-+ 0, /* tp_weaklistoffset */
-+ pyrbac_userattr__iter__, /* tp_iter */
-+ pyrbac_userattr_next, /* tp_iternext */
-+ Userattr_methods, /* tp_methods */
-+ 0, /* tp_members */
-+ 0, /* tp_getset */
-+ 0, /* tp_base */
-+ 0, /* tp_dict */
-+ 0, /* tp_descr_get */
-+ 0, /* tp_descr_set */
-+ 0, /* tp_dictoffset */
-+ (initproc)Userattr_init, /* tp_init */
-+ 0, /* tp_alloc */
-+ Userattr_new, /* tp_new */
-+};
-diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
---- Python-2.6.4/setup.py
-+++ Python-2.6.4/setup.py
-@@ -1290,6 +1290,22 @@
- exts.append( Extension('dlpi', ['dlpimodule.c'],
- libraries = ['dlpi']) )
-
-+ # privileges module (Solaris)
-+ priv_inc = find_file('priv.h', [], inc_dirs)
-+ if priv_inc is not None:
-+ exts.append( Extension('privileges', ['privileges.c']))
-+
-+ # rbac module (Solaris)
-+ secdb_inc = find_file('secdb.h', [], inc_dirs)
-+ aa_inc = find_file('auth_attr.h', [], inc_dirs)
-+ ea_inc = find_file('exec_attr.h', [], inc_dirs)
-+ ua_inc = find_file('user_attr.h', [], inc_dirs)
-+ if secdb_inc is not None and aa_inc is not None and \
-+ ea_inc is not None and ua_inc is not None:
-+ exts.append( Extension('rbac', ['pyrbac.c', 'authattr.c', \
-+ 'execattr.c', 'userattr.c'],
-+ libraries = ['nsl', 'socket', 'secdb']) )
-+
- # Thomas Heller's _ctypes module
- self.detect_ctypes(inc_dirs, lib_dirs)
-
-diff --git Python-2.6.4/Lib/test/privrbac.py Python-2.6.4/Lib/test/privrbac.py
-new file mode 100644
---- /dev/null 2011-02-12 03:13:57.000000000 -0600
-+++ Python-2.6.4/Lib/test/privrbactest.py 2011-01-20 13:52:42.862305331 -0600
-@@ -0,0 +1,290 @@
-+#!/usr/bin/python2.6
-+#
-+# CDDL HEADER START
-+#
-+# The contents of this file are subject to the terms of the
-+# Common Development and Distribution License (the "License").
-+# You may not use this file except in compliance with the License.
-+#
-+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+# or http://www.opensolaris.org/os/licensing.
-+# See the License for the specific language governing permissions
-+# and limitations under the License.
-+#
-+# When distributing Covered Code, include this CDDL HEADER in each
-+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+# If applicable, add the following below this CDDL HEADER, with the
-+# fields enclosed by brackets "[]" replaced with your own identifying
-+# information: Portions Copyright [yyyy] [name of copyright owner]
-+#
-+# CDDL HEADER END
-+#
-+
-+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-+# Use is subject to license terms.
-+
-+import privileges
-+import rbac
-+import os
-+import sys
-+import tempfile
-+
-+# privileges tests
-+
-+def test_setppriv():
-+ amchild = os.fork()
-+ if amchild == 0:
-+ if privileges.setppriv(privileges.PRIV_OFF, privileges.PRIV_EFFECTIVE,
-+ ['proc_fork']):
-+ try:
-+ os.fork()
-+ sys.exit(1)
-+ except OSError, e:
-+ sys.exit(0)
-+
-+ child = os.wait()
-+ if child[1] is not 0:
-+ print "setppriv. Bad exit status from pid %i\n" % child[0]
-+ return False
-+ return True
-+
-+def test_getppriv():
-+ if 'proc_fork' in privileges.getppriv(privileges.PRIV_LIMIT):
-+ return True
-+ print "getppriv or PRIV_PROC_FORK not in PRIV_LIMIT.\n"
-+ return False
-+
-+def test_priv_ineffect():
-+ if privileges.priv_ineffect('proc_fork'):
-+ return True
-+ print "priv_ineffect or PRIV_PROC_FORK not in effect\n"
-+ return False
-+
-+# authattr tests
-+
-+def test_chkauthattr():
-+ try:
-+ a = rbac.authattr()
-+ except Exception, e:
-+ print "Could not instantiate authattr object: %s\n" % e
-+ return False
-+ try:
-+ res = a.chkauthattr('solaris.*', 'root')
-+ except Exception, e:
-+ print "chkauthattr failed: %s\n" % e
-+ return False
-+ if not res:
-+ print "chkauthattr failed or \'root\' lacks \'solaris.*\'\n"
-+ return False
-+ return True
-+
-+def test_getauthattr():
-+ try:
-+ a = rbac.authattr()
-+ except Exception, e:
-+ print "Could not instantiate authattr object: %s\n" % e
-+ return False
-+ try:
-+ res = a.getauthattr()
-+ except Exception, e:
-+ print "getauthattr failed: %s\n" % e
-+ return False
-+ if not 'name' in res.keys():
-+ print "getauthattr failed\n"
-+ return False
-+ return True
-+
-+def test_getauthnam():
-+ try:
-+ a = rbac.authattr()
-+ except Exception, e:
-+ print "Could not instantiate authattr object: %s\n" % e
-+ return False
-+ try:
-+ res = a.getauthnam('solaris.')
-+ except Exception, e:
-+ print "getauthnam failed: %s\n" % e
-+ return False
-+ if not res:
-+ print "getauthnam failed or \'solaris.\' not in auth_attr(4)\n"
-+ return False
-+ return True
-+
-+def test_authattr_iter():
-+ try:
-+ a = rbac.authattr()
-+ except Exception, e:
-+ print "Could not instantiate authattr object: %s\n" % e
-+ return False
-+ res = a.next()
-+ if not 'name' in res.keys() or type(a) != type(a.__iter__()):
-+ print "authattr object is not an iterable\n"
-+ return False
-+ return True
-+
-+# execattr tests
-+
-+def test_getexecattr():
-+ try:
-+ a = rbac.execattr()
-+ except Exception, e:
-+ print "Could not instantiate execattr object: %s\n" % e
-+ return False
-+ try:
-+ res = a.getexecattr()
-+ except Exception, e:
-+ print "getexecattr failed: %s\n" % e
-+ return False
-+ if not 'name' in res.keys():
-+ print "getexecattr failed\n"
-+ return False
-+ return True
-+
-+def test_getexecuser():
-+ try:
-+ a = rbac.execattr()
-+ except Exception, e:
-+ print "Could not instantiate execattr object: %s\n" % e
-+ return False
-+ try:
-+ res = a.getexecuser("root", "act", "*;*;*;*;*")
-+ except Exception, e:
-+ print "getexecuser failed: %s\n" % e
-+ return False
-+ if not res:
-+ print "getexecuser failed or \'root\' not assigned to \'act\', " \
-+ "\'*;*;*;*;*\' \n"
-+ return False
-+ return True
-+
-+
-+def test_getexecprof():
-+ try:
-+ a = rbac.execattr()
-+ except Exception, e:
-+ print "Could not instantiate execattr object: %s\n" % e
-+ return False
-+ try:
-+ res = a.getexecprof("All", "cmd", "*")
-+ except Exception, e:
-+ print "getexecprof failed: %s\n" % e
-+ return False
-+ if not res:
-+ print "getexecprof failed or \'All\' not granted \'cmd\' : \'*\'\n"
-+ return False
-+ return True
-+
-+def test_execattr_iter():
-+ try:
-+ a = rbac.execattr()
-+ except Exception, e:
-+ print "Could not instantiate execattr object: %s\n" % e
-+ return False
-+ res = a.next()
-+ if not 'name' in res.keys() or type(a) != type(a.__iter__()):
-+ print "execattr object is not an iterable\n"
-+ return False
-+ return True
-+
-+# userattr tests
-+
-+def test_getuserattr():
-+ try:
-+ a = rbac.userattr()
-+ except Exception, e:
-+ print "Could not instantiate userattr object: %s\n" % e
-+ return False
-+ try:
-+ res = a.getuserattr()
-+ except Exception, e:
-+ print "getuserattr failed: %s\n" % e
-+ return False
-+ if not 'name' in res.keys():
-+ print "getuserattr failed\n"
-+ return False
-+ return True
-+
-+def test_fgetuserattr():
-+ temp = tempfile.NamedTemporaryFile()
-+ temp.write("user::::profiles=Software Installation;roles=foo;"\
-+ "auths=solaris.foo.bar")
-+ temp.seek(0)
-+ try:
-+ a = rbac.userattr()
-+ except Exception, e:
-+ print "Could not instantiate userattr object: %s\n" % e
-+ return False
-+ try:
-+ res = a.fgetuserattr(temp.name)
-+ temp.close()
-+ except Exception, e:
-+ print "fgetuserattr failed: %s\n" % e
-+ temp.close()
-+ return False
-+ if not 'name' in res.keys():
-+ print "fgetuserattr failed\n"
-+ return False
-+ return True
-+
-+def test_getuseruid():
-+ try:
-+ a = rbac.userattr()
-+ except Exception, e:
-+ print "Could not instantiate userattr object: %s\n" % e
-+ return False
-+ try:
-+ res = a.getuseruid(0)
-+ except Exception, e:
-+ print "getusernam failed: %s\n" % e
-+ return False
-+ if not 'name' in res:
-+ print "getusernam failed or no uid 0\n"
-+ return False
-+ return True
-+
-+def test_getusernam():
-+ try:
-+ a = rbac.userattr()
-+ except Exception, e:
-+ print "Could not instantiate userattr object: %s\n" % e
-+ return False
-+ try:
-+ res = a.getusernam('root')
-+ except Exception, e:
-+ print "getusernam failed: %s\n" % e
-+ return False
-+ if not 'name' in res:
-+ print "getusernam failed or no \'root\' user\n"
-+ return False
-+ return True
-+
-+def test_userattr_iter():
-+ try:
-+ a = rbac.userattr()
-+ except Exception, e:
-+ print "Could not instantiate userattr object: %s\n" % e
-+ return False
-+ res = a.next()
-+ if not 'name' in res.keys() or type(a) != type(a.__iter__()):
-+ print "userattr object is not an iterable\n"
-+ return False
-+ return True
-+
-+if not test_setppriv() or not test_getppriv() or not test_priv_ineffect():
-+ print "*** Failures detected in privileges module\n"
-+ sys.exit(1)
-+
-+if not test_getauthattr() or not test_chkauthattr() or not test_getauthnam() \
-+ or not test_authattr_iter:
-+ print "*** Failures detected in rbac.authattr\n"
-+ sys.exit(1)
-+
-+if not test_getexecattr() or not test_getexecuser() or not test_getexecprof() \
-+ or not test_execattr_iter():
-+ print "*** Failures detected in rbac.execattr\n"
-+ sys.exit(1)
-+
-+if not test_getuserattr() or not test_fgetuserattr() or not test_getusernam()\
-+ or not test_getuseruid() or not test_userattr_iter():
-+ print "*** Failures detected in rbac.userattr\n"
-+ sys.exit(1)
--- a/components/python/python26/Python26-17-netpacket-packet-h.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-diff --git Python-2.6.4/Modules/socketmodule.c Python-2.6.4/Modules/socketmodule.c
---- Python-2.6.4/Modules/socketmodule.c
-+++ Python-2.6.4/Modules/socketmodule.c
-@@ -81,6 +81,14 @@
-
- */
-
-+#ifdef HAVE_NETPACKET_PACKET_H
-+#ifdef sun
-+#define USE_NETPACKET_PACKET_H 0
-+#else
-+#define USE_NETPACKET_PACKET_H 1
-+#endif
-+#endif
-+
- #ifdef __APPLE__
- /*
- * inet_aton is not available on OSX 10.3, yet we want to use a binary
-@@ -1092,7 +1100,7 @@
- }
- #endif
-
--#ifdef HAVE_NETPACKET_PACKET_H
-+#if USE_NETPACKET_PACKET_H
- case AF_PACKET:
- {
- struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
-@@ -1382,7 +1390,7 @@
- }
- #endif
-
--#ifdef HAVE_NETPACKET_PACKET_H
-+#if USE_NETPACKET_PACKET_H
- case AF_PACKET:
- {
- struct sockaddr_ll* addr;
-@@ -1559,7 +1567,7 @@
- }
- #endif
-
--#ifdef HAVE_NETPACKET_PACKET_H
-+#if USE_NETPACKET_PACKET_H
- case AF_PACKET:
- {
- *len_ret = sizeof (struct sockaddr_ll);
-@@ -4578,7 +4586,7 @@
- PyModule_AddStringConstant(m, "BDADDR_LOCAL", "00:00:00:FF:FF:FF");
- #endif
-
--#ifdef HAVE_NETPACKET_PACKET_H
-+#if USE_NETPACKET_PACKET_H
- PyModule_AddIntConstant(m, "AF_PACKET", AF_PACKET);
- PyModule_AddIntConstant(m, "PF_PACKET", PF_PACKET);
- PyModule_AddIntConstant(m, "PACKET_HOST", PACKET_HOST);
--- a/components/python/python26/Python26-18-readline.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
---- Python-2.6.4/setup.py
-+++ Python-2.6.4/setup.py
-@@ -572,6 +572,14 @@
- # This way a staticly linked custom readline gets picked up
- # before the (broken) dynamic library in /usr/lib.
- readline_extra_link_args = ('-Wl,-search_paths_first',)
-+ elif sys.platform == 'sunos5':
-+ if sys.maxint != 9223372036854775807L:
-+ readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib,-R/usr/gnu/lib,-lreadline,-lncurses',)
-+ else:
-+ if os.path.exists('/usr/gnu/lib/sparcv9'):
-+ readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib/sparcv9,-R/usr/gnu/lib/sparcv9,-lreadline,-lncurses',)
-+ else:
-+ readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib/amd64,-R/usr/gnu/lib/amd64,-lreadline,-lncurses',)
- else:
- readline_extra_link_args = ()
-
-@@ -588,6 +596,12 @@
- ['/usr/lib/termcap'],
- 'termcap'):
- readline_libs.append('termcap')
-+
-+ if sys.platform == 'sunos5':
-+ # ugly hack to make the build respect -zrecord set in
-+ # readline_extra_link_args above
-+ readline_libs = []
-+
- exts.append( Extension('readline', ['readline.c'],
- library_dirs=['/usr/lib/termcap'],
- extra_link_args=readline_extra_link_args,
--- a/components/python/python26/Python26-19-ext-stdio.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-diff --git Python-2.6.4/Modules/python.c Python-2.6.4/Modules/python.c
---- Python-2.6.4/Modules/python.c
-+++ Python-2.6.4/Modules/python.c
-@@ -6,6 +6,13 @@
- #include <floatingpoint.h>
- #endif
-
-+#if defined(sun) && defined(__SVR4) && !defined(_LP64)
-+#define USE_EXTENDED_FILE_STDIO 1
-+#include <stdio.h>
-+#include <stdio_ext.h>
-+#include <signal.h>
-+#endif
-+
- int
- main(int argc, char **argv)
- {
-@@ -20,5 +27,16 @@
- m = fpgetmask();
- fpsetmask(m & ~FP_X_OFL);
- #endif
-+#ifdef USE_EXTENDED_FILE_STDIO
-+ /* enable extended FILE facility on Solaris so that Python
-+ apps can keep more than 256 file descriptors open */
-+ struct rlimit rlp;
-+ (void) getrlimit(RLIMIT_NOFILE, &rlp);
-+ rlp.rlim_cur = rlp.rlim_max;
-+ if (setrlimit(RLIMIT_NOFILE, &rlp) != -1) {
-+ enable_extended_FILE_stdio(-1, SIGABRT);
-+ }
-+#endif
-+
- return Py_Main(argc, argv);
- }
--- a/components/python/python26/Python26-20-py_db.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1047 +0,0 @@
-diff --git Python-2.6.4/Makefile.pre.in.orig Python-2.6.4/Makefile.pre.in
---- Python-2.6.4/Makefile.pre.in.orig Sun Feb 13 19:37:16 2011
-+++ Python-2.6.4/Makefile.pre.in Sun Feb 13 20:55:04 2011
-@@ -354,7 +354,7 @@
-
- # Default target
- all: build_all
--build_all: $(BUILDPYTHON) oldsharedmods sharedmods
-+build_all: $(BUILDPYTHON) oldsharedmods sharedmods build-py_db
-
- # Compile a binary with gcc profile guided optimization.
- profile-opt:
-@@ -677,6 +677,20 @@
-
- $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
-
-+SHLIB_FLAGS = -shared -fpic -M $(srcdir)/py_db/mapfile-vers
-+
-+libpython2.6_db.so.1.0: $(srcdir)/py_db/libpython26_db.c
-+ $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(SHLIB_FLAGS) $<
-+
-+check_offset: $(srcdir)/py_db/check_offsets.c
-+ $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $<
-+
-+build-py_db: libpython2.6_db.so.1.0 check_offset
-+
-+install-py_db: libpython2.6_db.so.1.0 check_offset
-+ $(INSTALL_SHARED) libpython2.6_db.so.1.0 $(DESTDIR)$(LIBDIR)
-+ $(INSTALL_PROGRAM) check_offset $(DESTDIR)$(BINDIR)
-+
- install-pycc: $(srcdir)/pycc
- $(INSTALL_SCRIPT $< $(DESTDIR)$(BINLIBDEST)
-
-@@ -742,7 +755,7 @@
- $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
-
- # Install everything
--install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@ install-pycc
-+install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@ install-py_db install-pycc
-
- # Install almost everything without disturbing previous versions
- altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
-
-diff --git Python-2.6.4/py_db/check_offsets.c Python-2.6.4/py_db/check_offsets.c
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/py_db/check_offsets.c
-@@ -0,0 +1,88 @@
-+/*
-+ * CDDL HEADER START
-+ *
-+ * The contents of this file are subject to the terms of the
-+ * Common Development and Distribution License (the "License").
-+ * You may not use this file except in compliance with the License.
-+ *
-+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+ * or http://www.opensolaris.org/os/licensing.
-+ * See the License for the specific language governing permissions
-+ * and limitations under the License.
-+ *
-+ * When distributing Covered Code, include this CDDL HEADER in each
-+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+ * If applicable, add the following below this CDDL HEADER, with the
-+ * fields enclosed by brackets "[]" replaced with your own identifying
-+ * information: Portions Copyright [yyyy] [name of copyright owner]
-+ *
-+ * CDDL HEADER END
-+ */
-+/*
-+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+#include <stdio.h>
-+
-+#include <Python.h>
-+#include <frameobject.h>
-+
-+#include "libpython26_db_32.h"
-+
-+#if 0
-+#define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
-+#endif
-+
-+int
-+main(void)
-+{
-+/*
-+ * PyCodeObject co_name
-+ * PyCodeObject co_filename
-+ * PyCodeObject co_lnotab
-+ * PyFrameObject f_back
-+ * PyFrameObject f_code
-+ * PyFrameObject f_lasti
-+ * PyInterpreterState next
-+ * PyInterpreterState tstate_head
-+ * PyStringObject ob_sval
-+ * PyStringObject ob_size
-+ * PyThreadState frame
-+ * PyThreadState next
-+ */
-+
-+ printf("struct member: native 32\n");
-+ printf("PyCodeObject co_name: %d %d\n", offsetof(PyCodeObject, co_name),
-+ offsetof(PyCodeObject32, co_name));
-+ printf("PyCodeObject co_filename: %d %d\n", offsetof(PyCodeObject,
-+ co_filename), offsetof(PyCodeObject32, co_filename));
-+ printf("PyCodeObject co_lnotab: %d %d\n", offsetof(PyCodeObject,
-+ co_lnotab), offsetof(PyCodeObject32, co_lnotab));
-+ printf("PyFrameObject f_back: %d %d\n", offsetof(PyFrameObject, f_back),
-+ offsetof(PyFrameObject32, f_back));
-+ printf("PyFrameObject f_code: %d %d\n", offsetof(PyFrameObject, f_code),
-+ offsetof(PyFrameObject32, f_code));
-+ printf("PyFrameObject f_lasti: %d %d\n", offsetof(PyFrameObject,
-+ f_lasti), offsetof(PyFrameObject32, f_lasti));
-+ printf("PyInterpreterState next: %d %d\n", offsetof(PyInterpreterState,
-+ next), offsetof(PyInterpreterState32, next));
-+ printf("PyInterpreterState tstate_head: %d %d\n",
-+ offsetof(PyInterpreterState, tstate_head),
-+ offsetof(PyInterpreterState32, tstate_head));
-+ printf("PyStringObject ob_sval: %d %d\n", offsetof(PyStringObject,
-+ ob_sval), offsetof(PyStringObject32, ob_sval));
-+ printf("PyStringObject ob_size: %d %d\n", offsetof(PyStringObject,
-+ ob_size), offsetof(PyStringObject32, ob_size));
-+ printf("PyThreadState frame: %d %d\n", offsetof(PyThreadState, frame),
-+ offsetof(PyThreadState32, frame));
-+ printf("PyThreadState next: %d %d\n", offsetof(PyThreadState, next),
-+ offsetof(PyThreadState32, next));
-+
-+ printf("\nObject sizes\n");
-+ printf("PyObject: %d %d\n", sizeof (PyObject), sizeof (PyObject32));
-+ printf("PyVarObject: %d %d\n", sizeof (PyVarObject),
-+ sizeof (PyVarObject32));
-+
-+ return (0);
-+}
-diff --git Python-2.6.4/py_db/libpython26_db.c Python-2.6.4/py_db/libpython26_db.c
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/py_db/libpython26_db.c
-@@ -0,0 +1,655 @@
-+/*
-+ * CDDL HEADER START
-+ *
-+ * The contents of this file are subject to the terms of the
-+ * Common Development and Distribution License (the "License").
-+ * You may not use this file except in compliance with the License.
-+ *
-+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+ * or http://www.opensolaris.org/os/licensing.
-+ * See the License for the specific language governing permissions
-+ * and limitations under the License.
-+ *
-+ * When distributing Covered Code, include this CDDL HEADER in each
-+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+ * If applicable, add the following below this CDDL HEADER, with the
-+ * fields enclosed by brackets "[]" replaced with your own identifying
-+ * information: Portions Copyright [yyyy] [name of copyright owner]
-+ *
-+ * CDDL HEADER END
-+ */
-+/*
-+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <string.h>
-+#include <errno.h>
-+#include <gelf.h>
-+
-+#include <Python.h>
-+#include <frameobject.h>
-+
-+#include "libpython26_db.h"
-+#if defined(_LP64)
-+#include "libpython26_db_32.h"
-+#endif /* _LP64 */
-+
-+/*
-+ * Because MDB always runs the debugger in the same datamodel as the target,
-+ * only functions that are used by the procfs part of this interface (or shared
-+ * between the two) are written as 64->32 aware.
-+ */
-+typedef struct pydb_arch_ops {
-+ ssize_t (*strobj_readdata)(pydb_agent_t *, uintptr_t, unsigned char *,
-+ size_t);
-+ int (*frameinfo)(pydb_agent_t *, uintptr_t, char *,
-+ size_t, char *, size_t, int *);
-+} pydb_arch_ops_t;
-+
-+struct pydb_agent {
-+ struct ps_prochandle *pdb_ph;
-+ int pdb_vers;
-+ int pdb_is_64bit;
-+ int pdb_datamodel;
-+ const pydb_arch_ops_t *pdb_ops;
-+};
-+
-+typedef uintptr_t (*pdi_next_cb_t)(pydb_iter_t *);
-+
-+struct pydb_iter {
-+ struct ps_prochandle *pdi_ph;
-+ uintptr_t pdi_current;
-+ pdi_next_cb_t pdi_nextf;
-+};
-+
-+#define LIBPYTHON "libpython2.6.so"
-+
-+#define MIN(x, y) (((x) < (y)) ? (x) : (y))
-+
-+/* Generic interface to helper functions */
-+static ssize_t pydb_strobj_readdata(pydb_agent_t *py, uintptr_t addr,
-+ unsigned char *buf, size_t buf_len);
-+static int pydb_getlno(pydb_agent_t *py, uintptr_t lnotab_addr, int firstline,
-+ int lastinst);
-+static int pydb_frameinfo(pydb_agent_t *py, uintptr_t addr, char *funcnm,
-+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno);
-+
-+/* datamodel specific implementation of helper functions */
-+static ssize_t pydb_strobj_readdata_native(pydb_agent_t *py, uintptr_t addr,
-+ unsigned char *buf, size_t buf_len);
-+static int pydb_frameinfo_native(pydb_agent_t *py, uintptr_t addr, char *funcnm,
-+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno);
-+
-+#if defined (_LP64)
-+static ssize_t pydb_strobj_readdata_32(pydb_agent_t *py, uintptr_t addr,
-+ unsigned char *buf, size_t buf_len);
-+static int pydb_frameinfo_32(pydb_agent_t *py, uintptr_t addr, char *funcnm,
-+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno);
-+#endif /* _LP64 */
-+
-+static ssize_t pydb_strobj_readstr(pydb_agent_t *py, uintptr_t addr, char *buf,
-+ size_t len);
-+
-+/* Iterator function next routines. Plugable, configured by iterator init */
-+static uintptr_t pydb_frame_iter_next(pydb_iter_t *iter);
-+static uintptr_t pydb_interp_iter_next(pydb_iter_t *iter);
-+static uintptr_t pydb_thread_iter_next(pydb_iter_t *iter);
-+
-+static const char *strbasename(const char *s);
-+
-+static const pydb_arch_ops_t arch_ops_native = {
-+ .frameinfo = pydb_frameinfo_native,
-+ .strobj_readdata = pydb_strobj_readdata_native,
-+};
-+
-+#if defined (_LP64)
-+static const pydb_arch_ops_t arch_ops_32 = {
-+ .frameinfo = pydb_frameinfo_32,
-+ .strobj_readdata = pydb_strobj_readdata_32,
-+};
-+#endif /* _LP64 */
-+
-+static const char *
-+strbasename(const char *s)
-+{
-+ const char *p = strrchr(s, '/');
-+
-+ if (p == NULL)
-+ return (s);
-+
-+ return (++p);
-+}
-+
-+/* Agent creation / destruction routines */
-+
-+pydb_agent_t *
-+pydb_agent_create(struct ps_prochandle *P, int vers)
-+{
-+ pydb_agent_t *py;
-+ int datamodel;
-+
-+ if (vers != PYDB_VERSION) {
-+ errno = ENOTSUP;
-+ return (NULL);
-+ }
-+
-+ if (ps_pdmodel(P, &datamodel) != PS_OK) {
-+ return (NULL);
-+ }
-+
-+ py = (pydb_agent_t *)malloc(sizeof (pydb_agent_t));
-+ if (py == NULL) {
-+ return (NULL);
-+ }
-+
-+ py->pdb_ph = P;
-+ py->pdb_vers = vers;
-+ py->pdb_datamodel = datamodel;
-+ py->pdb_is_64bit = 0;
-+ py->pdb_ops = &arch_ops_native;
-+
-+#if defined (_LP64)
-+ py->pdb_is_64bit = (datamodel == PR_MODEL_LP64);
-+ if (!py->pdb_is_64bit) {
-+ py->pdb_ops = &arch_ops_32;
-+ }
-+#endif /* _LP64 */
-+
-+ return (py);
-+}
-+
-+void
-+pydb_agent_destroy(pydb_agent_t *py)
-+{
-+ if (py == NULL) {
-+ return;
-+ }
-+
-+ free(py);
-+}
-+
-+/* Helper functions */
-+static int
-+pydb_getlno(pydb_agent_t *py, uintptr_t lnotab_addr, int firstline,
-+ int lastinst)
-+{
-+ unsigned char lnotab[4096];
-+ ssize_t lnotab_len;
-+ int addr, line;
-+ int i;
-+
-+ lnotab_len = pydb_strobj_readdata(py, lnotab_addr, lnotab,
-+ sizeof (lnotab));
-+ if (lnotab_len < 0) {
-+ return (-1);
-+ }
-+
-+ /*
-+ * Python's line number algorithm is arcane. See here for details:
-+ * http://svn.python.org/projects/python/trunk/Objects/lnotab_notes.txt
-+ */
-+
-+ line = firstline;
-+ for (addr = i = 0; i < lnotab_len; i += 2) {
-+ if (addr + lnotab[i] > lastinst) {
-+ break;
-+ }
-+ addr += lnotab[i];
-+ line += lnotab[i + 1];
-+ }
-+
-+ return (line);
-+}
-+
-+static ssize_t
-+pydb_strobj_readdata(pydb_agent_t *py, uintptr_t addr, unsigned char *buf,
-+ size_t buf_len)
-+{
-+ return (py->pdb_ops->strobj_readdata(py, addr, buf, buf_len));
-+}
-+
-+static ssize_t
-+pydb_strobj_readdata_native(pydb_agent_t *py, uintptr_t addr,
-+ unsigned char *buf, size_t buf_len)
-+{
-+ PyStringObject sobj;
-+ ssize_t obj_sz;
-+ ssize_t read_sz;
-+ psaddr_t straddr;
-+
-+ /*
-+ * PyStringObjects are variable size. The size of the PyStringObject
-+ * struct is fixed, and known at compile time; however, the size of the
-+ * associated buffer is variable. The char[1] element at the end of the
-+ * structure contains the string, and the ob_size of the PyStringObject
-+ * indicates how much extra space was allocated to contain the string
-+ * buffer at the object's tail. Read in the fixed size portion of the
-+ * object first, and then read the contents of the data buffer into the
-+ * buffer passed by the caller.
-+ */
-+
-+ if (ps_pread(py->pdb_ph, addr, &sobj, sizeof (PyStringObject))
-+ != PS_OK) {
-+ return (-1);
-+ }
-+
-+ obj_sz = (ssize_t)PyString_GET_SIZE(&sobj);
-+
-+ read_sz = MIN(obj_sz, (ssize_t)buf_len);
-+ straddr = (psaddr_t)(addr + offsetof(PyStringObject, ob_sval));
-+
-+ if (ps_pread(py->pdb_ph, straddr, buf, (size_t)read_sz) != PS_OK) {
-+ return (-1);
-+ }
-+
-+ return (read_sz);
-+}
-+
-+#if defined(_LP64)
-+static ssize_t
-+pydb_strobj_readdata_32(pydb_agent_t *py, uintptr_t addr,
-+ unsigned char *buf, size_t buf_len)
-+{
-+ PyStringObject32 sobj;
-+ ssize_t obj_sz;
-+ ssize_t read_sz;
-+ psaddr_t straddr;
-+
-+ /*
-+ * PyStringObjects are variable size. The size of the PyStringObject
-+ * struct is fixed, and known at compile time; however, the size of the
-+ * associated buffer is variable. The char[1] element at the end of the
-+ * structure contains the string, and the ob_size of the PyStringObject
-+ * indicates how much extra space was allocated to contain the string
-+ * buffer at the object's tail. Read in the fixed size portion of the
-+ * object first, and then read the contents of the data buffer into the
-+ * buffer passed by the caller.
-+ */
-+
-+ if (ps_pread(py->pdb_ph, addr, &sobj, sizeof (PyStringObject32))
-+ != PS_OK) {
-+ return (-1);
-+ }
-+
-+ obj_sz = (ssize_t)PyString_GET_SIZE32(&sobj);
-+
-+ read_sz = MIN(obj_sz, (ssize_t)buf_len);
-+ straddr = (psaddr_t)(addr + offsetof(PyStringObject32, ob_sval));
-+
-+ if (ps_pread(py->pdb_ph, straddr, buf, (size_t)read_sz) != PS_OK) {
-+ return (-1);
-+ }
-+
-+ return (read_sz);
-+}
-+#endif /* _LP64 */
-+
-+/*
-+ * Most Python PyStringObjects contain strings, as one would expect. However,
-+ * due to some sleazy hackery in parts of the Python code, some string objects
-+ * are used as buffers for binary data. In the general case,
-+ * pydb_strobj_readstr() should be used to read strings out of string objects.
-+ * It wraps pydb_strobj_readdata(), which should be used by callers only when
-+ * trying to retrieve binary data. (This routine does some string cleanup).
-+ */
-+static ssize_t
-+pydb_strobj_readstr(pydb_agent_t *py, uintptr_t addr, char *buf,
-+ size_t buf_len)
-+{
-+ ssize_t read_sz;
-+
-+ read_sz = pydb_strobj_readdata(py, addr, (unsigned char *)buf, buf_len);
-+
-+ if (read_sz >= 0) {
-+ if (read_sz >= buf_len) {
-+ read_sz = buf_len - 1;
-+ }
-+
-+ buf[read_sz] = '\0';
-+ }
-+
-+ return (read_sz);
-+}
-+
-+
-+static int
-+pydb_frameinfo(pydb_agent_t *py, uintptr_t addr, char *funcnm,
-+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno)
-+{
-+ return (py->pdb_ops->frameinfo(py, addr, funcnm, funcnm_sz,
-+ filenm, filenm_sz, lineno));
-+}
-+
-+static int
-+pydb_frameinfo_native(pydb_agent_t *py, uintptr_t addr, char *funcnm,
-+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno)
-+{
-+ PyFrameObject fo;
-+ PyCodeObject co;
-+ ssize_t rc;
-+
-+ if (ps_pread(py->pdb_ph, addr, &fo, sizeof (PyFrameObject))
-+ != PS_OK) {
-+ return (-1);
-+ }
-+
-+ if (ps_pread(py->pdb_ph, (uintptr_t)fo.f_code, &co,
-+ sizeof (PyCodeObject)) != PS_OK) {
-+ return (-1);
-+ }
-+
-+ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_name, funcnm, funcnm_sz);
-+ if (rc < 0) {
-+ return (-1);
-+ }
-+
-+ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_filename, filenm,
-+ filenm_sz);
-+ if (rc < 0) {
-+ return (-1);
-+ }
-+
-+ *lineno = pydb_getlno(py, (uintptr_t)co.co_lnotab, co.co_firstlineno,
-+ fo.f_lasti);
-+ if (*lineno < 0) {
-+ return (-1);
-+ }
-+
-+ return (0);
-+}
-+
-+#if defined (_LP64)
-+static int
-+pydb_frameinfo_32(pydb_agent_t *py, uintptr_t addr, char *funcnm,
-+ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno)
-+{
-+ PyFrameObject32 fo;
-+ PyCodeObject32 co;
-+ ssize_t rc;
-+
-+ if (ps_pread(py->pdb_ph, addr, &fo, sizeof (PyFrameObject32))
-+ != PS_OK) {
-+ return (-1);
-+ }
-+
-+ if (ps_pread(py->pdb_ph, (uintptr_t)fo.f_code, &co,
-+ sizeof (PyCodeObject32)) != PS_OK) {
-+ return (-1);
-+ }
-+
-+ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_name, funcnm, funcnm_sz);
-+ if (rc < 0) {
-+ return (-1);
-+ }
-+
-+ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_filename, filenm,
-+ filenm_sz);
-+ if (rc < 0) {
-+ return (-1);
-+ }
-+
-+ *lineno = pydb_getlno(py, (uintptr_t)co.co_lnotab, co.co_firstlineno,
-+ fo.f_lasti);
-+ if (*lineno < 0) {
-+ return (-1);
-+ }
-+
-+ return (0);
-+}
-+
-+#endif /* _LP64 */
-+
-+/* Functions that are part of the library's interface */
-+
-+/*
-+ * Given the address of a PyFrameObject, and a buffer of a known size,
-+ * fill the buffer with a description of the frame.
-+ */
-+int
-+pydb_get_frameinfo(pydb_agent_t *py, uintptr_t frame_addr, char *fbuf,
-+ size_t bufsz, int verbose)
-+{
-+ char funcname[1024];
-+ char filename[1024];
-+ char *fn;
-+ int lineno;
-+ int length = (py->pdb_is_64bit ? 16 : 8);
-+ int rc;
-+
-+ rc = pydb_frameinfo(py, frame_addr, funcname, sizeof (funcname),
-+ filename, sizeof (filename), &lineno);
-+ if (rc < 0) {
-+ return (-1);
-+ }
-+
-+ if (!verbose) {
-+ fn = (char *)strbasename(filename);
-+ } else {
-+ fn = filename;
-+ }
-+
-+ (void) snprintf(fbuf, bufsz, "%0.*lx %s:%d %s()\n", length,
-+ frame_addr, fn, lineno, funcname);
-+
-+ return (0);
-+}
-+
-+/*
-+ * Return a description about a PyFrameObject, if the object is
-+ * actually a PyFrameObject. In this case, the pc argument is checked
-+ * to make sure that it came from a function that takes a PyFrameObject
-+ * as its first (argv[0]) argument.
-+ */
-+int
-+pydb_pc_frameinfo(pydb_agent_t *py, uintptr_t pc, uintptr_t frame_addr,
-+ char *fbuf, size_t bufsz)
-+{
-+ char funcname[1024];
-+ char filename[1024];
-+ int lineno;
-+ int rc;
-+ ps_sym_t psym;
-+
-+ /*
-+ * If PC doesn't match PyEval_EvalFrameEx in either libpython
-+ * or the executable, don't decode it.
-+ */
-+ if (ps_pglobal_sym(py->pdb_ph, LIBPYTHON, "PyEval_EvalFrameEx", &psym)
-+ != PS_OK) {
-+ return (-1);
-+ }
-+
-+ /* If symbol found, ensure that PC falls within PyEval_EvalFrameEx. */
-+ if (pc < psym.st_value || pc > psym.st_value + psym.st_size) {
-+ return (-1);
-+ }
-+
-+ rc = pydb_frameinfo(py, frame_addr, funcname, sizeof (funcname),
-+ filename, sizeof (filename), &lineno);
-+ if (rc < 0) {
-+ return (-1);
-+ }
-+
-+ (void) snprintf(fbuf, bufsz, "[ %s:%d (%s) ]\n", filename, lineno,
-+ funcname);
-+
-+ return (0);
-+}
-+
-+/*
-+ * Walks the list of PyInterpreterState objects. If caller doesn't
-+ * supply address of list, this method will look it up.
-+ */
-+pydb_iter_t *
-+pydb_interp_iter_init(pydb_agent_t *py, uintptr_t addr)
-+{
-+ pydb_iter_t *itr;
-+ uintptr_t i_addr;
-+ int rc;
-+
-+ if (addr == 0) {
-+ rc = ps_pglobal_lookup(py->pdb_ph, LIBPYTHON, "interp_head",
-+ (psaddr_t *)&addr);
-+ if (rc != PS_OK) {
-+ return (NULL);
-+ }
-+ }
-+
-+ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &i_addr, sizeof (uintptr_t))
-+ != PS_OK) {
-+ return (NULL);
-+ }
-+
-+ itr = malloc(sizeof (pydb_iter_t));
-+ if (itr == NULL) {
-+ return (NULL);
-+ }
-+
-+ itr->pdi_ph = py->pdb_ph;
-+ itr->pdi_current = i_addr;
-+ itr->pdi_nextf = pydb_interp_iter_next;
-+
-+ return (itr);
-+}
-+
-+static uintptr_t
-+pydb_interp_iter_next(pydb_iter_t *iter)
-+{
-+ PyInterpreterState st;
-+ uintptr_t cur;
-+
-+ cur = iter->pdi_current;
-+
-+ if (cur == 0) {
-+ return (cur);
-+ }
-+
-+ if (ps_pread(iter->pdi_ph, cur, &st, sizeof (PyInterpreterState))
-+ != PS_OK) {
-+ iter->pdi_current = 0;
-+ return (0);
-+ }
-+
-+ iter->pdi_current = (uintptr_t)st.next;
-+
-+ return (cur);
-+}
-+
-+/*
-+ * Walk a list of Python PyFrameObjects. The addr argument must be
-+ * the address of a valid PyThreadState object.
-+ */
-+pydb_iter_t *
-+pydb_frame_iter_init(pydb_agent_t *py, uintptr_t addr)
-+{
-+ pydb_iter_t *itr;
-+ PyThreadState ts;
-+
-+ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &ts, sizeof (PyThreadState))
-+ != PS_OK) {
-+ return (NULL);
-+ }
-+
-+ itr = malloc(sizeof (pydb_iter_t));
-+ if (itr == NULL) {
-+ return (NULL);
-+ }
-+
-+ itr->pdi_ph = py->pdb_ph;
-+ itr->pdi_current = (uintptr_t)ts.frame;
-+ itr->pdi_nextf = pydb_frame_iter_next;
-+
-+ return (itr);
-+}
-+
-+static uintptr_t
-+pydb_frame_iter_next(pydb_iter_t *iter)
-+{
-+ PyFrameObject fo;
-+ uintptr_t cur;
-+
-+ cur = iter->pdi_current;
-+
-+ if (cur == 0) {
-+ return (cur);
-+ }
-+
-+ if (ps_pread(iter->pdi_ph, cur, &fo, sizeof (PyFrameObject))
-+ != PS_OK) {
-+ iter->pdi_current = 0;
-+ return (0);
-+ }
-+
-+ iter->pdi_current = (uintptr_t)fo.f_back;
-+
-+ return (cur);
-+}
-+
-+/*
-+ * Walk a list of Python PyThreadState objects. The addr argument must be
-+ * the address of a valid PyInterpreterState object.
-+ */
-+pydb_iter_t *
-+pydb_thread_iter_init(pydb_agent_t *py, uintptr_t addr)
-+{
-+ pydb_iter_t *itr;
-+ PyInterpreterState is;
-+
-+ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &is,
-+ sizeof (PyInterpreterState)) != PS_OK) {
-+ return (NULL);
-+ }
-+
-+ itr = malloc(sizeof (pydb_iter_t));
-+ if (itr == NULL) {
-+ return (NULL);
-+ }
-+
-+ itr->pdi_ph = py->pdb_ph;
-+ itr->pdi_current = (uintptr_t)is.tstate_head;
-+ itr->pdi_nextf = pydb_thread_iter_next;
-+
-+ return (itr);
-+}
-+
-+static uintptr_t
-+pydb_thread_iter_next(pydb_iter_t *iter)
-+{
-+ PyThreadState ts;
-+ uintptr_t cur;
-+
-+ cur = iter->pdi_current;
-+
-+ if (cur == 0) {
-+ return (cur);
-+ }
-+
-+ if (ps_pread(iter->pdi_ph, cur, &ts, sizeof (PyThreadState)) != PS_OK) {
-+ iter->pdi_current = 0;
-+ return (0);
-+ }
-+
-+ iter->pdi_current = (uintptr_t)ts.next;
-+
-+ return (cur);
-+}
-+
-+
-+uintptr_t
-+pydb_iter_next(pydb_iter_t *iter)
-+{
-+ return (iter->pdi_nextf(iter));
-+}
-+
-+void
-+pydb_iter_fini(pydb_iter_t *iter)
-+{
-+ if (iter == NULL) {
-+ return;
-+ }
-+
-+ free(iter);
-+}
-diff --git Python-2.6.4/py_db/libpython26_db.h Python-2.6.4/py_db/libpython26_db.h
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/py_db/libpython26_db.h
-@@ -0,0 +1,74 @@
-+/*
-+ * CDDL HEADER START
-+ *
-+ * The contents of this file are subject to the terms of the
-+ * Common Development and Distribution License (the "License").
-+ * You may not use this file except in compliance with the License.
-+ *
-+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+ * or http://www.opensolaris.org/os/licensing.
-+ * See the License for the specific language governing permissions
-+ * and limitations under the License.
-+ *
-+ * When distributing Covered Code, include this CDDL HEADER in each
-+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+ * If applicable, add the following below this CDDL HEADER, with the
-+ * fields enclosed by brackets "[]" replaced with your own identifying
-+ * information: Portions Copyright [yyyy] [name of copyright owner]
-+ *
-+ * CDDL HEADER END
-+ */
-+/*
-+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+#ifndef _LIBPYTHON26_DB_H
-+#define _LIBPYTHON26_DB_H
-+
-+#include <proc_service.h>
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+/* Agent is opaque to library's consumers. */
-+typedef struct pydb_agent pydb_agent_t;
-+
-+/*
-+ * Library's debug version is 1. Changes to interface should increase this
-+ * number.
-+ */
-+#define PYDB_VERSION 1
-+
-+/* Agent creation/destruction routines */
-+extern pydb_agent_t *pydb_agent_create(struct ps_prochandle *P, int vers);
-+extern void pydb_agent_destroy(pydb_agent_t *py);
-+
-+/* Used by callers that know they are looking at a PyFrameObject */
-+extern int pydb_get_frameinfo(pydb_agent_t *py, uintptr_t frame_addr,
-+ char *fbuf, size_t bufsz, int verbose);
-+
-+/*
-+ * Used by callers that don't know if they're looking at PyFrameObject.
-+ * Checks PC for traceable functions.
-+ */
-+extern int pydb_pc_frameinfo(pydb_agent_t *py, uintptr_t pc,
-+ uintptr_t frame_addr, char *fbuf, size_t bufsz);
-+
-+/* Iterator functions */
-+typedef struct pydb_iter pydb_iter_t;
-+
-+extern pydb_iter_t *pydb_frame_iter_init(pydb_agent_t *py, uintptr_t addr);
-+extern pydb_iter_t *pydb_interp_iter_init(pydb_agent_t *py,
-+ uintptr_t addr);
-+extern pydb_iter_t *pydb_thread_iter_init(pydb_agent_t *py,
-+ uintptr_t addr);
-+extern void pydb_iter_fini(pydb_iter_t *iter);
-+extern uintptr_t pydb_iter_next(pydb_iter_t *iter);
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif /* _LIBPYTHON26_DB_H */
-diff --git Python-2.6.4/py_db/libpython26_db_32.h Python-2.6.4/py_db/libpython26_db_32.h
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/py_db/libpython26_db_32.h
-@@ -0,0 +1,122 @@
-+/*
-+ * CDDL HEADER START
-+ *
-+ * The contents of this file are subject to the terms of the
-+ * Common Development and Distribution License (the "License").
-+ * You may not use this file except in compliance with the License.
-+ *
-+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+ * or http://www.opensolaris.org/os/licensing.
-+ * See the License for the specific language governing permissions
-+ * and limitations under the License.
-+ *
-+ * When distributing Covered Code, include this CDDL HEADER in each
-+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+ * If applicable, add the following below this CDDL HEADER, with the
-+ * fields enclosed by brackets "[]" replaced with your own identifying
-+ * information: Portions Copyright [yyyy] [name of copyright owner]
-+ *
-+ * CDDL HEADER END
-+ */
-+/*
-+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
-+ * Use is subject to license terms.
-+ */
-+
-+#ifndef _LIBPYTHON26_DB_32_H
-+#define _LIBPYTHON26_DB_32_H
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+#include <sys/types.h>
-+
-+/*
-+ * Define 32-bit Python data structures for use by the 64-bit debugger. This
-+ * is so that a 64-bit debugger may properly examine a 32-bit process.
-+ *
-+ * In many cases, the debug library is only concerned with a few fields in the
-+ * Python structure. In that case, the other ancillary fields are elided.
-+ */
-+
-+typedef uint32_t uintptr32_t;
-+typedef int32_t Py_ssize32_t;
-+
-+typedef struct _is32 {
-+ uintptr32_t next;
-+ uintptr32_t tstate_head;
-+} PyInterpreterState32;
-+
-+typedef struct _ts32 {
-+ uintptr32_t next;
-+ uintptr32_t interp;
-+ uintptr32_t frame;
-+} PyThreadState32;
-+
-+#define PyObject_HEAD32 \
-+ Py_ssize32_t ob_refcnt; \
-+ uintptr32_t ob_type;
-+
-+#define PyObject_VAR_HEAD32 \
-+ PyObject_HEAD32 \
-+ Py_ssize32_t ob_size;
-+
-+typedef struct {
-+ PyObject_HEAD32
-+} PyObject32;
-+
-+typedef struct {
-+ PyObject_VAR_HEAD32
-+} PyVarObject32;
-+
-+typedef struct {
-+ PyObject_VAR_HEAD32
-+ int32_t ob_shash;
-+ int ob_sstate;
-+ char ob_sval[1];
-+} PyStringObject32;
-+
-+#define Py_SIZE32(ob) (((PyVarObject32*)(ob))->ob_size)
-+#define PyString_GET_SIZE32(op) Py_SIZE32(op)
-+#define PyString_AS_STRING32(op) (((PyStringObject32 *)(op))->ob_sval)
-+
-+typedef struct {
-+ PyObject_VAR_HEAD32
-+ uintptr32_t f_back;
-+ uintptr32_t f_code;
-+ uintptr32_t f_builtins;
-+ uintptr32_t f_globals;
-+ uintptr32_t f_locals;
-+ uintptr32_t f_valuestack;
-+ uintptr32_t f_stacktop;
-+ uintptr32_t f_trace;
-+ uintptr32_t f_exc_typpe, f_exc_value, f_exc_traceback;
-+ uintptr32_t f_tstate;
-+ int f_lasti;
-+ int f_lineno;
-+} PyFrameObject32;
-+
-+typedef struct {
-+ PyObject_HEAD32
-+ int co_argcount;
-+ int co_nlocals;
-+ int co_stacksize;
-+ int co_flags;
-+ uintptr32_t co_code;
-+ uintptr32_t co_consts;
-+ uintptr32_t co_names;
-+ uintptr32_t co_varnames;
-+ uintptr32_t co_freevars;
-+ uintptr32_t co_cellvars;
-+ uintptr32_t co_filename;
-+ uintptr32_t co_name;
-+ int co_firstlineno;
-+ uintptr32_t co_lnotab;
-+} PyCodeObject32;
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif /* _LIBPYTHON26_DB_32_H */
-diff --git Python-2.6.4/py_db/mapfile-vers Python-2.6.4/py_db/mapfile-vers
-new file mode 100644
---- /dev/null
-+++ Python-2.6.4/py_db/mapfile-vers
-@@ -0,0 +1,40 @@
-+#
-+# CDDL HEADER START
-+#
-+# The contents of this file are subject to the terms of the
-+# Common Development and Distribution License (the "License").
-+# You may not use this file except in compliance with the License.
-+#
-+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-+# or http://www.opensolaris.org/os/licensing.
-+# See the License for the specific language governing permissions
-+# and limitations under the License.
-+#
-+# When distributing Covered Code, include this CDDL HEADER in each
-+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-+# If applicable, add the following below this CDDL HEADER, with the
-+# fields enclosed by brackets "[]" replaced with your own identifying
-+# information: Portions Copyright [yyyy] [name of copyright owner]
-+#
-+# CDDL HEADER END
-+#
-+
-+#
-+# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
-+# Use is subject to license terms.
-+#
-+
-+SUNWprivate_1.1 {
-+ global:
-+ pydb_agent_create;
-+ pydb_agent_destroy;
-+ pydb_frame_iter_init;
-+ pydb_get_frameinfo;
-+ pydb_pc_frameinfo;
-+ pydb_interp_iter_init;
-+ pydb_thread_iter_init;
-+ pydb_iter_fini;
-+ pydb_iter_next;
-+ local:
-+ *;
-+};
--- a/components/python/python26/Python26-21-getpass.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-diff --git Python-2.6.4/Lib/getpass.py Python-2.6.4/Lib/getpass.py
---- Python-2.6.4/Lib/getpass.py
-+++ Python-2.6.4/Lib/getpass.py
-@@ -62,12 +62,16 @@
- try:
- old = termios.tcgetattr(fd) # a copy to save
- new = old[:]
-- new[3] &= ~termios.ECHO # 3 == 'lflags'
-+ new[3] &= ~(termios.ECHO|termios.ISIG) # 3 == 'lflags'
-+ tcsetattr_flags = termios.TCSAFLUSH
-+ if hasattr(termios, 'TCSASOFT'):
-+ tcsetattr_flags |= termios.TCSASOFT
- try:
-- termios.tcsetattr(fd, termios.TCSADRAIN, new)
-+ termios.tcsetattr(fd, tcsetattr_flags, new)
- passwd = _raw_input(prompt, stream, input=input)
- finally:
-- termios.tcsetattr(fd, termios.TCSADRAIN, old)
-+ termios.tcsetattr(fd, tcsetattr_flags, old)
-+ stream.flush() # issue7208
- except termios.error, e:
- if passwd is not None:
- # _raw_input succeeded. The final tcsetattr failed. Reraise
-@@ -125,6 +129,7 @@
- if prompt:
- stream.write(prompt)
- stream.flush()
-+ # NOTE: The Python C API calls flockfile() (and unlock) during readline.
- line = input.readline()
- if not line:
- raise EOFError
--- a/components/python/python26/Python26-22-bindir.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- Python-2.6.4/Makefile.pre.in.orig Fri Feb 11 11:35:54 2011
-+++ Python-2.6.4/Makefile.pre.in Fri Feb 11 11:36:15 2011
-@@ -86,7 +86,7 @@
- datarootdir= @datarootdir@
-
- # Expanded directories
--BINDIR= $(exec_prefix)/bin
-+BINDIR= @bindir@
- LIBDIR= @libdir@
- MANDIR= @mandir@
- INCLUDEDIR= @includedir@
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-00-filemagic.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,2232 @@
+diff -u Python-2.6.4/Lib/platform.py.orig Python-2.6.4/Lib/platform.py
+--- Python-2.6.4/Lib/platform.py.orig Mon Feb 21 10:46:30 2011
++++ Python-2.6.4/Lib/platform.py Mon Feb 21 10:46:30 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """ This module tries to retrieve as much platform-identifying data as
+ possible. It makes this information available via function APIs.
+diff -u Python-2.6.4/Lib/profile.py.orig Python-2.6.4/Lib/profile.py
+--- Python-2.6.4/Lib/profile.py.orig Mon Feb 21 10:46:25 2011
++++ Python-2.6.4/Lib/profile.py Mon Feb 21 10:46:25 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # Class for profiling python code. rev 1.0 6/2/94
+ #
+diff -u Python-2.6.4/Lib/trace.py.orig Python-2.6.4/Lib/trace.py
+--- Python-2.6.4/Lib/trace.py.orig Mon Feb 21 10:46:29 2011
++++ Python-2.6.4/Lib/trace.py Mon Feb 21 10:46:29 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ # portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
+ # err... reserved and offered to the public under the terms of the
+diff -u Python-2.6.4/Lib/cProfile.py.orig Python-2.6.4/Lib/cProfile.py
+--- Python-2.6.4/Lib/cProfile.py.orig Mon Feb 21 10:46:29 2011
++++ Python-2.6.4/Lib/cProfile.py Mon Feb 21 10:46:29 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Python interface for the 'lsprof' profiler.
+ Compatible with the 'profile' module.
+diff -u Python-2.6.4/Lib/idlelib/PyShell.py.orig Python-2.6.4/Lib/idlelib/PyShell.py
+--- Python-2.6.4/Lib/idlelib/PyShell.py.orig Mon Feb 21 10:46:23 2011
++++ Python-2.6.4/Lib/idlelib/PyShell.py Mon Feb 21 10:46:23 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ import os
+ import os.path
+diff -u Python-2.6.4/Lib/UserString.py.orig Python-2.6.4/Lib/UserString.py
+--- Python-2.6.4/Lib/UserString.py.orig Mon Feb 21 10:46:27 2011
++++ Python-2.6.4/Lib/UserString.py Mon Feb 21 10:46:27 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ ## vim:ts=4:et:nowrap
+ """A user-defined wrapper around string objects
+
+diff -u Python-2.6.4/Lib/lib2to3/tests/pytree_idempotency.py.orig Python-2.6.4/Lib/lib2to3/tests/pytree_idempotency.py
+--- Python-2.6.4/Lib/lib2to3/tests/pytree_idempotency.py.orig Mon Feb 21 10:46:24 2011
++++ Python-2.6.4/Lib/lib2to3/tests/pytree_idempotency.py Mon Feb 21 10:46:24 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2.5
++#!/usr/bin/python2.6
+ # Copyright 2006 Google, Inc. All Rights Reserved.
+ # Licensed to PSF under a Contributor Agreement.
+
+diff -u Python-2.6.4/Lib/lib2to3/tests/test_all_fixers.py.orig Python-2.6.4/Lib/lib2to3/tests/test_all_fixers.py
+--- Python-2.6.4/Lib/lib2to3/tests/test_all_fixers.py.orig Mon Feb 21 10:46:24 2011
++++ Python-2.6.4/Lib/lib2to3/tests/test_all_fixers.py Mon Feb 21 10:46:24 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2.5
++#!/usr/bin/python2.6
+ """Tests that run all fixer modules over an input stream.
+
+ This has been broken out into its own test module because of its
+diff -u Python-2.6.4/Lib/lib2to3/tests/test_util.py.orig Python-2.6.4/Lib/lib2to3/tests/test_util.py
+--- Python-2.6.4/Lib/lib2to3/tests/test_util.py.orig Mon Feb 21 10:46:24 2011
++++ Python-2.6.4/Lib/lib2to3/tests/test_util.py Mon Feb 21 10:46:24 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2.5
++#!/usr/bin/python2.6
+ """ Test suite for the code in fixes.util """
+ # Author: Collin Winter
+
+diff -u Python-2.6.4/Lib/lib2to3/tests/test_parser.py.orig Python-2.6.4/Lib/lib2to3/tests/test_parser.py
+--- Python-2.6.4/Lib/lib2to3/tests/test_parser.py.orig Mon Feb 21 10:46:24 2011
++++ Python-2.6.4/Lib/lib2to3/tests/test_parser.py Mon Feb 21 10:46:24 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2.5
++#!/usr/bin/python2.6
+ """Test suite for 2to3's parser and grammar files.
+
+ This is the place to add tests for changes to 2to3's grammar, such as those
+diff -u Python-2.6.4/Lib/lib2to3/tests/test_pytree.py.orig Python-2.6.4/Lib/lib2to3/tests/test_pytree.py
+--- Python-2.6.4/Lib/lib2to3/tests/test_pytree.py.orig Mon Feb 21 10:46:24 2011
++++ Python-2.6.4/Lib/lib2to3/tests/test_pytree.py Mon Feb 21 10:46:24 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2.5
++#!/usr/bin/python2.6
+ # Copyright 2006 Google, Inc. All Rights Reserved.
+ # Licensed to PSF under a Contributor Agreement.
+
+diff -u Python-2.6.4/Lib/lib2to3/tests/test_fixers.py.orig Python-2.6.4/Lib/lib2to3/tests/test_fixers.py
+--- Python-2.6.4/Lib/lib2to3/tests/test_fixers.py.orig Mon Feb 21 10:46:24 2011
++++ Python-2.6.4/Lib/lib2to3/tests/test_fixers.py Mon Feb 21 10:46:24 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2.5
++#!/usr/bin/python2.6
+ """ Test suite for the fixer modules """
+ # Author: Collin Winter
+
+diff -u Python-2.6.4/Lib/lib2to3/refactor.py.orig Python-2.6.4/Lib/lib2to3/refactor.py
+--- Python-2.6.4/Lib/lib2to3/refactor.py.orig Mon Feb 21 10:46:24 2011
++++ Python-2.6.4/Lib/lib2to3/refactor.py Mon Feb 21 10:46:24 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python2.5
++#!/usr/bin/python2.6
+ # Copyright 2006 Google, Inc. All Rights Reserved.
+ # Licensed to PSF under a Contributor Agreement.
+
+diff -u Python-2.6.4/Lib/lib2to3/pgen2/token.py.orig Python-2.6.4/Lib/lib2to3/pgen2/token.py
+--- Python-2.6.4/Lib/lib2to3/pgen2/token.py.orig Mon Feb 21 10:46:25 2011
++++ Python-2.6.4/Lib/lib2to3/pgen2/token.py Mon Feb 21 10:46:25 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Token constants (from "token.h")."""
+
+diff -u Python-2.6.4/Lib/cgi.py.orig Python-2.6.4/Lib/cgi.py
+--- Python-2.6.4/Lib/cgi.py.orig Mon Feb 21 10:46:24 2011
++++ Python-2.6.4/Lib/cgi.py Mon Feb 21 10:46:24 2011
+@@ -1,4 +1,4 @@
+-#! /usr/local/bin/python
++#!/usr/bin/python2.6
+
+ # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
+ # intentionally NOT "/usr/bin/env python". On many systems
+diff -u Python-2.6.4/Lib/base64.py.orig Python-2.6.4/Lib/base64.py
+--- Python-2.6.4/Lib/base64.py.orig Mon Feb 21 10:46:36 2011
++++ Python-2.6.4/Lib/base64.py Mon Feb 21 10:46:36 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """RFC 3548: Base16, Base32, Base64 Data Encodings"""
+
+diff -u Python-2.6.4/Lib/encodings/rot_13.py.orig Python-2.6.4/Lib/encodings/rot_13.py
+--- Python-2.6.4/Lib/encodings/rot_13.py.orig Mon Feb 21 10:46:26 2011
++++ Python-2.6.4/Lib/encodings/rot_13.py Mon Feb 21 10:46:26 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ """ Python Character Mapping Codec for ROT13.
+
+ See http://ucsub.colorado.edu/~kominek/rot13/ for details.
+diff -u Python-2.6.4/Lib/tabnanny.py.orig Python-2.6.4/Lib/tabnanny.py
+--- Python-2.6.4/Lib/tabnanny.py.orig Mon Feb 21 10:46:27 2011
++++ Python-2.6.4/Lib/tabnanny.py Mon Feb 21 10:46:27 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """The Tab Nanny despises ambiguous indentation. She knows no mercy.
+
+diff -u Python-2.6.4/Lib/timeit.py.orig Python-2.6.4/Lib/timeit.py
+--- Python-2.6.4/Lib/timeit.py.orig Mon Feb 21 10:46:23 2011
++++ Python-2.6.4/Lib/timeit.py Mon Feb 21 10:46:23 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Tool for measuring execution time of small code snippets.
+
+diff -u Python-2.6.4/Lib/pydoc.py.orig Python-2.6.4/Lib/pydoc.py
+--- Python-2.6.4/Lib/pydoc.py.orig Mon Feb 21 10:46:28 2011
++++ Python-2.6.4/Lib/pydoc.py Mon Feb 21 10:46:28 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ # -*- coding: latin-1 -*-
+ """Generate Python documentation in HTML or text for interactive use.
+
+diff -u Python-2.6.4/Lib/quopri.py.orig Python-2.6.4/Lib/quopri.py
+--- Python-2.6.4/Lib/quopri.py.orig Mon Feb 21 10:46:29 2011
++++ Python-2.6.4/Lib/quopri.py Mon Feb 21 10:46:29 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Conversions to/from quoted-printable transport encoding as per RFC 1521."""
+
+diff -u Python-2.6.4/Lib/keyword.py.orig Python-2.6.4/Lib/keyword.py
+--- Python-2.6.4/Lib/keyword.py.orig Mon Feb 21 10:46:24 2011
++++ Python-2.6.4/Lib/keyword.py Mon Feb 21 10:46:24 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Keywords (from "graminit.c")
+
+diff -u Python-2.6.4/Lib/mailbox.py.orig Python-2.6.4/Lib/mailbox.py
+--- Python-2.6.4/Lib/mailbox.py.orig Mon Feb 21 10:46:27 2011
++++ Python-2.6.4/Lib/mailbox.py Mon Feb 21 10:46:27 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes."""
+
+diff -u Python-2.6.4/Lib/difflib.py.orig Python-2.6.4/Lib/difflib.py
+--- Python-2.6.4/Lib/difflib.py.orig Mon Feb 21 10:46:36 2011
++++ Python-2.6.4/Lib/difflib.py Mon Feb 21 10:46:36 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """
+ Module difflib -- helpers for computing deltas between objects.
+diff -u Python-2.6.4/Lib/webbrowser.py.orig Python-2.6.4/Lib/webbrowser.py
+--- Python-2.6.4/Lib/webbrowser.py.orig Mon Feb 21 10:46:26 2011
++++ Python-2.6.4/Lib/webbrowser.py Mon Feb 21 10:46:26 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Interfaces for launching and remotely controlling Web browsers."""
+ # Maintained by Georg Brandl.
+
+diff -u Python-2.6.4/Lib/unittest.py.orig Python-2.6.4/Lib/unittest.py
+--- Python-2.6.4/Lib/unittest.py.orig Mon Feb 21 10:46:28 2011
++++ Python-2.6.4/Lib/unittest.py Mon Feb 21 10:46:28 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ '''
+ Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
+ Smalltalk testing framework.
+diff -u Python-2.6.4/Lib/bsddb/test/test_dbtables.py.orig Python-2.6.4/Lib/bsddb/test/test_dbtables.py
+--- Python-2.6.4/Lib/bsddb/test/test_dbtables.py.orig Mon Feb 21 10:46:28 2011
++++ Python-2.6.4/Lib/bsddb/test/test_dbtables.py Mon Feb 21 10:46:28 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ #-----------------------------------------------------------------------
+ # A test suite for the table interface built on bsddb.db
+diff -u Python-2.6.4/Lib/bsddb/dbshelve.py.orig Python-2.6.4/Lib/bsddb/dbshelve.py
+--- Python-2.6.4/Lib/bsddb/dbshelve.py.orig Mon Feb 21 10:46:28 2011
++++ Python-2.6.4/Lib/bsddb/dbshelve.py Mon Feb 21 10:46:28 2011
+@@ -1,4 +1,4 @@
+-#!/bin/env python
++#!/usr/bin/python2.6
+ #------------------------------------------------------------------------
+ # Copyright (c) 1997-2001 by Total Control Software
+ # All Rights Reserved
+diff -u Python-2.6.4/Lib/token.py.orig Python-2.6.4/Lib/token.py
+--- Python-2.6.4/Lib/token.py.orig Mon Feb 21 10:46:28 2011
++++ Python-2.6.4/Lib/token.py Mon Feb 21 10:46:28 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Token constants (from "token.h")."""
+
+diff -u Python-2.6.4/Lib/Cookie.py.orig Python-2.6.4/Lib/Cookie.py
+--- Python-2.6.4/Lib/Cookie.py.orig Mon Feb 21 10:46:25 2011
++++ Python-2.6.4/Lib/Cookie.py Mon Feb 21 10:46:25 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+
+ ####
+diff -u Python-2.6.4/Lib/smtplib.py.orig Python-2.6.4/Lib/smtplib.py
+--- Python-2.6.4/Lib/smtplib.py.orig Mon Feb 21 10:46:28 2011
++++ Python-2.6.4/Lib/smtplib.py Mon Feb 21 10:46:28 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ '''SMTP/ESMTP client class.
+
+diff -u Python-2.6.4/Lib/smtpd.py.orig Python-2.6.4/Lib/smtpd.py
+--- Python-2.6.4/Lib/smtpd.py.orig Mon Feb 21 10:46:28 2011
++++ Python-2.6.4/Lib/smtpd.py Mon Feb 21 10:46:28 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """An RFC 2821 smtp proxy.
+
+ Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]
+diff -u Python-2.6.4/Lib/test/regrtest.py.orig Python-2.6.4/Lib/test/regrtest.py
+--- Python-2.6.4/Lib/test/regrtest.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/regrtest.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Regression test.
+
+diff -u Python-2.6.4/Lib/test/test_sets.py.orig Python-2.6.4/Lib/test/test_sets.py
+--- Python-2.6.4/Lib/test/test_sets.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/test_sets.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ import warnings
+ warnings.filterwarnings("ignore", "the sets module is deprecated",
+diff -u Python-2.6.4/Lib/test/test_dl.py.orig Python-2.6.4/Lib/test/test_dl.py
+--- Python-2.6.4/Lib/test/test_dl.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/test_dl.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Test dlmodule.c
+ Roger E. Masse revised strategy by Barry Warsaw
+ """
+diff -u Python-2.6.4/Lib/test/test_multiprocessing.py.orig Python-2.6.4/Lib/test/test_multiprocessing.py
+--- Python-2.6.4/Lib/test/test_multiprocessing.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test_multiprocessing.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ #
+ # Unit tests for the multiprocessing package
+diff -u Python-2.6.4/Lib/test/test_cmd.py.orig Python-2.6.4/Lib/test/test_cmd.py
+--- Python-2.6.4/Lib/test/test_cmd.py.orig Mon Feb 21 10:46:36 2011
++++ Python-2.6.4/Lib/test/test_cmd.py Mon Feb 21 10:46:36 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ """
+ Test script for the 'cmd' module
+ Original by Michael Schneider
+diff -u Python-2.6.4/Lib/test/test_userstring.py.orig Python-2.6.4/Lib/test/test_userstring.py
+--- Python-2.6.4/Lib/test/test_userstring.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/test_userstring.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ # UserString is a wrapper around the native builtin string type.
+ # UserString instances should behave similar to builtin string objects.
+
+diff -u Python-2.6.4/Lib/test/test_popen.py.orig Python-2.6.4/Lib/test/test_popen.py
+--- Python-2.6.4/Lib/test/test_popen.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/test_popen.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Basic tests for os.popen()
+
+ Particularly useful for platforms that fake popen.
+diff -u Python-2.6.4/Lib/test/test_cd.py.orig Python-2.6.4/Lib/test/test_cd.py
+--- Python-2.6.4/Lib/test/test_cd.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/test_cd.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Whimpy test script for the cd module
+ Roger E. Masse
+ """
+diff -u Python-2.6.4/Lib/test/test_cl.py.orig Python-2.6.4/Lib/test/test_cl.py
+--- Python-2.6.4/Lib/test/test_cl.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/test_cl.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Whimpy test script for the cl module
+ Roger E. Masse
+ """
+diff -u Python-2.6.4/Lib/test/test_imgfile.py.orig Python-2.6.4/Lib/test/test_imgfile.py
+--- Python-2.6.4/Lib/test/test_imgfile.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test_imgfile.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Simple test script for imgfile.c
+ Roger E. Masse
+diff -u Python-2.6.4/Lib/test/test_random.py.orig Python-2.6.4/Lib/test/test_random.py
+--- Python-2.6.4/Lib/test/test_random.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test_random.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ import unittest
+ import random
+diff -u Python-2.6.4/Lib/test/curses_tests.py.orig Python-2.6.4/Lib/test/curses_tests.py
+--- Python-2.6.4/Lib/test/curses_tests.py.orig Mon Feb 21 10:46:32 2011
++++ Python-2.6.4/Lib/test/curses_tests.py Mon Feb 21 10:46:32 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $
+ #
+diff -u Python-2.6.4/Lib/test/test_codecmaps_cn.py.orig Python-2.6.4/Lib/test/test_codecmaps_cn.py
+--- Python-2.6.4/Lib/test/test_codecmaps_cn.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/test_codecmaps_cn.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_codecmaps_cn.py
+ # Codec mapping tests for PRC encodings
+diff -u Python-2.6.4/Lib/test/test_whichdb.py.orig Python-2.6.4/Lib/test/test_whichdb.py
+--- Python-2.6.4/Lib/test/test_whichdb.py.orig Mon Feb 21 10:46:36 2011
++++ Python-2.6.4/Lib/test/test_whichdb.py Mon Feb 21 10:46:36 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Test script for the whichdb module
+ based on test_anydbm.py
+ """
+diff -u Python-2.6.4/Lib/test/test_eof.py.orig Python-2.6.4/Lib/test/test_eof.py
+--- Python-2.6.4/Lib/test/test_eof.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test_eof.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """test script for a few new invalid token catches"""
+
+ import unittest
+diff -u Python-2.6.4/Lib/test/test_imageop.py.orig Python-2.6.4/Lib/test/test_imageop.py
+--- Python-2.6.4/Lib/test/test_imageop.py.orig Mon Feb 21 10:46:31 2011
++++ Python-2.6.4/Lib/test/test_imageop.py Mon Feb 21 10:46:31 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Test script for the imageop module. This has the side
+ effect of partially testing the imgfile module as well.
+diff -u Python-2.6.4/Lib/test/test_codecmaps_tw.py.orig Python-2.6.4/Lib/test/test_codecmaps_tw.py
+--- Python-2.6.4/Lib/test/test_codecmaps_tw.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test_codecmaps_tw.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_codecmaps_tw.py
+ # Codec mapping tests for ROC encodings
+diff -u Python-2.6.4/Lib/test/test_codecencodings_hk.py.orig Python-2.6.4/Lib/test/test_codecencodings_hk.py
+--- Python-2.6.4/Lib/test/test_codecencodings_hk.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/test_codecencodings_hk.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_codecencodings_hk.py
+ # Codec encoding tests for HongKong encodings.
+diff -u Python-2.6.4/Lib/test/test_codecencodings_jp.py.orig Python-2.6.4/Lib/test/test_codecencodings_jp.py
+--- Python-2.6.4/Lib/test/test_codecencodings_jp.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/test_codecencodings_jp.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_codecencodings_jp.py
+ # Codec encoding tests for Japanese encodings.
+diff -u Python-2.6.4/Lib/test/test_with.py.orig Python-2.6.4/Lib/test/test_with.py
+--- Python-2.6.4/Lib/test/test_with.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/test_with.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Unit tests for the with statement specified in PEP 343."""
+
+diff -u Python-2.6.4/Lib/test/crashers/recursive_call.py.orig Python-2.6.4/Lib/test/crashers/recursive_call.py
+--- Python-2.6.4/Lib/test/crashers/recursive_call.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/crashers/recursive_call.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ # No bug report AFAIK, mail on python-dev on 2006-01-10
+
+diff -u Python-2.6.4/Lib/test/test_codecmaps_kr.py.orig Python-2.6.4/Lib/test/test_codecmaps_kr.py
+--- Python-2.6.4/Lib/test/test_codecmaps_kr.py.orig Mon Feb 21 10:46:32 2011
++++ Python-2.6.4/Lib/test/test_codecmaps_kr.py Mon Feb 21 10:46:32 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_codecmaps_kr.py
+ # Codec mapping tests for ROK encodings
+diff -u Python-2.6.4/Lib/test/test_array.py.orig Python-2.6.4/Lib/test/test_array.py
+--- Python-2.6.4/Lib/test/test_array.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/test_array.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Test the arraymodule.
+ Roger E. Masse
+ """
+diff -u Python-2.6.4/Lib/test/test_pep263.py.orig Python-2.6.4/Lib/test/test_pep263.py
+--- Python-2.6.4/Lib/test/test_pep263.py.orig Mon Feb 21 10:46:32 2011
++++ Python-2.6.4/Lib/test/test_pep263.py Mon Feb 21 10:46:32 2011
+@@ -1,4 +1,4 @@
+-#! -*- coding: koi8-r -*-
++#!/usr/bin/python2.6
+ # This file is marked as binary in SVN, to prevent MacCVS from recoding it.
+
+ import unittest
+diff -u Python-2.6.4/Lib/test/test_anydbm.py.orig Python-2.6.4/Lib/test/test_anydbm.py
+--- Python-2.6.4/Lib/test/test_anydbm.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test_anydbm.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Test script for the anydbm module
+ based on testdumbdbm.py
+ """
+diff -u Python-2.6.4/Lib/test/test_smtpnet.py.orig Python-2.6.4/Lib/test/test_smtpnet.py
+--- Python-2.6.4/Lib/test/test_smtpnet.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/test_smtpnet.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ import unittest
+ from test import test_support
+diff -u Python-2.6.4/Lib/test/test_al.py.orig Python-2.6.4/Lib/test/test_al.py
+--- Python-2.6.4/Lib/test/test_al.py.orig Mon Feb 21 10:46:31 2011
++++ Python-2.6.4/Lib/test/test_al.py Mon Feb 21 10:46:31 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Whimpy test script for the al module
+ Roger E. Masse
+ """
+diff -u Python-2.6.4/Lib/test/test_urllib2net.py.orig Python-2.6.4/Lib/test/test_urllib2net.py
+--- Python-2.6.4/Lib/test/test_urllib2net.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/test_urllib2net.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ import unittest
+ from test import test_support
+diff -u Python-2.6.4/Lib/test/test_marshal.py.orig Python-2.6.4/Lib/test/test_marshal.py
+--- Python-2.6.4/Lib/test/test_marshal.py.orig Mon Feb 21 10:46:32 2011
++++ Python-2.6.4/Lib/test/test_marshal.py Mon Feb 21 10:46:32 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ # -*- coding: iso-8859-1 -*-
+
+ from test import test_support
+diff -u Python-2.6.4/Lib/test/test_urlparse.py.orig Python-2.6.4/Lib/test/test_urlparse.py
+--- Python-2.6.4/Lib/test/test_urlparse.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/test_urlparse.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ from test import test_support
+ import unittest
+diff -u Python-2.6.4/Lib/test/test_bz2.py.orig Python-2.6.4/Lib/test/test_bz2.py
+--- Python-2.6.4/Lib/test/test_bz2.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/test_bz2.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ from test import test_support
+ from test.test_support import TESTFN
+
+diff -u Python-2.6.4/Lib/test/test_urllibnet.py.orig Python-2.6.4/Lib/test/test_urllibnet.py
+--- Python-2.6.4/Lib/test/test_urllibnet.py.orig Mon Feb 21 10:46:32 2011
++++ Python-2.6.4/Lib/test/test_urllibnet.py Mon Feb 21 10:46:32 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ import unittest
+ from test import test_support
+diff -u Python-2.6.4/Lib/test/test_logging.py.orig Python-2.6.4/Lib/test/test_logging.py
+--- Python-2.6.4/Lib/test/test_logging.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/test_logging.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # Copyright 2001-2004 by Vinay Sajip. All Rights Reserved.
+ #
+diff -u Python-2.6.4/Lib/test/test_socket.py.orig Python-2.6.4/Lib/test/test_socket.py
+--- Python-2.6.4/Lib/test/test_socket.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test_socket.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ import unittest
+ from test import test_support
+diff -u Python-2.6.4/Lib/test/pystone.py.orig Python-2.6.4/Lib/test/pystone.py
+--- Python-2.6.4/Lib/test/pystone.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/pystone.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """
+ "PYSTONE" Benchmark Program
+diff -u Python-2.6.4/Lib/test/test_multibytecodec.py.orig Python-2.6.4/Lib/test/test_multibytecodec.py
+--- Python-2.6.4/Lib/test/test_multibytecodec.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test_multibytecodec.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_multibytecodec.py
+ # Unit test for multibytecodec itself
+diff -u Python-2.6.4/Lib/test/test_popen2.py.orig Python-2.6.4/Lib/test/test_popen2.py
+--- Python-2.6.4/Lib/test/test_popen2.py.orig Mon Feb 21 10:46:33 2011
++++ Python-2.6.4/Lib/test/test_popen2.py Mon Feb 21 10:46:33 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Test script for popen2.py"""
+
+ import warnings
+diff -u Python-2.6.4/Lib/test/test_binhex.py.orig Python-2.6.4/Lib/test/test_binhex.py
+--- Python-2.6.4/Lib/test/test_binhex.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/test_binhex.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Test script for the binhex C module
+
+ Uses the mechanism of the python binhex module
+diff -u Python-2.6.4/Lib/test/test_gzip.py.orig Python-2.6.4/Lib/test/test_gzip.py
+--- Python-2.6.4/Lib/test/test_gzip.py.orig Mon Feb 21 10:46:36 2011
++++ Python-2.6.4/Lib/test/test_gzip.py Mon Feb 21 10:46:36 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Test script for the gzip module.
+ """
+
+diff -u Python-2.6.4/Lib/test/re_tests.py.orig Python-2.6.4/Lib/test/re_tests.py
+--- Python-2.6.4/Lib/test/re_tests.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/re_tests.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ # -*- mode: python -*-
+
+ # Re test suite and benchmark suite v1.5
+diff -u Python-2.6.4/Lib/test/test_urllib2_localnet.py.orig Python-2.6.4/Lib/test/test_urllib2_localnet.py
+--- Python-2.6.4/Lib/test/test_urllib2_localnet.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test_urllib2_localnet.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ import mimetools
+ import threading
+diff -u Python-2.6.4/Lib/test/test_codecencodings_kr.py.orig Python-2.6.4/Lib/test/test_codecencodings_kr.py
+--- Python-2.6.4/Lib/test/test_codecencodings_kr.py.orig Mon Feb 21 10:46:32 2011
++++ Python-2.6.4/Lib/test/test_codecencodings_kr.py Mon Feb 21 10:46:32 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_codecencodings_kr.py
+ # Codec encoding tests for ROK encodings.
+diff -u Python-2.6.4/Lib/test/test_multibytecodec_support.py.orig Python-2.6.4/Lib/test/test_multibytecodec_support.py
+--- Python-2.6.4/Lib/test/test_multibytecodec_support.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test_multibytecodec_support.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_multibytecodec_support.py
+ # Common Unittest Routines for CJK codecs
+diff -u Python-2.6.4/Lib/test/test_tcl.py.orig Python-2.6.4/Lib/test/test_tcl.py
+--- Python-2.6.4/Lib/test/test_tcl.py.orig Mon Feb 21 10:46:36 2011
++++ Python-2.6.4/Lib/test/test_tcl.py Mon Feb 21 10:46:36 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ import unittest
+ import os
+diff -u Python-2.6.4/Lib/test/test_codecencodings_cn.py.orig Python-2.6.4/Lib/test/test_codecencodings_cn.py
+--- Python-2.6.4/Lib/test/test_codecencodings_cn.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/test_codecencodings_cn.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_codecencodings_cn.py
+ # Codec encoding tests for PRC encodings.
+diff -u Python-2.6.4/Lib/test/test_gl.py.orig Python-2.6.4/Lib/test/test_gl.py
+--- Python-2.6.4/Lib/test/test_gl.py.orig Mon Feb 21 10:46:32 2011
++++ Python-2.6.4/Lib/test/test_gl.py Mon Feb 21 10:46:32 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Very simple test script for the SGI gl library extension module
+ taken mostly from the documentation.
+ Roger E. Masse
+diff -u Python-2.6.4/Lib/test/test___future__.py.orig Python-2.6.4/Lib/test/test___future__.py
+--- Python-2.6.4/Lib/test/test___future__.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test___future__.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ import unittest
+ from test import test_support
+ import __future__
+diff -u Python-2.6.4/Lib/test/test_bsddb.py.orig Python-2.6.4/Lib/test/test_bsddb.py
+--- Python-2.6.4/Lib/test/test_bsddb.py.orig Mon Feb 21 10:46:36 2011
++++ Python-2.6.4/Lib/test/test_bsddb.py Mon Feb 21 10:46:36 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Test script for the bsddb C module by Roger E. Masse
+ Adapted to unittest format and expanded scope by Raymond Hettinger
+ """
+diff -u Python-2.6.4/Lib/test/test_errno.py.orig Python-2.6.4/Lib/test/test_errno.py
+--- Python-2.6.4/Lib/test/test_errno.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/test_errno.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Test the errno module
+ Roger E. Masse
+ """
+diff -u Python-2.6.4/Lib/test/test_optparse.py.orig Python-2.6.4/Lib/test/test_optparse.py
+--- Python-2.6.4/Lib/test/test_optparse.py.orig Mon Feb 21 10:46:32 2011
++++ Python-2.6.4/Lib/test/test_optparse.py Mon Feb 21 10:46:32 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+
+ #
+ # Test suite for Optik. Supplied by Johannes Gijsbers
+diff -u Python-2.6.4/Lib/test/test_codecencodings_tw.py.orig Python-2.6.4/Lib/test/test_codecencodings_tw.py
+--- Python-2.6.4/Lib/test/test_codecencodings_tw.py.orig Mon Feb 21 10:46:35 2011
++++ Python-2.6.4/Lib/test/test_codecencodings_tw.py Mon Feb 21 10:46:35 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_codecencodings_tw.py
+ # Codec encoding tests for ROC encodings.
+diff -u Python-2.6.4/Lib/test/test_codecmaps_jp.py.orig Python-2.6.4/Lib/test/test_codecmaps_jp.py
+--- Python-2.6.4/Lib/test/test_codecmaps_jp.py.orig Mon Feb 21 10:46:32 2011
++++ Python-2.6.4/Lib/test/test_codecmaps_jp.py Mon Feb 21 10:46:32 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_codecmaps_jp.py
+ # Codec mapping tests for Japanese encodings
+diff -u Python-2.6.4/Lib/test/test_codecmaps_hk.py.orig Python-2.6.4/Lib/test/test_codecmaps_hk.py
+--- Python-2.6.4/Lib/test/test_codecmaps_hk.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/test_codecmaps_hk.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # test_codecmaps_hk.py
+ # Codec mapping tests for HongKong encodings
+diff -u Python-2.6.4/Lib/test/test_dumbdbm.py.orig Python-2.6.4/Lib/test/test_dumbdbm.py
+--- Python-2.6.4/Lib/test/test_dumbdbm.py.orig Mon Feb 21 10:46:34 2011
++++ Python-2.6.4/Lib/test/test_dumbdbm.py Mon Feb 21 10:46:34 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Test script for the dumbdbm module
+ Original by Roger E. Masse
+ """
+diff -u Python-2.6.4/Lib/tarfile.py.orig Python-2.6.4/Lib/tarfile.py
+--- Python-2.6.4/Lib/tarfile.py.orig Mon Feb 21 10:46:38 2011
++++ Python-2.6.4/Lib/tarfile.py Mon Feb 21 10:46:38 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ # -*- coding: iso-8859-1 -*-
+ #-------------------------------------------------------------------
+ # tarfile.py
+diff -u Python-2.6.4/Lib/uu.py.orig Python-2.6.4/Lib/uu.py
+--- Python-2.6.4/Lib/uu.py.orig Mon Feb 21 10:46:25 2011
++++ Python-2.6.4/Lib/uu.py Mon Feb 21 10:46:25 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Copyright 1994 by Lance Ellinghouse
+ # Cathedral City, California Republic, United States of America.
+diff -u Python-2.6.4/Lib/symbol.py.orig Python-2.6.4/Lib/symbol.py
+--- Python-2.6.4/Lib/symbol.py.orig Mon Feb 21 10:46:27 2011
++++ Python-2.6.4/Lib/symbol.py Mon Feb 21 10:46:27 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Non-terminal symbols of Python grammar (from "graminit.h")."""
+
+diff -u Python-2.6.4/Lib/mimify.py.orig Python-2.6.4/Lib/mimify.py
+--- Python-2.6.4/Lib/mimify.py.orig Mon Feb 21 10:46:28 2011
++++ Python-2.6.4/Lib/mimify.py Mon Feb 21 10:46:28 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Mimification and unmimification of mail messages.
+
+diff -u Python-2.6.4/Lib/pdb.py.orig Python-2.6.4/Lib/pdb.py
+--- Python-2.6.4/Lib/pdb.py.orig Mon Feb 21 10:46:38 2011
++++ Python-2.6.4/Lib/pdb.py Mon Feb 21 10:46:38 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """A Python debugger."""
+
+diff -u Python-2.6.4/Lib/plat-mac/bundlebuilder.py.orig Python-2.6.4/Lib/plat-mac/bundlebuilder.py
+--- Python-2.6.4/Lib/plat-mac/bundlebuilder.py.orig Mon Feb 21 10:46:38 2011
++++ Python-2.6.4/Lib/plat-mac/bundlebuilder.py Mon Feb 21 10:46:38 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """\
+ bundlebuilder.py -- Tools to assemble MacOS X (application) bundles.
+diff -u Python-2.6.4/Lib/plat-mac/appletrunner.py.orig Python-2.6.4/Lib/plat-mac/appletrunner.py
+--- Python-2.6.4/Lib/plat-mac/appletrunner.py.orig Mon Feb 21 10:46:38 2011
++++ Python-2.6.4/Lib/plat-mac/appletrunner.py Mon Feb 21 10:46:38 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ # This file is meant as an executable script for running applets.
+ # BuildApplet will use it as the main executable in the .app bundle if
+ # we are not running in a framework build.
+diff -u Python-2.6.4/Demo/scripts/primes.py.orig Python-2.6.4/Demo/scripts/primes.py
+--- Python-2.6.4/Demo/scripts/primes.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/primes.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Print prime numbers in a given range
+
+diff -u Python-2.6.4/Demo/scripts/mkrcs.py.orig Python-2.6.4/Demo/scripts/mkrcs.py
+--- Python-2.6.4/Demo/scripts/mkrcs.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/mkrcs.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # A rather specialized script to make sure that a symbolic link named
+ # RCS exists pointing to a real RCS directory in a parallel tree
+diff -u Python-2.6.4/Demo/scripts/queens.py.orig Python-2.6.4/Demo/scripts/queens.py
+--- Python-2.6.4/Demo/scripts/queens.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/queens.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """N queens problem.
+
+diff -u Python-2.6.4/Demo/scripts/pi.py.orig Python-2.6.4/Demo/scripts/pi.py
+--- Python-2.6.4/Demo/scripts/pi.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/pi.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Print digits of pi forever.
+ #
+diff -u Python-2.6.4/Demo/scripts/mboxconvert.py.orig Python-2.6.4/Demo/scripts/mboxconvert.py
+--- Python-2.6.4/Demo/scripts/mboxconvert.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/mboxconvert.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Convert MH directories (1 message per file) or MMDF mailboxes (4x^A
+ # delimited) to unix mailbox (From ... delimited) on stdout.
+diff -u Python-2.6.4/Demo/scripts/eqfix.py.orig Python-2.6.4/Demo/scripts/eqfix.py
+--- Python-2.6.4/Demo/scripts/eqfix.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/eqfix.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Fix Python source files to use the new equality test operator, i.e.,
+ # if x = y: ...
+diff -u Python-2.6.4/Demo/scripts/find-uname.py.orig Python-2.6.4/Demo/scripts/find-uname.py
+--- Python-2.6.4/Demo/scripts/find-uname.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/find-uname.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """
+ For each argument on the command line, look for it in the set of all Unicode
+diff -u Python-2.6.4/Demo/scripts/pp.py.orig Python-2.6.4/Demo/scripts/pp.py
+--- Python-2.6.4/Demo/scripts/pp.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/pp.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Emulate some Perl command line options.
+ # Usage: pp [-a] [-c] [-d] [-e scriptline] [-F fieldsep] [-n] [-p] [file] ...
+diff -u Python-2.6.4/Demo/scripts/unbirthday.py.orig Python-2.6.4/Demo/scripts/unbirthday.py
+--- Python-2.6.4/Demo/scripts/unbirthday.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/unbirthday.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Calculate your unbirthday count (see Alice in Wonderland).
+ # This is defined as the number of days from your birth until today
+diff -u Python-2.6.4/Demo/scripts/update.py.orig Python-2.6.4/Demo/scripts/update.py
+--- Python-2.6.4/Demo/scripts/update.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/update.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Update a bunch of files according to a script.
+ # The input file contains lines of the form <filename>:<lineno>:<text>,
+diff -u Python-2.6.4/Demo/scripts/markov.py.orig Python-2.6.4/Demo/scripts/markov.py
+--- Python-2.6.4/Demo/scripts/markov.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/markov.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ class Markov:
+ def __init__(self, histsize, choice):
+diff -u Python-2.6.4/Demo/scripts/from.py.orig Python-2.6.4/Demo/scripts/from.py
+--- Python-2.6.4/Demo/scripts/from.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/from.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Print From and Subject of messages in $MAIL.
+ # Extension to multiple mailboxes and other bells & whistles are left
+diff -u Python-2.6.4/Demo/scripts/script.py.orig Python-2.6.4/Demo/scripts/script.py
+--- Python-2.6.4/Demo/scripts/script.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/script.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ # script.py -- Make typescript of terminal session.
+ # Usage:
+ # -a Append to typescript.
+diff -u Python-2.6.4/Demo/scripts/lpwatch.py.orig Python-2.6.4/Demo/scripts/lpwatch.py
+--- Python-2.6.4/Demo/scripts/lpwatch.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/lpwatch.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Watch line printer queue(s).
+ # Intended for BSD 4.3 lpq.
+diff -u Python-2.6.4/Demo/scripts/fact.py.orig Python-2.6.4/Demo/scripts/fact.py
+--- Python-2.6.4/Demo/scripts/fact.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/fact.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Factorize numbers.
+ # The algorithm is not efficient, but easy to understand.
+diff -u Python-2.6.4/Demo/scripts/beer.py.orig Python-2.6.4/Demo/scripts/beer.py
+--- Python-2.6.4/Demo/scripts/beer.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/beer.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ # By GvR, demystified after a version by Fredrik Lundh.
+ import sys
+ n = 100
+diff -u Python-2.6.4/Demo/scripts/newslist.py.orig Python-2.6.4/Demo/scripts/newslist.py
+--- Python-2.6.4/Demo/scripts/newslist.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/newslist.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ #######################################################################
+ # Newslist $Revision: 66429 $
+ #
+diff -u Python-2.6.4/Demo/scripts/ftpstats.py.orig Python-2.6.4/Demo/scripts/ftpstats.py
+--- Python-2.6.4/Demo/scripts/ftpstats.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/ftpstats.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Extract statistics from ftp daemon log.
+
+diff -u Python-2.6.4/Demo/scripts/makedir.py.orig Python-2.6.4/Demo/scripts/makedir.py
+--- Python-2.6.4/Demo/scripts/makedir.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/scripts/makedir.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Like mkdir, but also make intermediate directories if necessary.
+ # It is not an error if the given directory already exists (as long
+diff -u Python-2.6.4/Demo/turtle/tdemo_clock.py.orig Python-2.6.4/Demo/turtle/tdemo_clock.py
+--- Python-2.6.4/Demo/turtle/tdemo_clock.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_clock.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ # -*- coding: cp1252 -*-
+ """ turtle-example-suite:
+
+diff -u Python-2.6.4/Demo/turtle/tdemo_planet_and_moon.py.orig Python-2.6.4/Demo/turtle/tdemo_planet_and_moon.py
+--- Python-2.6.4/Demo/turtle/tdemo_planet_and_moon.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_planet_and_moon.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """ turtle-example-suite:
+
+ tdemo_planets_and_moon.py
+diff -u Python-2.6.4/Demo/turtle/tdemo_lindenmayer_indian.py.orig Python-2.6.4/Demo/turtle/tdemo_lindenmayer_indian.py
+--- Python-2.6.4/Demo/turtle/tdemo_lindenmayer_indian.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_lindenmayer_indian.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """ turtle-example-suite:
+
+ xtx_lindenmayer_indian.py
+diff -u Python-2.6.4/Demo/turtle/tdemo_penrose.py.orig Python-2.6.4/Demo/turtle/tdemo_penrose.py
+--- Python-2.6.4/Demo/turtle/tdemo_penrose.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_penrose.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """ xturtle-example-suite:
+
+ xtx_kites_and_darts.py
+diff -u Python-2.6.4/Demo/turtle/turtleDemo.py.orig Python-2.6.4/Demo/turtle/turtleDemo.py
+--- Python-2.6.4/Demo/turtle/turtleDemo.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/turtleDemo.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ import sys
+ import os
+
+diff -u Python-2.6.4/Demo/turtle/tdemo_yinyang.py.orig Python-2.6.4/Demo/turtle/tdemo_yinyang.py
+--- Python-2.6.4/Demo/turtle/tdemo_yinyang.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_yinyang.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """ turtle-example-suite:
+
+ tdemo_yinyang.py
+diff -u Python-2.6.4/Demo/turtle/tdemo_tree.py.orig Python-2.6.4/Demo/turtle/tdemo_tree.py
+--- Python-2.6.4/Demo/turtle/tdemo_tree.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_tree.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """ turtle-example-suite:
+
+ tdemo_tree.py
+diff -u Python-2.6.4/Demo/turtle/tdemo_fractalcurves.py.orig Python-2.6.4/Demo/turtle/tdemo_fractalcurves.py
+--- Python-2.6.4/Demo/turtle/tdemo_fractalcurves.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_fractalcurves.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """ turtle-example-suite:
+
+ tdemo_fractalCurves.py
+diff -u Python-2.6.4/Demo/turtle/turtledemo_two_canvases.py.orig Python-2.6.4/Demo/turtle/turtledemo_two_canvases.py
+--- Python-2.6.4/Demo/turtle/turtledemo_two_canvases.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/turtledemo_two_canvases.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ ## DEMONSTRATES USE OF 2 CANVASES, SO CANNOT BE RUN IN DEMOVIEWER!
+ """turtle example: Using TurtleScreen and RawTurtle
+ for drawing on two distinct canvases.
+diff -u Python-2.6.4/Demo/turtle/tdemo_minimal_hanoi.py.orig Python-2.6.4/Demo/turtle/tdemo_minimal_hanoi.py
+--- Python-2.6.4/Demo/turtle/tdemo_minimal_hanoi.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_minimal_hanoi.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """ turtle-example-suite:
+
+ tdemo_minimal_hanoi.py
+diff -u Python-2.6.4/Demo/turtle/tdemo_peace.py.orig Python-2.6.4/Demo/turtle/tdemo_peace.py
+--- Python-2.6.4/Demo/turtle/tdemo_peace.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_peace.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """ turtle-example-suite:
+
+ tdemo_peace.py
+diff -u Python-2.6.4/Demo/turtle/tdemo_bytedesign.py.orig Python-2.6.4/Demo/turtle/tdemo_bytedesign.py
+--- Python-2.6.4/Demo/turtle/tdemo_bytedesign.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_bytedesign.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """ turtle-example-suite:
+
+ tdemo_bytedesign.py
+diff -u Python-2.6.4/Demo/turtle/tdemo_paint.py.orig Python-2.6.4/Demo/turtle/tdemo_paint.py
+--- Python-2.6.4/Demo/turtle/tdemo_paint.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_paint.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """ turtle-example-suite:
+
+ tdemo_paint.py
+diff -u Python-2.6.4/Demo/turtle/tdemo_I_dontlike_tiltdemo.py.orig Python-2.6.4/Demo/turtle/tdemo_I_dontlike_tiltdemo.py
+--- Python-2.6.4/Demo/turtle/tdemo_I_dontlike_tiltdemo.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/turtle/tdemo_I_dontlike_tiltdemo.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """ turtle-example-suite:
+
+ tdemo-I_dont_like_tiltdemo.py
+diff -u Python-2.6.4/Demo/cgi/cgi1.py.orig Python-2.6.4/Demo/cgi/cgi1.py
+--- Python-2.6.4/Demo/cgi/cgi1.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/cgi/cgi1.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/python
++#!/usr/bin/python2.6
+
+ """CGI test 1 - check server setup."""
+
+diff -u Python-2.6.4/Demo/cgi/cgi3.py.orig Python-2.6.4/Demo/cgi/cgi3.py
+--- Python-2.6.4/Demo/cgi/cgi3.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/cgi/cgi3.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/python
++#!/usr/bin/python2.6
+
+ """CGI test 3 (persistent data)."""
+
+diff -u Python-2.6.4/Demo/cgi/cgi2.py.orig Python-2.6.4/Demo/cgi/cgi2.py
+--- Python-2.6.4/Demo/cgi/cgi2.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/cgi/cgi2.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/python
++#!/usr/bin/python2.6
+
+ """CGI test 2 - basic use of cgi module."""
+
+diff -u Python-2.6.4/Demo/comparisons/sortingtest.py.orig Python-2.6.4/Demo/comparisons/sortingtest.py
+--- Python-2.6.4/Demo/comparisons/sortingtest.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/comparisons/sortingtest.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # 2) Sorting Test
+ #
+diff -u Python-2.6.4/Demo/comparisons/regextest.py.orig Python-2.6.4/Demo/comparisons/regextest.py
+--- Python-2.6.4/Demo/comparisons/regextest.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/comparisons/regextest.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # 1) Regular Expressions Test
+ #
+diff -u Python-2.6.4/Demo/comparisons/systemtest.py.orig Python-2.6.4/Demo/comparisons/systemtest.py
+--- Python-2.6.4/Demo/comparisons/systemtest.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/comparisons/systemtest.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # 3) System Test
+ #
+diff -u Python-2.6.4/Demo/pysvr/pysvr.py.orig Python-2.6.4/Demo/pysvr/pysvr.py
+--- Python-2.6.4/Demo/pysvr/pysvr.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/pysvr/pysvr.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """A multi-threaded telnet-like server that gives a Python prompt.
+
+diff -u Python-2.6.4/Demo/tkinter/guido/sortvisu.py.orig Python-2.6.4/Demo/tkinter/guido/sortvisu.py
+--- Python-2.6.4/Demo/tkinter/guido/sortvisu.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/sortvisu.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Sorting algorithms visualizer using Tkinter.
+
+diff -u Python-2.6.4/Demo/tkinter/guido/dialog.py.orig Python-2.6.4/Demo/tkinter/guido/dialog.py
+--- Python-2.6.4/Demo/tkinter/guido/dialog.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/dialog.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # A Python function that generates dialog boxes with a text message,
+ # optional bitmap, and any number of buttons.
+diff -u Python-2.6.4/Demo/tkinter/guido/electrons.py.orig Python-2.6.4/Demo/tkinter/guido/electrons.py
+--- Python-2.6.4/Demo/tkinter/guido/electrons.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/electrons.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Simulate "electrons" migrating across the screen.
+ # An optional bitmap file in can be in the background.
+diff -u Python-2.6.4/Demo/tkinter/guido/newmenubardemo.py.orig Python-2.6.4/Demo/tkinter/guido/newmenubardemo.py
+--- Python-2.6.4/Demo/tkinter/guido/newmenubardemo.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/newmenubardemo.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Play with the new Tk 8.0 toplevel menu option."""
+
+diff -u Python-2.6.4/Demo/tkinter/guido/canvasevents.py.orig Python-2.6.4/Demo/tkinter/guido/canvasevents.py
+--- Python-2.6.4/Demo/tkinter/guido/canvasevents.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/canvasevents.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ from Tkinter import *
+ from Canvas import Oval, Group, CanvasText
+diff -u Python-2.6.4/Demo/tkinter/guido/tkman.py.orig Python-2.6.4/Demo/tkinter/guido/tkman.py
+--- Python-2.6.4/Demo/tkinter/guido/tkman.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/tkman.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Tk man page browser -- currently only shows the Tcl/Tk man pages
+
+diff -u Python-2.6.4/Demo/tkinter/guido/solitaire.py.orig Python-2.6.4/Demo/tkinter/guido/solitaire.py
+--- Python-2.6.4/Demo/tkinter/guido/solitaire.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/solitaire.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Solitaire game, much like the one that comes with MS Windows.
+
+diff -u Python-2.6.4/Demo/tkinter/guido/kill.py.orig Python-2.6.4/Demo/tkinter/guido/kill.py
+--- Python-2.6.4/Demo/tkinter/guido/kill.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/kill.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ # Tkinter interface to Linux `kill' command.
+
+ from Tkinter import *
+diff -u Python-2.6.4/Demo/tkinter/guido/MimeViewer.py.orig Python-2.6.4/Demo/tkinter/guido/MimeViewer.py
+--- Python-2.6.4/Demo/tkinter/guido/MimeViewer.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/MimeViewer.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # View a single MIME multipart message.
+ # Display each part as a box.
+diff -u Python-2.6.4/Demo/tkinter/guido/mbox.py.orig Python-2.6.4/Demo/tkinter/guido/mbox.py
+--- Python-2.6.4/Demo/tkinter/guido/mbox.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/mbox.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Scan MH folder, display results in window
+
+diff -u Python-2.6.4/Demo/tkinter/guido/rmt.py.orig Python-2.6.4/Demo/tkinter/guido/rmt.py
+--- Python-2.6.4/Demo/tkinter/guido/rmt.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/rmt.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # A Python program implementing rmt, an application for remotely
+ # controlling other Tk applications.
+diff -u Python-2.6.4/Demo/tkinter/guido/svkill.py.orig Python-2.6.4/Demo/tkinter/guido/svkill.py
+--- Python-2.6.4/Demo/tkinter/guido/svkill.py.orig Mon Feb 21 10:46:39 2011
++++ Python-2.6.4/Demo/tkinter/guido/svkill.py Mon Feb 21 10:46:39 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Tkinter interface to SYSV `ps' and `kill' commands.
+
+diff -u Python-2.6.4/Demo/pdist/rrcs.py.orig Python-2.6.4/Demo/pdist/rrcs.py
+--- Python-2.6.4/Demo/pdist/rrcs.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/pdist/rrcs.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ "Remote RCS -- command line interface"
+
+diff -u Python-2.6.4/Demo/pdist/rcvs.py.orig Python-2.6.4/Demo/pdist/rcvs.py
+--- Python-2.6.4/Demo/pdist/rcvs.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/pdist/rcvs.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Remote CVS -- command line interface"""
+
+diff -u Python-2.6.4/Demo/pdist/RCSProxy.py.orig Python-2.6.4/Demo/pdist/RCSProxy.py
+--- Python-2.6.4/Demo/pdist/RCSProxy.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/pdist/RCSProxy.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """RCS Proxy.
+
+diff -u Python-2.6.4/Demo/pdist/makechangelog.py.orig Python-2.6.4/Demo/pdist/makechangelog.py
+--- Python-2.6.4/Demo/pdist/makechangelog.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/pdist/makechangelog.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Turn a pile of RCS log output into ChangeLog file entries.
+
+diff -u Python-2.6.4/Demo/zlib/zlibdemo.py.orig Python-2.6.4/Demo/zlib/zlibdemo.py
+--- Python-2.6.4/Demo/zlib/zlibdemo.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/zlib/zlibdemo.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Takes an optional filename, defaulting to this file itself.
+ # Reads the file and compresses the content using level 1 and level 9
+diff -u Python-2.6.4/Demo/zlib/minigzip.py.orig Python-2.6.4/Demo/zlib/minigzip.py
+--- Python-2.6.4/Demo/zlib/minigzip.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/zlib/minigzip.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ # Demo program for zlib; it compresses or decompresses files, but *doesn't*
+ # delete the original. This doesn't support all of gzip's options.
+ #
+diff -u Python-2.6.4/Demo/curses/life.py.orig Python-2.6.4/Demo/curses/life.py
+--- Python-2.6.4/Demo/curses/life.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/curses/life.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ # life.py -- A curses-based version of Conway's Game of Life.
+ # Contributed by AMK
+ #
+diff -u Python-2.6.4/Demo/curses/rain.py.orig Python-2.6.4/Demo/curses/rain.py
+--- Python-2.6.4/Demo/curses/rain.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/curses/rain.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # $Id: rain.py 46625 2006-06-03 23:02:15Z andrew.kuchling $
+ #
+diff -u Python-2.6.4/Demo/curses/repeat.py.orig Python-2.6.4/Demo/curses/repeat.py
+--- Python-2.6.4/Demo/curses/repeat.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/curses/repeat.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """repeat <shell-command>
+
+diff -u Python-2.6.4/Demo/curses/ncurses.py.orig Python-2.6.4/Demo/curses/ncurses.py
+--- Python-2.6.4/Demo/curses/ncurses.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/curses/ncurses.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # $Id: ncurses.py 66424 2008-09-13 01:22:08Z andrew.kuchling $
+ #
+diff -u Python-2.6.4/Demo/curses/tclock.py.orig Python-2.6.4/Demo/curses/tclock.py
+--- Python-2.6.4/Demo/curses/tclock.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/curses/tclock.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # $Id: tclock.py 46626 2006-06-03 23:07:21Z andrew.kuchling $
+ #
+diff -u Python-2.6.4/Demo/parser/test_parser.py.orig Python-2.6.4/Demo/parser/test_parser.py
+--- Python-2.6.4/Demo/parser/test_parser.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/parser/test_parser.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ # (Force the script to use the latest build.)
+ #
+ # test_parser.py
+diff -u Python-2.6.4/Demo/sockets/gopher.py.orig Python-2.6.4/Demo/sockets/gopher.py
+--- Python-2.6.4/Demo/sockets/gopher.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/sockets/gopher.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # A simple gopher client.
+ #
+diff -u Python-2.6.4/Demo/sockets/throughput.py.orig Python-2.6.4/Demo/sockets/throughput.py
+--- Python-2.6.4/Demo/sockets/throughput.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/sockets/throughput.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Test network throughput.
+ #
+diff -u Python-2.6.4/Demo/sockets/rpython.py.orig Python-2.6.4/Demo/sockets/rpython.py
+--- Python-2.6.4/Demo/sockets/rpython.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/sockets/rpython.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Remote python client.
+ # Execute Python commands remotely and send output back.
+diff -u Python-2.6.4/Demo/sockets/echosvr.py.orig Python-2.6.4/Demo/sockets/echosvr.py
+--- Python-2.6.4/Demo/sockets/echosvr.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/sockets/echosvr.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Python implementation of an 'echo' tcp server: echo all data it receives.
+ #
+diff -u Python-2.6.4/Demo/sockets/telnet.py.orig Python-2.6.4/Demo/sockets/telnet.py
+--- Python-2.6.4/Demo/sockets/telnet.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/sockets/telnet.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Minimal interface to the Internet telnet protocol.
+ #
+diff -u Python-2.6.4/Demo/sockets/finger.py.orig Python-2.6.4/Demo/sockets/finger.py
+--- Python-2.6.4/Demo/sockets/finger.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/sockets/finger.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Python interface to the Internet finger daemon.
+ #
+diff -u Python-2.6.4/Demo/sockets/udpecho.py.orig Python-2.6.4/Demo/sockets/udpecho.py
+--- Python-2.6.4/Demo/sockets/udpecho.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/sockets/udpecho.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Client and server for udp (datagram) echo.
+ #
+diff -u Python-2.6.4/Demo/sockets/rpythond.py.orig Python-2.6.4/Demo/sockets/rpythond.py
+--- Python-2.6.4/Demo/sockets/rpythond.py.orig Mon Feb 21 10:46:40 2011
++++ Python-2.6.4/Demo/sockets/rpythond.py Mon Feb 21 10:46:40 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Remote python server.
+ # Execute Python commands remotely and send output back.
+diff -u Python-2.6.4/Tools/ssl/get-remote-certificate.py.orig Python-2.6.4/Tools/ssl/get-remote-certificate.py
+--- Python-2.6.4/Tools/ssl/get-remote-certificate.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/ssl/get-remote-certificate.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # fetch the certificate that the server(s) are providing in PEM form
+ #
+diff -u Python-2.6.4/Tools/compiler/demo.py.orig Python-2.6.4/Tools/compiler/demo.py
+--- Python-2.6.4/Tools/compiler/demo.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/compiler/demo.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Print names of all methods defined in module
+
+diff -u Python-2.6.4/Tools/compiler/dumppyc.py.orig Python-2.6.4/Tools/compiler/dumppyc.py
+--- Python-2.6.4/Tools/compiler/dumppyc.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/compiler/dumppyc.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ import marshal
+ import dis
+diff -u Python-2.6.4/Tools/webchecker/wsgui.py.orig Python-2.6.4/Tools/webchecker/wsgui.py
+--- Python-2.6.4/Tools/webchecker/wsgui.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/webchecker/wsgui.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Tkinter-based GUI for websucker.
+
+diff -u Python-2.6.4/Tools/webchecker/webchecker.py.orig Python-2.6.4/Tools/webchecker/webchecker.py
+--- Python-2.6.4/Tools/webchecker/webchecker.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/webchecker/webchecker.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Original code by Guido van Rossum; extensive changes by Sam Bayer,
+ # including code to check URL fragments.
+diff -u Python-2.6.4/Tools/webchecker/websucker.py.orig Python-2.6.4/Tools/webchecker/websucker.py
+--- Python-2.6.4/Tools/webchecker/websucker.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/webchecker/websucker.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """A variant on webchecker that creates a mirror copy of a remote site."""
+
+diff -u Python-2.6.4/Tools/webchecker/wcgui.py.orig Python-2.6.4/Tools/webchecker/wcgui.py
+--- Python-2.6.4/Tools/webchecker/wcgui.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/webchecker/wcgui.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """GUI interface to webchecker.
+
+diff -u Python-2.6.4/Tools/faqwiz/faqw.py.orig Python-2.6.4/Tools/faqwiz/faqw.py
+--- Python-2.6.4/Tools/faqwiz/faqw.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/faqwiz/faqw.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#! /usr/local/bin/python
++#!/usr/bin/python2.6
+
+ """FAQ wizard bootstrap."""
+
+diff -u Python-2.6.4/Tools/unicode/comparecodecs.py.orig Python-2.6.4/Tools/unicode/comparecodecs.py
+--- Python-2.6.4/Tools/unicode/comparecodecs.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/unicode/comparecodecs.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """ Compare the output of two codecs.
+
+diff -u Python-2.6.4/Tools/i18n/msgfmt.py.orig Python-2.6.4/Tools/i18n/msgfmt.py
+--- Python-2.6.4/Tools/i18n/msgfmt.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/i18n/msgfmt.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ # -*- coding: iso-8859-1 -*-
+ # Written by Martin v. Löwis <[email protected]>
+
+diff -u Python-2.6.4/Tools/i18n/makelocalealias.py.orig Python-2.6.4/Tools/i18n/makelocalealias.py
+--- Python-2.6.4/Tools/i18n/makelocalealias.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/i18n/makelocalealias.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ """
+ Convert the X11 locale.alias file into a mapping dictionary suitable
+ for locale.py.
+diff -u Python-2.6.4/Tools/i18n/pygettext.py.orig Python-2.6.4/Tools/i18n/pygettext.py
+--- Python-2.6.4/Tools/i18n/pygettext.py.orig Mon Feb 21 10:46:41 2011
++++ Python-2.6.4/Tools/i18n/pygettext.py Mon Feb 21 10:46:41 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ # -*- coding: iso-8859-1 -*-
+ # Originally written by Barry Warsaw <[email protected]>
+ #
+diff -u Python-2.6.4/Tools/freeze/freeze.py.orig Python-2.6.4/Tools/freeze/freeze.py
+--- Python-2.6.4/Tools/freeze/freeze.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/freeze/freeze.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Freeze a Python script into a binary.
+
+diff -u Python-2.6.4/Tools/modulator/Tkextra.py.orig Python-2.6.4/Tools/modulator/Tkextra.py
+--- Python-2.6.4/Tools/modulator/Tkextra.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/modulator/Tkextra.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # A Python function that generates dialog boxes with a text message,
+ # optional bitmap, and any number of buttons.
+diff -u Python-2.6.4/Tools/modulator/modulator.py.orig Python-2.6.4/Tools/modulator/modulator.py
+--- Python-2.6.4/Tools/modulator/modulator.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/modulator/modulator.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ #
+ # Modulator - Generate skeleton modules.
+ #
+diff -u Python-2.6.4/Tools/pybench/pybench.py.orig Python-2.6.4/Tools/pybench/pybench.py
+--- Python-2.6.4/Tools/pybench/pybench.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/pybench/pybench.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/python -O
++#!/usr/bin/python2.6
+
+ """ A Python Benchmark Suite
+
+diff -u Python-2.6.4/Tools/pybench/Setup.py.orig Python-2.6.4/Tools/pybench/Setup.py
+--- Python-2.6.4/Tools/pybench/Setup.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/pybench/Setup.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!python
++#!/usr/bin/python2.6
+
+ # Setup file for pybench
+ #
+diff -u Python-2.6.4/Tools/pybench/clockres.py.orig Python-2.6.4/Tools/pybench/clockres.py
+--- Python-2.6.4/Tools/pybench/clockres.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/pybench/clockres.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """ clockres - calculates the resolution in seconds of a given timer.
+
+diff -u Python-2.6.4/Tools/pybench/systimes.py.orig Python-2.6.4/Tools/pybench/systimes.py
+--- Python-2.6.4/Tools/pybench/systimes.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/pybench/systimes.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """ systimes() user and system timer implementations for use by
+ pybench.
+diff -u Python-2.6.4/Tools/scripts/fixheader.py.orig Python-2.6.4/Tools/scripts/fixheader.py
+--- Python-2.6.4/Tools/scripts/fixheader.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/fixheader.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Add some standard cpp magic to a header file
+
+diff -u Python-2.6.4/Tools/scripts/fixdiv.py.orig Python-2.6.4/Tools/scripts/fixdiv.py
+--- Python-2.6.4/Tools/scripts/fixdiv.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/fixdiv.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """fixdiv - tool to fix division operators.
+
+diff -u Python-2.6.4/Tools/scripts/which.py.orig Python-2.6.4/Tools/scripts/which.py
+--- Python-2.6.4/Tools/scripts/which.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/which.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Variant of "which".
+ # On stderr, near and total misses are reported.
+diff -u Python-2.6.4/Tools/scripts/suff.py.orig Python-2.6.4/Tools/scripts/suff.py
+--- Python-2.6.4/Tools/scripts/suff.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/suff.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # suff
+ #
+diff -u Python-2.6.4/Tools/scripts/pysource.py.orig Python-2.6.4/Tools/scripts/pysource.py
+--- Python-2.6.4/Tools/scripts/pysource.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/pysource.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """\
+ List python source files.
+diff -u Python-2.6.4/Tools/scripts/lll.py.orig Python-2.6.4/Tools/scripts/lll.py
+--- Python-2.6.4/Tools/scripts/lll.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/lll.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Find symbolic links and show where they point to.
+ # Arguments are directories to search; default is current directory.
+diff -u Python-2.6.4/Tools/scripts/pickle2db.py.orig Python-2.6.4/Tools/scripts/pickle2db.py
+--- Python-2.6.4/Tools/scripts/pickle2db.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/pickle2db.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """
+ Synopsis: %(prog)s [-h|-b|-g|-r|-a|-d] [ picklefile ] dbfile
+diff -u Python-2.6.4/Tools/scripts/texi2html.py.orig Python-2.6.4/Tools/scripts/texi2html.py
+--- Python-2.6.4/Tools/scripts/texi2html.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/texi2html.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Convert GNU texinfo files into HTML, one file per node.
+ # Based on Texinfo 2.14.
+diff -u Python-2.6.4/Tools/scripts/mkreal.py.orig Python-2.6.4/Tools/scripts/mkreal.py
+--- Python-2.6.4/Tools/scripts/mkreal.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/mkreal.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # mkreal
+ #
+diff -u Python-2.6.4/Tools/scripts/ftpmirror.py.orig Python-2.6.4/Tools/scripts/ftpmirror.py
+--- Python-2.6.4/Tools/scripts/ftpmirror.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/ftpmirror.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Mirror a remote ftp subtree into a local directory tree.
+
+diff -u Python-2.6.4/Tools/scripts/lfcr.py.orig Python-2.6.4/Tools/scripts/lfcr.py
+--- Python-2.6.4/Tools/scripts/lfcr.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/lfcr.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ "Replace LF with CRLF in argument files. Print names of changed files."
+
+diff -u Python-2.6.4/Tools/scripts/ptags.py.orig Python-2.6.4/Tools/scripts/ptags.py
+--- Python-2.6.4/Tools/scripts/ptags.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/ptags.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # ptags
+ #
+diff -u Python-2.6.4/Tools/scripts/copytime.py.orig Python-2.6.4/Tools/scripts/copytime.py
+--- Python-2.6.4/Tools/scripts/copytime.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/copytime.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Copy one file's atime and mtime to another
+
+diff -u Python-2.6.4/Tools/scripts/finddiv.py.orig Python-2.6.4/Tools/scripts/finddiv.py
+--- Python-2.6.4/Tools/scripts/finddiv.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/finddiv.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """finddiv - a grep-like tool that looks for division operators.
+
+diff -u Python-2.6.4/Tools/scripts/combinerefs.py.orig Python-2.6.4/Tools/scripts/combinerefs.py
+--- Python-2.6.4/Tools/scripts/combinerefs.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/combinerefs.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """
+ combinerefs path
+diff -u Python-2.6.4/Tools/scripts/cvsfiles.py.orig Python-2.6.4/Tools/scripts/cvsfiles.py
+--- Python-2.6.4/Tools/scripts/cvsfiles.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/cvsfiles.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Print a list of files that are mentioned in CVS directories.
+
+diff -u Python-2.6.4/Tools/scripts/reindent.py.orig Python-2.6.4/Tools/scripts/reindent.py
+--- Python-2.6.4/Tools/scripts/reindent.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/reindent.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Released to the public domain, by Tim Peters, 03 October 2000.
+
+diff -u Python-2.6.4/Tools/scripts/checkpyc.py.orig Python-2.6.4/Tools/scripts/checkpyc.py
+--- Python-2.6.4/Tools/scripts/checkpyc.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/checkpyc.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ # Check that all ".pyc" files exist and are up-to-date
+ # Uses module 'os'
+
+diff -u Python-2.6.4/Tools/scripts/fixps.py.orig Python-2.6.4/Tools/scripts/fixps.py
+--- Python-2.6.4/Tools/scripts/fixps.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/fixps.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Fix Python script(s) to reference the interpreter via /usr/bin/env python.
+ # Warning: this overwrites the file without making a backup.
+diff -u Python-2.6.4/Tools/scripts/crlf.py.orig Python-2.6.4/Tools/scripts/crlf.py
+--- Python-2.6.4/Tools/scripts/crlf.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/crlf.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ "Replace CRLF with LF in argument files. Print names of changed files."
+
+ import sys, os
+diff -u Python-2.6.4/Tools/scripts/methfix.py.orig Python-2.6.4/Tools/scripts/methfix.py
+--- Python-2.6.4/Tools/scripts/methfix.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/methfix.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Fix Python source files to avoid using
+ # def method(self, (arg1, ..., argn)):
+diff -u Python-2.6.4/Tools/scripts/classfix.py.orig Python-2.6.4/Tools/scripts/classfix.py
+--- Python-2.6.4/Tools/scripts/classfix.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/classfix.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # This script is obsolete -- it is kept for historical purposes only.
+ #
+diff -u Python-2.6.4/Tools/scripts/xxci.py.orig Python-2.6.4/Tools/scripts/xxci.py
+--- Python-2.6.4/Tools/scripts/xxci.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/xxci.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # xxci
+ #
+diff -u Python-2.6.4/Tools/scripts/findnocoding.py.orig Python-2.6.4/Tools/scripts/findnocoding.py
+--- Python-2.6.4/Tools/scripts/findnocoding.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/findnocoding.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """List all those Python files that require a coding directive
+
+diff -u Python-2.6.4/Tools/scripts/fixnotice.py.orig Python-2.6.4/Tools/scripts/fixnotice.py
+--- Python-2.6.4/Tools/scripts/fixnotice.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/fixnotice.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """(Ostensibly) fix copyright notices in files.
+
+diff -u Python-2.6.4/Tools/scripts/eptags.py.orig Python-2.6.4/Tools/scripts/eptags.py
+--- Python-2.6.4/Tools/scripts/eptags.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/eptags.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Create a TAGS file for Python programs, usable with GNU Emacs.
+
+ usage: eptags pyfiles...
+diff -u Python-2.6.4/Tools/scripts/linktree.py.orig Python-2.6.4/Tools/scripts/linktree.py
+--- Python-2.6.4/Tools/scripts/linktree.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/linktree.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # linktree
+ #
+diff -u Python-2.6.4/Tools/scripts/checkappend.py.orig Python-2.6.4/Tools/scripts/checkappend.py
+--- Python-2.6.4/Tools/scripts/checkappend.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/checkappend.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Released to the public domain, by Tim Peters, 28 February 2000.
+
+diff -u Python-2.6.4/Tools/scripts/pindent.py.orig Python-2.6.4/Tools/scripts/pindent.py
+--- Python-2.6.4/Tools/scripts/pindent.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/pindent.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # This file contains a class and a main program that perform three
+ # related (though complimentary) formatting operations on Python
+diff -u Python-2.6.4/Tools/scripts/google.py.orig Python-2.6.4/Tools/scripts/google.py
+--- Python-2.6.4/Tools/scripts/google.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/google.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ import sys, webbrowser
+
+diff -u Python-2.6.4/Tools/scripts/nm2def.py.orig Python-2.6.4/Tools/scripts/nm2def.py
+--- Python-2.6.4/Tools/scripts/nm2def.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/nm2def.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """nm2def.py
+
+ Helpers to extract symbols from Unix libs and auto-generate
+diff -u Python-2.6.4/Tools/scripts/md5sum.py.orig Python-2.6.4/Tools/scripts/md5sum.py
+--- Python-2.6.4/Tools/scripts/md5sum.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/md5sum.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Python utility to print MD5 checksums of argument files.
+ """
+diff -u Python-2.6.4/Tools/scripts/logmerge.py.orig Python-2.6.4/Tools/scripts/logmerge.py
+--- Python-2.6.4/Tools/scripts/logmerge.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/logmerge.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Consolidate a bunch of CVS or RCS logs read from stdin.
+
+diff -u Python-2.6.4/Tools/scripts/svneol.py.orig Python-2.6.4/Tools/scripts/svneol.py
+--- Python-2.6.4/Tools/scripts/svneol.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/svneol.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """
+ SVN helper script.
+diff -u Python-2.6.4/Tools/scripts/rgrep.py.orig Python-2.6.4/Tools/scripts/rgrep.py
+--- Python-2.6.4/Tools/scripts/rgrep.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/rgrep.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Reverse grep.
+
+diff -u Python-2.6.4/Tools/scripts/h2py.py.orig Python-2.6.4/Tools/scripts/h2py.py
+--- Python-2.6.4/Tools/scripts/h2py.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/h2py.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Read #define's and translate to Python code.
+ # Handle #include statements.
+diff -u Python-2.6.4/Tools/scripts/pathfix.py.orig Python-2.6.4/Tools/scripts/pathfix.py
+--- Python-2.6.4/Tools/scripts/pathfix.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/pathfix.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Change the #! line occurring in Python scripts. The new interpreter
+ # pathname must be given with a -i option.
+diff -u Python-2.6.4/Tools/scripts/byext.py.orig Python-2.6.4/Tools/scripts/byext.py
+--- Python-2.6.4/Tools/scripts/byext.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/byext.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Show file statistics by extension."""
+
+diff -u Python-2.6.4/Tools/scripts/ifdef.py.orig Python-2.6.4/Tools/scripts/ifdef.py
+--- Python-2.6.4/Tools/scripts/ifdef.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/ifdef.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Selectively preprocess #ifdef / #ifndef statements.
+ # Usage:
+diff -u Python-2.6.4/Tools/scripts/treesync.py.orig Python-2.6.4/Tools/scripts/treesync.py
+--- Python-2.6.4/Tools/scripts/treesync.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/treesync.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Script to synchronize two source trees.
+
+diff -u Python-2.6.4/Tools/scripts/ndiff.py.orig Python-2.6.4/Tools/scripts/ndiff.py
+--- Python-2.6.4/Tools/scripts/ndiff.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/ndiff.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Module ndiff version 1.7.0
+ # Released to the public domain 08-Dec-2000,
+diff -u Python-2.6.4/Tools/scripts/findlinksto.py.orig Python-2.6.4/Tools/scripts/findlinksto.py
+--- Python-2.6.4/Tools/scripts/findlinksto.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/findlinksto.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # findlinksto
+ #
+diff -u Python-2.6.4/Tools/scripts/objgraph.py.orig Python-2.6.4/Tools/scripts/objgraph.py
+--- Python-2.6.4/Tools/scripts/objgraph.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/objgraph.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # objgraph
+ #
+diff -u Python-2.6.4/Tools/scripts/untabify.py.orig Python-2.6.4/Tools/scripts/untabify.py
+--- Python-2.6.4/Tools/scripts/untabify.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/untabify.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ "Replace tabs with spaces in argument files. Print names of changed files."
+
+diff -u Python-2.6.4/Tools/scripts/db2pickle.py.orig Python-2.6.4/Tools/scripts/db2pickle.py
+--- Python-2.6.4/Tools/scripts/db2pickle.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/db2pickle.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """
+ Synopsis: %(prog)s [-h|-g|-b|-r|-a] dbfile [ picklefile ]
+diff -u Python-2.6.4/Tools/scripts/parseentities.py.orig Python-2.6.4/Tools/scripts/parseentities.py
+--- Python-2.6.4/Tools/scripts/parseentities.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/parseentities.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/python
++#!/usr/bin/python2.6
+ """ Utility for parsing HTML entity definitions available from:
+
+ http://www.w3.org/ as e.g.
+diff -u Python-2.6.4/Tools/scripts/dutree.py.orig Python-2.6.4/Tools/scripts/dutree.py
+--- Python-2.6.4/Tools/scripts/dutree.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/dutree.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ # Format du output in a tree shape
+
+ import os, sys, errno
+diff -u Python-2.6.4/Tools/scripts/pdeps.py.orig Python-2.6.4/Tools/scripts/pdeps.py
+--- Python-2.6.4/Tools/scripts/pdeps.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/pdeps.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # pdeps
+ #
+diff -u Python-2.6.4/Tools/scripts/cleanfuture.py.orig Python-2.6.4/Tools/scripts/cleanfuture.py
+--- Python-2.6.4/Tools/scripts/cleanfuture.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/cleanfuture.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ """cleanfuture [-d][-r][-v] path ...
+
+diff -u Python-2.6.4/Tools/scripts/hotshotmain.py.orig Python-2.6.4/Tools/scripts/hotshotmain.py
+--- Python-2.6.4/Tools/scripts/hotshotmain.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/hotshotmain.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ # -*- coding: iso-8859-1 -*-
+
+ """
+diff -u Python-2.6.4/Tools/scripts/byteyears.py.orig Python-2.6.4/Tools/scripts/byteyears.py
+--- Python-2.6.4/Tools/scripts/byteyears.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/byteyears.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Print the product of age and size of each file, in suitable units.
+ #
+diff -u Python-2.6.4/Tools/scripts/gprof2html.py.orig Python-2.6.4/Tools/scripts/gprof2html.py
+--- Python-2.6.4/Tools/scripts/gprof2html.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/gprof2html.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python2.3
++#!/usr/bin/python2.6
+
+ """Transform gprof(1) output into useful HTML."""
+
+diff -u Python-2.6.4/Tools/scripts/fixcid.py.orig Python-2.6.4/Tools/scripts/fixcid.py
+--- Python-2.6.4/Tools/scripts/fixcid.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/fixcid.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Perform massive identifier substitution on C source files.
+ # This actually tokenizes the files (to some extent) so it can
+diff -u Python-2.6.4/Tools/scripts/reindent-rst.py.orig Python-2.6.4/Tools/scripts/reindent-rst.py
+--- Python-2.6.4/Tools/scripts/reindent-rst.py.orig Mon Feb 21 10:46:42 2011
++++ Python-2.6.4/Tools/scripts/reindent-rst.py Mon Feb 21 10:46:42 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ # Make a reST file compliant to our pre-commit hook.
+ # Currently just remove trailing whitespace.
+diff -u Python-2.6.4/Mac/BuildScript/build-installer.py.orig Python-2.6.4/Mac/BuildScript/build-installer.py
+--- Python-2.6.4/Mac/BuildScript/build-installer.py.orig Mon Feb 21 10:46:43 2011
++++ Python-2.6.4/Mac/BuildScript/build-installer.py Mon Feb 21 10:46:43 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """
+ This script is used to build the "official unofficial" universal build on
+ Mac OS X. It requires Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK to do its
+diff -u Python-2.6.4/Mac/scripts/zappycfiles.py.orig Python-2.6.4/Mac/scripts/zappycfiles.py
+--- Python-2.6.4/Mac/scripts/zappycfiles.py.orig Mon Feb 21 10:46:44 2011
++++ Python-2.6.4/Mac/scripts/zappycfiles.py Mon Feb 21 10:46:44 2011
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/python
++#!/usr/bin/python2.6
+ """Recursively zap all .pyc and .pyo files"""
+ import os
+ import sys
+diff -u Python-2.6.4/Mac/scripts/buildpkg.py.orig Python-2.6.4/Mac/scripts/buildpkg.py
+--- Python-2.6.4/Mac/scripts/buildpkg.py.orig Mon Feb 21 10:46:44 2011
++++ Python-2.6.4/Mac/scripts/buildpkg.py Mon Feb 21 10:46:44 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """buildpkg.py -- Build OS X packages for Apple's Installer.app.
+
+diff -u Python-2.6.4/Mac/Tools/fixapplepython23.py.orig Python-2.6.4/Mac/Tools/fixapplepython23.py
+--- Python-2.6.4/Mac/Tools/fixapplepython23.py.orig Mon Feb 21 10:46:44 2011
++++ Python-2.6.4/Mac/Tools/fixapplepython23.py Mon Feb 21 10:46:44 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2.6
+ """fixapplepython23 - Fix Apple-installed Python 2.3 (on Mac OS X 10.3)
+
+ Python 2.3 (and 2.3.X for X<5) have the problem that building an extension
+diff -u Python-2.6.4/Misc/find_recursionlimit.py.orig Python-2.6.4/Misc/find_recursionlimit.py
+--- Python-2.6.4/Misc/find_recursionlimit.py.orig Mon Feb 21 10:46:44 2011
++++ Python-2.6.4/Misc/find_recursionlimit.py Mon Feb 21 10:46:44 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Find the maximum recursion limit that prevents interpreter termination.
+
+ This script finds the maximum safe recursion limit on a particular
+diff -u Python-2.6.4/Parser/asdl_c.py.orig Python-2.6.4/Parser/asdl_c.py
+--- Python-2.6.4/Parser/asdl_c.py.orig Mon Feb 21 10:46:44 2011
++++ Python-2.6.4/Parser/asdl_c.py Mon Feb 21 10:46:44 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python2.6
+ """Generate C code from an ASDL description."""
+
+ # TO DO
+diff -u Python-2.6.4/Doc/includes/email-alternative.py.orig Python-2.6.4/Doc/includes/email-alternative.py
+--- Python-2.6.4/Doc/includes/email-alternative.py.orig Mon Feb 21 10:46:44 2011
++++ Python-2.6.4/Doc/includes/email-alternative.py Mon Feb 21 10:46:44 2011
+@@ -1,4 +1,4 @@
+-#! /usr/bin/python
++#!/usr/bin/python2.6
+
+ import smtplib
+
+diff -u Python-2.6.4/Doc/includes/email-unpack.py.orig Python-2.6.4/Doc/includes/email-unpack.py
+--- Python-2.6.4/Doc/includes/email-unpack.py.orig Mon Feb 21 10:46:44 2011
++++ Python-2.6.4/Doc/includes/email-unpack.py Mon Feb 21 10:46:44 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Unpack a MIME message into a directory of files."""
+
+diff -u Python-2.6.4/Doc/includes/email-dir.py.orig Python-2.6.4/Doc/includes/email-dir.py
+--- Python-2.6.4/Doc/includes/email-dir.py.orig Mon Feb 21 10:46:44 2011
++++ Python-2.6.4/Doc/includes/email-dir.py Mon Feb 21 10:46:44 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+
+ """Send the contents of a directory as a MIME message."""
+
+diff -u Python-2.6.4/Doc/tools/rstlint.py.orig Python-2.6.4/Doc/tools/rstlint.py
+--- Python-2.6.4/Doc/tools/rstlint.py.orig Mon Feb 21 10:46:44 2011
++++ Python-2.6.4/Doc/tools/rstlint.py Mon Feb 21 10:46:44 2011
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python2.6
+ # -*- coding: utf-8 -*-
+
+ # Check for stylistic and formal issues in .rst and .py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-01-solaris-lib-dirs.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,190 @@
+diff --git Python-2.6.4/Modules/_multiprocessing/multiprocessing.h Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
+--- Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
++++ Python-2.6.4/Modules/_multiprocessing/multiprocessing.h
+@@ -3,6 +3,10 @@
+
+ #define PY_SSIZE_T_CLEAN
+
++/* needed on Solaris for the definition of CMSG_SPACE and friends */
++#define _XOPEN_SOURCE
++#define _XOPEN_SOURCE_EXTENDED 1
++
+ #include "Python.h"
+ #include "structmember.h"
+ #include "pythread.h"
+diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
+new file mode 100644
+--- Python-2.6.4/setup.py
++++ Python-2.6.4/setup.py
+@@ -309,10 +309,10 @@
+ return sys.platform
+
+ def detect_modules(self):
+- # Ensure that /usr/local is always used
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+-
++ if sys.platform != 'sunos5':
++ # Ensure that /usr/local is always used
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ # Add paths specified in the environment variables LDFLAGS and
+ # CPPFLAGS for header and library files.
+ # We must get the values from the Makefile and not the environment
+@@ -610,11 +610,22 @@
+ exts.append( Extension('_csv', ['_csv.c']) )
+
+ # socket(2)
++ socket_libs = []
++ if self.compiler.find_library_file(lib_dirs,
++ 'socket'):
++ socket_libs.append('socket')
++ if self.compiler.find_library_file(lib_dirs,
++ 'nsl'):
++ socket_libs.append('nsl')
++ if self.compiler.find_library_file(lib_dirs,
++ 'resolv'):
++ socket_libs.append('resolv')
+ exts.append( Extension('_socket', ['socketmodule.c'],
+- depends = ['socketmodule.h']) )
++ depends = ['socketmodule.h'],
++ libraries = socket_libs) )
+ # Detect SSL support for the socket module (via _ssl)
+ search_for_ssl_incs_in = [
+- '/usr/local/ssl/include',
++ '/usr/sfw/include',
+ '/usr/contrib/ssl/include/'
+ ]
+ ssl_incs = find_file('openssl/ssl.h', inc_dirs,
+@@ -625,8 +636,12 @@
+ ['/usr/kerberos/include'])
+ if krb5_h:
+ ssl_incs += krb5_h
++ if sys.maxint == 2147483647L:
++ sfw_libdir = '/usr/sfw/lib';
++ else:
++ sfw_libdir = '/usr/sfw/lib/64';
+ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
+- ['/usr/local/ssl/lib',
++ [sfw_libdir,
+ '/usr/contrib/ssl/lib/'
+ ] )
+
+@@ -635,6 +650,7 @@
+ exts.append( Extension('_ssl', ['_ssl.c'],
+ include_dirs = ssl_incs,
+ library_dirs = ssl_libs,
++ runtime_library_dirs = ssl_libs,
+ libraries = ['ssl', 'crypto'],
+ depends = ['socketmodule.h']), )
+ else:
+@@ -1079,6 +1095,14 @@
+
+ # Curses support, requiring the System V version of curses, often
+ # provided by the ncurses library.
++ curses_lib_dirs = []
++ curses_inc_dirs = []
++ if platform == 'sunos5':
++ # look for ncurses in /usr/gnu on Solaris
++ curses_inc_dirs.append('/usr/include/ncurses')
++ curses_lib_dirs.append('/usr/gnu/lib')
++ curses_lib_dirs.append('/usr/gnu/lib/amd64')
++ curses_lib_dirs.append('/usr/gnu/lib/sparcv9')
+ panel_library = 'panel'
+ if (self.compiler.find_library_file(lib_dirs, 'ncursesw')):
+ curses_libs = ['ncursesw']
+@@ -1087,10 +1111,13 @@
+ panel_library = 'panelw'
+ exts.append( Extension('_curses', ['_cursesmodule.c'],
+ libraries = curses_libs) )
+- elif (self.compiler.find_library_file(lib_dirs, 'ncurses')):
++ elif (self.compiler.find_library_file(lib_dirs + curses_lib_dirs, 'ncurses')):
+ curses_libs = ['ncurses']
+ exts.append( Extension('_curses', ['_cursesmodule.c'],
+- libraries = curses_libs) )
++ libraries = curses_libs,
++ library_dirs = curses_lib_dirs,
++ runtime_library_dirs = curses_lib_dirs,
++ include_dirs = curses_inc_dirs ) )
+ elif (self.compiler.find_library_file(lib_dirs, 'curses')
+ and platform != 'darwin'):
+ # OSX has an old Berkeley curses, not good enough for
+@@ -1109,9 +1136,12 @@
+
+ # If the curses module is enabled, check for the panel module
+ if (module_enabled(exts, '_curses') and
+- self.compiler.find_library_file(lib_dirs, panel_library)):
++ self.compiler.find_library_file(lib_dirs + curses_lib_dirs, panel_library)):
+ exts.append( Extension('_curses_panel', ['_curses_panel.c'],
+- libraries = [panel_library] + curses_libs) )
++ libraries = [panel_library] + curses_libs,
++ include_dirs = curses_inc_dirs,
++ library_dirs = curses_lib_dirs,
++ runtime_library_dirs = curses_lib_dirs ) )
+ else:
+ missing.append('_curses_panel')
+
+@@ -1324,8 +1354,13 @@
+ if macros.get('HAVE_SEM_OPEN', False):
+ multiprocessing_srcs.append('_multiprocessing/semaphore.c')
+
++ multiproc_libs = []
++ if platform == 'sunos5':
++ multiproc_libs = [ "xnet" ]
++
+ exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
+ define_macros=macros.items(),
++ libraries=multiproc_libs,
+ include_dirs=["Modules/_multiprocessing"]))
+ # End multiprocessing
+
+@@ -1549,15 +1584,26 @@
+ # Assume we haven't found any of the libraries or include files
+ # The versions with dots are used on Unix, and the versions without
+ # dots on Windows, for detection by cygwin.
++ added_lib_dirs = []
++ tcl_tk_lib_dirs = ['/usr/sfw/lib']
++ tcl_tk_inc_dirs = ['/usr/sfw/include']
+ tcllib = tklib = tcl_includes = tk_includes = None
+ for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
+ '82', '8.1', '81', '8.0', '80']:
+- tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
+- tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
++ tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version, tcl_tk_lib_dirs)
++ tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version, tcl_tk_lib_dirs)
+ if tklib and tcllib:
+ # Exit the loop when we've found the Tcl/Tk libraries
+ break
+
++ tklib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tk' + version)
++ tcllib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tcl' + version)
++ if tklib and tcllib:
++ # found the libs in a non-standard dir
++ added_lib_dirs.append(os.path.dirname(tcllib))
++ # Exit the loop when we've found the Tcl/Tk libraries
++ break
++
+ # Now check for the header files
+ if tklib and tcllib:
+ # Check for the include files on Debian and {Free,Open}BSD, where
+@@ -1572,6 +1618,7 @@
+ for dir in inc_dirs:
+ tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
+ tk_include_sub += [dir + os.sep + "tk" + dotversion]
++ tcl_include_sub += tcl_tk_inc_dirs
+ tk_include_sub += tcl_include_sub
+ tcl_includes = find_file('tcl.h', inc_dirs, tcl_include_sub)
+ tk_includes = find_file('tk.h', inc_dirs, tk_include_sub)
+@@ -1636,6 +1683,7 @@
+ include_dirs = include_dirs,
+ libraries = libs,
+ library_dirs = added_lib_dirs,
++ runtime_library_dirs = added_lib_dirs
+ )
+ self.extensions.append(ext)
+
+diff --git Python-2.6.4/Lib/site-packages/vendor-packages.pth Python2.6.4/Lib/site-packages/vendor-packages.pth
+--- /dev/null Sat Feb 12 00:21:26 2011
++++ Python-2.6.4/Lib/site-packages/vendor-packages.pth Sat Feb 12 00:47:05 2011
+@@ -0,0 +1,1 @@
++import site; site.addsitedir('/usr/lib/python2.6/vendor-packages')
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-02-pycc.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,199 @@
+diff --git Python-2.6.4/Makefile.pre.in Python-2.6.4/Makefile.pre.in
+--- Python-2.6.4/Makefile.pre.in.orig Sun Feb 13 21:00:17 2011
++++ Python-2.6.4/Makefile.pre.in Sun Feb 13 21:02:35 2011
+@@ -663,6 +663,8 @@
+
+ $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
+
++install-pycc: $(srcdir)/pycc
++ $(INSTALL_SCRIPT) $< $(DESTDIR)$(BINLIBDEST)
+
+ ######################################################################
+
+@@ -728,7 +728,7 @@
+ $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
+
+ # Install everything
+-install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@
++install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@ install-pycc
+
+ # Install almost everything without disturbing previous versions
+ altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
+
+diff --git Python-2.6.4/pycc Python-2.6.4/pycc
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/pycc
+@@ -0,0 +1,172 @@
++#!/bin/ksh
++#
++# Script for running the C/C++ compiler when building python modules
++#
++# CDDL HEADER START
++#
++# The contents of this file are subject to the terms of the
++# Common Development and Distribution License, Version 1.0 only
++# (the "License"). You may not use this file except in compliance
++# with the License.
++#
++# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++# or http://www.opensolaris.org/os/licensing.
++# See the License for the specific language governing permissions
++# and limitations under the License.
++#
++# When distributing Covered Code, include this CDDL HEADER in each
++# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++# If applicable, add the following below this CDDL HEADER, with the
++# fields enclosed by brackets "[]" replaced with your own identifying
++# information: Portions Copyright [yyyy] [name of copyright owner]
++#
++# CDDL HEADER END
++#
++#
++# Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
++# Use is subject to license terms.
++#
++
++MYNAME=`basename $0`
++
++# name of the compiler executable
++CCEXE='cc'
++# name of the GNU compiler executable
++GCCEXE='gcc'
++# name of the programming language
++CLANG='C'
++# name of the env variable for setting the compiler path
++CVAR='CC'
++
++if [ "x$PYCC_CC" != x ]; then
++ CC="$PYCC_CC"
++fi
++
++if [ "x$MYNAME" = xpyCC ]; then
++ CCEXE='CC'
++ GCCEXE='g++'
++ CLANG='C++'
++ CC="$CXX"
++ CVAR='CXX'
++ if [ "x$PYCC_CXX" != x ]; then
++ CC="$PYCC_CXX"
++ fi
++fi
++
++SAVED_IFS="$IFS"
++IFS=:
++
++# check if the CC env variable is set
++if [ "x$CC" != x ]; then
++ # verify that it doesn't point to this script
++ if /usr/bin/cmp -s "$CC" $0; then
++ echo "WARNING: "$CVAR" is set to this script; ignoring this value to avoid an infinite loop"
++ CC=
++ fi
++fi
++
++# check again if the CC env variable is set
++if [ "x$CC" != x ]; then
++ case "$CC" in
++ /* )
++ # $CC is an absolute path name
++ # check if $CC exists
++ if [ ! -e "$CC" ]; then
++ echo "WARNING: pycc: $CC not found" 1>&2
++ CC=
++ else
++ # check if $CC is an executable
++ if [ ! -x "$CC" -o ! -f "$CC" ]; then
++ echo "WARNING: pycc: $CC is not an executable" 1>&2
++ CC=
++ fi
++ fi
++ ;;
++ * )
++ # try to find $CC in the PATH
++ NEW_CC=
++ for dir in $PATH; do
++ if [ -x "$dir/$CC" ]; then
++ NEW_CC="$dir/$CC"
++ break
++ fi
++ done
++ if [ "x$NEW_CC" = x ]; then
++ echo "WARNING: pycc: $CC not found" 1>&2
++ CC=
++ else
++ CC="$NEW_CC"
++ fi
++ ;;
++ esac
++fi
++
++if [ "x$CC" = x ]; then
++ # Look for the Sun Studio compiler in the PATH
++ for dir in $PATH; do
++ if [ -x "$dir/$CCEXE" ]; then
++ CC="$dir/$CCEXE"
++ break
++ fi
++ done
++fi
++
++if [ "x$CC" = x ]; then
++ # Look for gcc in the PATH
++ for dir in $PATH; do
++ if [ -x "$dir/$GCCEXE" ]; then
++ CC="$dir/$GCCEXE"
++ break
++ fi
++ done
++fi
++
++if [ "x$CC" = x ]; then
++ # Check for Sun Studio in /opt/SUNWspro (default install location)
++ if [ -x /opt/SUNWspro/bin/$CCEXE ]; then
++ CC=/opt/SUNWspro/bin/$CCEXE
++ fi
++fi
++
++if [ "x$CC" = x ]; then
++ # Check for the GNU compiler in /usr/sfw/bin
++ if [ -x /usr/sfw/bin/$GCCEXE ]; then
++ CC=/usr/sfw/bin/$GCCEXE
++ fi
++fi
++
++if [ "x$CC" = x ]; then
++ # Cannot continue without a C compiler
++ echo "ERROR: no $CLANG compiler not found; update your PATH or set the $CVAR env variable" 1>&2
++ exit 1
++fi
++
++IFS="$SAVED_IFS"
++
++# We need to make some modifications to adapt correctly to compiler options
++# that differ between GCC and Studio.
++
++extra_flags=
++
++is_gcc=no
++
++$CC --version >/dev/null 2>&1 && is_gcc=yes
++
++if [ "$is_gcc" = yes ]; then
++ for flag in "${@}"; do
++ # need -shared to link shared objects properly
++ if [ "$flag" = "-G" ]; then
++ extra_flags="$extra_flags -shared"
++ fi
++ # workaround for 6223255
++ if [ "$flag" = "-m64" ]; then
++ extra_flags="$extra_flags -R/usr/sfw/lib/amd64"
++ fi
++ done
++ # force PIC compilation
++ extra_flags="$extra_flags -fPIC -DPIC"
++else
++ extra_flags="$extra_flags -KPIC"
++fi
++
++exec "$CC" $extra_flags "${@}"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-03-distutils-pycc.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,24 @@
+diff --git Python-2.6.4/Lib/distutils/sysconfig.py Python-2.6.4/Lib/distutils/sysconfig.py
+--- Python-2.6.4/Lib/distutils/sysconfig.py
++++ Python-2.6.4/Lib/distutils/sysconfig.py
+@@ -166,16 +166,10 @@
+ get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS',
+ 'CCSHARED', 'LDSHARED', 'SO')
+
+- if 'CC' in os.environ:
+- cc = os.environ['CC']
+- if 'CXX' in os.environ:
+- cxx = os.environ['CXX']
+- if 'LDSHARED' in os.environ:
+- ldshared = os.environ['LDSHARED']
+- if 'CPP' in os.environ:
+- cpp = os.environ['CPP']
+- else:
+- cpp = cc + " -E" # not always
++ # On Solaris, we must always use pycc/pyCC, which will then look up
++ # $CC and $CXX
++ cpp = cc + " -E"
++
+ if 'LDFLAGS' in os.environ:
+ ldshared = ldshared + ' ' + os.environ['LDFLAGS']
+ if 'CFLAGS' in os.environ:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-04-distutils-log.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,30 @@
+diff --git Python-2.6.4/Lib/distutils/spawn.py Python-2.6.4/Lib/distutils/spawn.py
+--- Python-2.6.4/Lib/distutils/spawn.py
++++ Python-2.6.4/Lib/distutils/spawn.py
+@@ -73,7 +73,7 @@
+ if search_path:
+ # either we find one or it stays the same
+ executable = find_executable(executable) or executable
+- log.info(string.join([executable] + cmd[1:], ' '))
++ log.info("%s", string.join([executable] + cmd[1:], ' '))
+ if not dry_run:
+ # spawn for NT requires a full path to the .exe
+ try:
+@@ -98,7 +98,7 @@
+ if search_path:
+ # either we find one or it stays the same
+ executable = find_executable(executable) or executable
+- log.info(string.join([executable] + cmd[1:], ' '))
++ log.info("%s", string.join([executable] + cmd[1:], ' '))
+ if not dry_run:
+ # spawnv for OS/2 EMX requires a full path to the .exe
+ try:
+@@ -119,7 +119,7 @@
+ verbose=0,
+ dry_run=0):
+
+- log.info(string.join(cmd, ' '))
++ log.info("%s", string.join(cmd, ' '))
+ if dry_run:
+ return
+ exec_fn = search_path and os.execvp or os.execv
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-05-isalibs.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,452 @@
+diff --git Python-2.6.4/Lib/distutils/command/build_ext.py Python-2.6.4/Lib/distutils/command/build_ext.py
+--- Python-2.6.4/Lib/distutils/command/build_ext.py
++++ Python-2.6.4/Lib/distutils/command/build_ext.py
+@@ -636,6 +636,8 @@
+ modpath = fullname.split('.')
+ filename = self.get_ext_filename(ext_name)
+ filename = os.path.split(filename)[-1]
++ if sys.maxint != 2147483647L:
++ filename = os.path.join("64", filename)
+
+ if not self.inplace:
+ # no further work needed
+@@ -677,7 +679,13 @@
+ so_ext = get_config_var('SO')
+ if os.name == 'nt' and self.debug:
+ return apply(os.path.join, ext_path) + '_d' + so_ext
+- return os.path.join(*ext_path) + so_ext
++ # .so extensions are word-size specific
++ path = apply(os.path.join, ext_path)
++ if sys.maxint == 2147483647L:
++ return path + so_ext
++ dirname = os.path.dirname(path);
++ basename = os.path.basename(path);
++ return os.path.join(dirname, "64", basename + so_ext)
+
+ def get_export_symbols (self, ext):
+ """Return the list of symbols that a shared extension has to
+diff --git Python-2.6.4/Makefile.pre.in Python-2.6.4/Makefile.pre.in
+--- Python-2.6.4/Makefile.pre.in
++++ Python-2.6.4/Makefile.pre.in
+@@ -87,18 +87,18 @@
+
+ # Expanded directories
+ BINDIR= $(exec_prefix)/bin
+-LIBDIR= $(exec_prefix)/lib
++LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
+ CONFINCLUDEDIR= $(exec_prefix)/include
+ SCRIPTDIR= $(prefix)/lib
+
+ # Detailed destination directories
+-BINLIBDEST= $(LIBDIR)/python$(VERSION)
+-LIBDEST= $(SCRIPTDIR)/python$(VERSION)
+-INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
+-CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
+-LIBP= $(LIBDIR)/python$(VERSION)
++BINLIBDEST= $(exec_prefix)/lib/python$(VERSION)
++LIBDEST= $(SCRIPTDIR)/python$(VERSION)
++INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
++CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
++LIBP= $(exec_prefix)/lib/python$(VERSION)
+
+ # Symbols used for using shared libraries
+ SO= @SO@
+diff --git Python-2.6.4/Python/import.c Python-2.6.4/Python/import.c
+--- Python-2.6.4/Python/import.c
++++ Python-2.6.4/Python/import.c
+@@ -1191,6 +1191,57 @@
+ static int find_init_module(char *); /* Forward */
+ static struct filedescr importhookdescr = {"", "", IMP_HOOK};
+
++#ifdef HAVE_STAT
++static char *
++insert_64dir(char *buf, size_t buflen)
++{
++ char *base;
++ char *cp;
++ size_t blen;
++
++ if ((blen = strlen(buf)) == 0)
++ return (NULL);
++
++ cp = &buf[blen - 1];
++ while (cp != buf && *cp != SEP)
++ cp--;
++
++ if (cp != buf)
++ cp++;
++
++ if (blen + strlen("64/") + 1 >= buflen)
++ return NULL;
++
++ base = strdup(cp);
++ sprintf(cp, "64%c%s", SEP, base);
++ free(base);
++
++ return buf;
++}
++
++/*
++ * If we're on a 64-bit platform, modify lookups for shared object files.
++ */
++static size_t modify_path(struct filedescr *fdp, char *buf, size_t buflen)
++{
++ struct stat statbuf;
++
++ if (sizeof(void *) != 8)
++ return 0;
++
++ if (stat(buf, &statbuf) == 0 && S_ISDIR(statbuf.st_mode))
++ return 0;
++
++ if (fdp->type != C_EXTENSION)
++ return 0;
++
++ if (insert_64dir(buf, buflen) == NULL)
++ return 0;
++
++ return strlen("64/");
++}
++#endif
++
+ static struct filedescr *
+ find_module(char *fullname, char *subname, PyObject *path, char *buf,
+ size_t buflen, FILE **p_fp, PyObject **p_loader)
+@@ -1208,11 +1259,10 @@
+ static struct filedescr fd_builtin = {"", "", C_BUILTIN};
+ static struct filedescr fd_package = {"", "", PKG_DIRECTORY};
+ char name[MAXPATHLEN+1];
+-#if defined(PYOS_OS2)
+ size_t saved_len;
+ size_t saved_namelen;
+ char *saved_buf = NULL;
+-#endif
++
+ if (p_loader != NULL)
+ *p_loader = NULL;
+
+@@ -1431,15 +1481,19 @@
+ }
+ #endif
+ #endif
+-#if defined(PYOS_OS2)
++
+ /* take a snapshot of the module spec for restoration
+ * after the 8 character DLL hackery
+ */
+ saved_buf = strdup(buf);
+ saved_len = len;
+ saved_namelen = namelen;
+-#endif /* PYOS_OS2 */
++
+ for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) {
++#ifdef HAVE_STAT
++ len += modify_path(fdp, buf, buflen);
++#endif
++
+ #if defined(PYOS_OS2) && defined(HAVE_DYNAMIC_LOADING)
+ /* OS/2 limits DLLs to 8 character names (w/o
+ extension)
+@@ -1480,21 +1534,18 @@
+ fp = NULL;
+ }
+ }
+-#if defined(PYOS_OS2)
++
+ /* restore the saved snapshot */
+ strcpy(buf, saved_buf);
+ len = saved_len;
+ namelen = saved_namelen;
+-#endif
+ }
+-#if defined(PYOS_OS2)
+ /* don't need/want the module name snapshot anymore */
+ if (saved_buf)
+ {
+ free(saved_buf);
+ saved_buf = NULL;
+ }
+-#endif
+ Py_XDECREF(copy);
+ if (fp != NULL)
+ break;
+diff --git Python-2.6.4/Python/importdl.h Python-2.6.4/Python/importdl.h
+--- Python-2.6.4/Python/importdl.h
++++ Python-2.6.4/Python/importdl.h
+@@ -31,8 +31,9 @@
+ extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname,
+ FILE *);
+
+-/* Max length of module suffix searched for -- accommodates "module.slb" */
+-#define MAXSUFFIXSIZE 12
++/* Max length of module suffix searched for -- accommodates "module.slb"
++ and "64/" */
++#define MAXSUFFIXSIZE 15
+
+ #ifdef MS_WINDOWS
+ #include <windows.h>
+diff --git Python-2.6.4/configure.in Python-2.6.4/configure.in
+--- Python-2.6.4/configure.in
++++ Python-2.6.4/configure.in
+@@ -17,8 +17,44 @@
+ AH_TOP([
+ #ifndef Py_PYCONFIG_H
+ #define Py_PYCONFIG_H
++
+ ])
+ AH_BOTTOM([
++
++#include <sys/isa_defs.h>
++
++/*
++ * Python originally defined these statically, which prevents a 32-64 python
++ * from working at all.
++ */
++
++#define SIZEOF_SHORT 2
++#define SIZEOF_INT 4
++#define SIZEOF_LONG_LONG 8
++#define SIZEOF_FPOS_T 8
++#define SIZEOF_OFF_T 8
++#define SIZEOF_PTHREAD_T 4
++
++#ifdef _LP64
++#define SIZEOF_LONG 8
++#define SIZEOF_UINTPTR_T 8
++#define SIZEOF_VOID_P 8
++#define SIZEOF_TIME_T 8
++#define SIZEOF_SIZE_T 8
++#define SIZEOF_LONG_DOUBLE 16
++#else
++#define SIZEOF_LONG 4
++#define SIZEOF_UINTPTR_T 4
++#define SIZEOF_VOID_P 4
++#define SIZEOF_TIME_T 4
++#define SIZEOF_SIZE_T 4
++#if defined(__i386)
++#define SIZEOF_LONG_DOUBLE 12
++#else
++#define SIZEOF_LONG_DOUBLE 16
++#endif
++#endif
++
+ /* Define the macros needed if on a UnixWare 7.x system. */
+ #if defined(__USLC__) && defined(__SCO_VERSION__)
+ #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
+@@ -65,6 +101,26 @@
+
+ define_xopen_source=yes
+
++# AC_CHECK_SIZEOF without the AC_DEFINE_UNQUOTED
++AC_DEFUN([PY_CHECK_SIZEOF],
++[AS_LITERAL_IF([$1], [],
++ [AC_FATAL([$0: requires literal arguments])])dnl
++AC_CHECK_TYPE([$1], [], [], [$3])
++AC_CACHE_CHECK([size of $1], AS_TR_SH([ac_cv_sizeof_$1]),
++[if test "$AS_TR_SH([ac_cv_type_$1])" = yes; then
++ # The cast to unsigned long works around a bug in the HP C Compiler
++ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
++ # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
++ # This bug is HP SR number 8606223364.
++ _AC_COMPUTE_INT([(long) (sizeof ($1))],
++ [AS_TR_SH([ac_cv_sizeof_$1])],
++ [AC_INCLUDES_DEFAULT([$3])],
++ [AC_MSG_FAILURE([cannot compute sizeof ($1), 77])])
++else
++ AS_TR_SH([ac_cv_sizeof_$1])=0
++fi])dnl
++])# PY_CHECK_SIZEOF
++
+ # Arguments passed to configure.
+ AC_SUBST(CONFIG_ARGS)
+ CONFIG_ARGS="$ac_configure_args"
+@@ -1377,14 +1433,10 @@
+
+ # Sizes of various common basic types
+ # ANSI C requires sizeof(char) == 1, so no need to check it
+-AC_CHECK_SIZEOF(int, 4)
+-AC_CHECK_SIZEOF(long, 4)
+-AC_CHECK_SIZEOF(void *, 4)
+ AC_CHECK_SIZEOF(short, 2)
+ AC_CHECK_SIZEOF(float, 4)
+ AC_CHECK_SIZEOF(double, 8)
+-AC_CHECK_SIZEOF(fpos_t, 4)
+-AC_CHECK_SIZEOF(size_t, 4)
++AC_CHECK_SIZEOF(short)
+ AC_CHECK_SIZEOF(pid_t, 4)
+
+ AC_MSG_CHECKING(for long long support)
+@@ -1394,9 +1446,6 @@
+ have_long_long=yes
+ ])
+ AC_MSG_RESULT($have_long_long)
+-if test "$have_long_long" = yes ; then
+-AC_CHECK_SIZEOF(long long, 8)
+-fi
+
+ AC_MSG_CHECKING(for long double support)
+ have_long_double=no
+@@ -1404,10 +1453,6 @@
+ AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define this if you have the type long double.])
+ have_long_double=yes
+ ])
+-AC_MSG_RESULT($have_long_double)
+-if test "$have_long_double" = yes ; then
+-AC_CHECK_SIZEOF(long double, 12)
+-fi
+
+ AC_MSG_CHECKING(for _Bool support)
+ have_c99_bool=no
+@@ -1421,102 +1466,26 @@
+ fi
+
+ AC_CHECK_TYPES(uintptr_t,
+- [AC_CHECK_SIZEOF(uintptr_t, 4)],
++ [],
+ [], [#ifdef HAVE_STDINT_H
+ #include <stdint.h>
+ #endif])
+
+
+-# Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>.
+-AC_MSG_CHECKING(size of off_t)
+-AC_CACHE_VAL(ac_cv_sizeof_off_t,
+-[AC_TRY_RUN([#include <stdio.h>
++PY_CHECK_SIZEOF(off_t,4,[
++#include <stdio.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+-main()
+-{
+- FILE *f=fopen("conftestval", "w");
+- if (!f) exit(1);
+- fprintf(f, "%d\n", sizeof(off_t));
+- exit(0);
+-}],
+-ac_cv_sizeof_off_t=`cat conftestval`,
+-ac_cv_sizeof_off_t=0,
+-ac_cv_sizeof_off_t=4)
+ ])
+-AC_MSG_RESULT($ac_cv_sizeof_off_t)
+-AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t,
+-[The number of bytes in an off_t.])
+
+ AC_MSG_CHECKING(whether to enable large file support)
+-if test "$have_long_long" = yes -a \
+- "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \
+- "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then
+- AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
+- [Defined to enable large file support when an off_t is bigger than a long
+- and long long is available and at least as big as an off_t. You may need
+- to add some flags for configuration and compilation to enable this mode.
+- (For Solaris and Linux, the necessary defines are already defined.)])
+- AC_MSG_RESULT(yes)
+-else
+- AC_MSG_RESULT(no)
+-fi
+
+-# AC_CHECK_SIZEOF() doesn't include <time.h>.
+-AC_MSG_CHECKING(size of time_t)
+-AC_CACHE_VAL(ac_cv_sizeof_time_t,
+-[AC_TRY_RUN([#include <stdio.h>
+-#include <time.h>
+-main()
+-{
+- FILE *f=fopen("conftestval", "w");
+- if (!f) exit(1);
+- fprintf(f, "%d\n", sizeof(time_t));
+- exit(0);
+-}],
+-ac_cv_sizeof_time_t=`cat conftestval`,
+-ac_cv_sizeof_time_t=0,
+-ac_cv_sizeof_time_t=4)
+-])
+-AC_MSG_RESULT($ac_cv_sizeof_time_t)
+-AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t,
+-[The number of bytes in a time_t.])
+-
+-
+-# if have pthread_t then define SIZEOF_PTHREAD_T
+-ac_save_cc="$CC"
+-if test "$ac_cv_kpthread" = "yes"
+-then CC="$CC -Kpthread"
+-elif test "$ac_cv_kthread" = "yes"
+-then CC="$CC -Kthread"
+-elif test "$ac_cv_pthread" = "yes"
+-then CC="$CC -pthread"
+-fi
+-AC_MSG_CHECKING(for pthread_t)
+-have_pthread_t=no
+-AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes)
+-AC_MSG_RESULT($have_pthread_t)
+-if test "$have_pthread_t" = yes ; then
+- # AC_CHECK_SIZEOF() doesn't include <pthread.h>.
+- AC_MSG_CHECKING(size of pthread_t)
+- AC_CACHE_VAL(ac_cv_sizeof_pthread_t,
+- [AC_TRY_RUN([#include <stdio.h>
+-#include <pthread.h>
+- main()
+- {
+- FILE *f=fopen("conftestval", "w");
+- if (!f) exit(1);
+- fprintf(f, "%d\n", sizeof(pthread_t));
+- exit(0);
+- }],
+- ac_cv_sizeof_pthread_t=`cat conftestval`,
+- ac_cv_sizeof_pthread_t=0,
+- ac_cv_sizeof_pthread_t=4)
+- ])
+- AC_MSG_RESULT($ac_cv_sizeof_pthread_t)
+- AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t,
+- [The number of bytes in a pthread_t.])
+-fi
+-CC="$ac_save_cc"
++AC_DEFINE(HAVE_LARGEFILE_SUPPORT, 1,
++[Defined to enable large file support when an off_t is bigger than a long
++ and long long is available and at least as big as an off_t. You may need
++ to add some flags for configuration and compilation to enable this mode.
++ (For Solaris and Linux, the necessary defines are already defined.)])
++AC_MSG_RESULT(yes)
+
+ AC_MSG_CHECKING(for --enable-toolbox-glue)
+ AC_ARG_ENABLE(toolbox-glue,
+@@ -1810,12 +1779,6 @@
+ if test -z "$CCSHARED"
+ then
+ case $ac_sys_system/$ac_sys_release in
+- SunOS*) if test "$GCC" = yes;
+- then CCSHARED="-fPIC";
+- elif test `uname -p` = sparc;
+- then CCSHARED="-xcode=pic32";
+- else CCSHARED="-Kpic";
+- fi;;
+ hp*|HP*) if test "$GCC" = yes;
+ then CCSHARED="-fPIC";
+ else CCSHARED="+z";
+@@ -3308,12 +3271,6 @@
+ wchar_h="no"
+ )
+
+-# determine wchar_t size
+-if test "$wchar_h" = yes
+-then
+- AC_CHECK_SIZEOF(wchar_t, 4, [#include <wchar.h>])
+-fi
+-
+ AC_MSG_CHECKING(for UCS-4 tcl)
+ have_ucs4_tcl=no
+ AC_TRY_COMPILE([
+@@ -3344,6 +3301,11 @@
+ ac_cv_wchar_t_signed=no,
+ ac_cv_wchar_t_signed=yes)])
+ AC_MSG_RESULT($ac_cv_wchar_t_signed)
++
++ PY_CHECK_SIZEOF(wchar_t, 4, [
++ #include <wchar.h>
++ #include <stdlib.h
++ ])
+ fi
+
+ AC_MSG_CHECKING(what type to use for unicode)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-06-write_compiled_module-atomic.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,84 @@
+diff --git Python-2.6.4/Python/import.c Python-2.6.4/Python/import.c
+--- Python-2.6.4/Python/import.c
++++ Python-2.6.4/Python/import.c
+@@ -866,8 +866,9 @@
+
+ /* Write a compiled module to a file, placing the time of last
+ modification of its source into the header.
+- Errors are ignored, if a write error occurs an attempt is made to
+- remove the file. */
++ Write to a temporary file first so that creating the file is atomic.
++ Errors are ignored, if a write/unlink/rename error occurs an attempt
++ is made to remove the temporary file. */
+
+ static void
+ write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
+@@ -879,12 +880,21 @@
+ #else
+ mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
+ #endif
++ char *tmppathname;
++
++ /* the temporary file is called cpathname + ".tmp" */
++ if ((tmppathname = PyMem_Malloc(strlen(cpathname) + strlen(".tmp") + 1))
++ == NULL) {
++ return;
++ }
++ sprintf (tmppathname, "%s.tmp", cpathname);
++ fp = open_exclusive(tmppathname, mode);
+
+- fp = open_exclusive(cpathname, mode);
+ if (fp == NULL) {
+ if (Py_VerboseFlag)
+ PySys_WriteStderr(
+- "# can't create %s\n", cpathname);
++ "# can't create %s\n", tmppathname);
++ PyMem_Free(tmppathname);
+ return;
+ }
+ PyMarshal_WriteLongToFile(pyc_magic, fp, Py_MARSHAL_VERSION);
+@@ -893,10 +903,11 @@
+ PyMarshal_WriteObjectToFile((PyObject *)co, fp, Py_MARSHAL_VERSION);
+ if (fflush(fp) != 0 || ferror(fp)) {
+ if (Py_VerboseFlag)
+- PySys_WriteStderr("# can't write %s\n", cpathname);
++ PySys_WriteStderr("# can't write %s\n", tmppathname);
+ /* Don't keep partial file */
+ fclose(fp);
+- (void) unlink(cpathname);
++ (void) unlink(tmppathname);
++ PyMem_Free(tmppathname);
+ return;
+ }
+ /* Now write the true mtime */
+@@ -905,8 +916,30 @@
+ PyMarshal_WriteLongToFile((long)mtime, fp, Py_MARSHAL_VERSION);
+ fflush(fp);
+ fclose(fp);
++ /* Delete the old compiled file, if exists */
++ if (unlink (cpathname)) {
++ if ((errno != ENOENT)) {
++ /* the file exists but could not be deleted */
++ if (Py_VerboseFlag)
++ PySys_WriteStderr(
++ "# can't unlink %s\n", cpathname);
++ (void) unlink(tmppathname);
++ PyMem_Free(tmppathname);
++ return;
++ }
++ }
++ /* rename the tmp file to the real file name */
++ if (rename (tmppathname, cpathname)) {
++ if (Py_VerboseFlag)
++ PySys_WriteStderr(
++ "# can't rename %s to %s\n", tmppathname, cpathname);
++ (void) unlink(tmppathname);
++ PyMem_Free(tmppathname);
++ return;
++ }
+ if (Py_VerboseFlag)
+ PySys_WriteStderr("# wrote %s\n", cpathname);
++ PyMem_Free(tmppathname);
+ }
+
+ static void
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-07-dtrace.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,417 @@
+diff --git Python-2.6.4/Include/frameobject.h Python-2.6.4/Include/frameobject.h
+--- Python-2.6.4/Include/frameobject.h
++++ Python-2.6.4/Include/frameobject.h
+@@ -41,6 +41,7 @@
+ /* As of 2.3 f_lineno is only valid when tracing is active (i.e. when
+ f_trace is set) -- at other times use PyCode_Addr2Line instead. */
+ int f_lineno; /* Current line number */
++ int f_calllineno; /* line number of call site */
+ int f_iblock; /* index in f_blockstack */
+ PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */
+ PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */
+diff --git Python-2.6.4/Makefile.pre.in Python-2.6.4/Makefile.pre.in
+--- Python-2.6.4/Makefile.pre.in
++++ Python-2.6.4/Makefile.pre.in
+@@ -201,6 +201,7 @@
+ GRAMMAR_C= $(srcdir)/Python/graminit.c
+ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
+
++DTRACE_OBJS=Python/dtrace.o Python/phelper.o
+
+ ##########################################################################
+ # Parser
+@@ -290,6 +291,7 @@
+ Python/formatter_unicode.o \
+ Python/formatter_string.o \
+ Python/$(DYNLOADFILE) \
++ $(DTRACE_OBJS) \
+ $(LIBOBJS) \
+ $(MACHDEP_OBJS) \
+ $(THREADOBJ)
+@@ -577,6 +579,18 @@
+ Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \
+ $(STRINGLIB_HEADERS)
+
++Python/phelper.o: $(srcdir)/Python/phelper.d
++ dtrace -o $@ -DPHELPER $(DFLAGS) $(CPPFLAGS) -C -G -s $(srcdir)/Python/phelper.d
++
++Python/python.h: $(srcdir)/Python/python.d
++ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Python/python.d
++
++Python/ceval.o: Python/ceval.c Python/python.h
++ $(CC) -c $(BASECFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE -o $@ $<
++
++Python/dtrace.o: $(srcdir)/Python/python.d Python/ceval.o
++ dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Python/python.d Python/ceval.o
++
+ ############################################################################
+ # Header files
+
+diff --git Python-2.6.4/Objects/frameobject.c Python-2.6.4/Objects/frameobject.c
+--- Python-2.6.4/Objects/frameobject.c
++++ Python-2.6.4/Objects/frameobject.c
+@@ -698,6 +698,7 @@
+ f->f_tstate = tstate;
+
+ f->f_lasti = -1;
++ f->f_calllineno = code->co_firstlineno;
+ f->f_lineno = code->co_firstlineno;
+ f->f_iblock = 0;
+
+diff --git Python-2.6.4/Python/ceval.c Python-2.6.4/Python/ceval.c
+--- Python-2.6.4/Python/ceval.c
++++ Python-2.6.4/Python/ceval.c
+@@ -19,6 +19,11 @@
+
+ #include <ctype.h>
+
++#define HAVE_DTRACE
++#ifdef HAVE_DTRACE
++#include "python.h"
++#endif
++
+ #ifndef WITH_TSC
+
+ #define READ_TIMESTAMP(var)
+@@ -527,6 +532,55 @@
+ NULL);
+ }
+
++#ifdef HAVE_DTRACE
++static void
++dtrace_entry(PyFrameObject *f)
++{
++ const char *filename;
++ const char *fname;
++ int lineno;
++
++ filename = PyString_AsString(f->f_code->co_filename);
++ fname = PyString_AsString(f->f_code->co_name);
++ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
++
++ PYTHON_FUNCTION_ENTRY((char *)filename, (char *)fname, lineno);
++
++ /*
++ * Currently a USDT tail-call will not receive the correct arguments.
++ * Disable the tail call here.
++ */
++#if defined(__sparc)
++ asm("nop");
++#endif
++}
++
++static void
++dtrace_return(PyFrameObject *f)
++{
++ const char *filename;
++ const char *fname;
++ int lineno;
++
++ filename = PyString_AsString(f->f_code->co_filename);
++ fname = PyString_AsString(f->f_code->co_name);
++ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti);
++ PYTHON_FUNCTION_RETURN((char *)filename, (char *)fname, lineno);
++
++ /*
++ * Currently a USDT tail-call will not receive the correct arguments.
++ * Disable the tail call here.
++ */
++#if defined(__sparc)
++ asm("nop");
++#endif
++}
++#else
++#define PYTHON_FUNCTION_ENTRY_ENABLED 0
++#define PYTHON_FUNCTION_RETURN_ENABLED 0
++#define dtrace_entry()
++#define dtrace_return()
++#endif
+
+ /* Interpreter main loop */
+
+@@ -538,9 +592,84 @@
+ return PyEval_EvalFrameEx(f, 0);
+ }
+
++/*
++ * These shenanigans look like utter madness, but what we're actually doing is
++ * making sure that the ustack helper will see the PyFrameObject pointer on the
++ * stack. We have two tricky cases:
++ *
++ * amd64
++ *
++ * We use up the six registers for passing arguments, meaning the call can't
++ * use a register for passing 'f', and has to push it onto the stack in a known
++ * location.
++ *
++ * And how does "throwflag" figure in to this? -PN
++ *
++ * SPARC
++ *
++ * Here the problem is that (on 32-bit) the compiler is re-using %i0 before
++ * some calls inside PyEval_EvalFrameReal(), which means that when it's saved,
++ * it's just some junk value rather than the real first argument. So, instead,
++ * we trace our proxy PyEval_EvalFrame(), where we 'know' the compiler won't
++ * decide to re-use %i0. We also need to defeat optimization of our proxy.
++ */
++
++#if defined(HAVE_DTRACE)
++
++#if defined(__amd64)
++PyObject *PyEval_EvalFrameExReal(long, long, long, long, long, long,
++ PyFrameObject *, int throwflag);
++
++
++
+ PyObject *
+ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
+ {
++ volatile PyObject *f2;
++ f2 = PyEval_EvalFrameExReal(0, 0, 0, 0, 0, 0, f, throwflag);
++ return (PyObject *)f2;
++}
++
++PyObject *
++PyEval_EvalFrameExReal(long a1, long a2, long a3, long a4, long a5, long a6,
++ PyFrameObject *f, int throwflag)
++{
++
++#elif defined(__sparc)
++
++PyObject *PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag);
++
++volatile int dummy;
++
++PyObject *
++PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
++{
++ volatile PyObject *f2;
++ f2 = PyEval_EvalFrameExReal(f, throwflag);
++ dummy = f->ob_refcnt;
++ return (PyObject *)f2;
++}
++
++PyObject *
++PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag)
++{
++
++#else /* __amd64 || __sparc */
++
++PyObject *
++PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
++{
++
++#endif /* __amd64 || __sparc */
++
++#else /* don't HAVE_DTRACE */
++
++PyObject *
++PyEval_EvalFrameexEx(PyFrameObject *f, int throwflag))
++{
++
++#endif /* HAVE_DTRACE */
++
+ #ifdef DXPAIRS
+ int lastopcode = 0;
+ #endif
+@@ -763,6 +892,9 @@
+ }
+ }
+
++ if (PYTHON_FUNCTION_ENTRY_ENABLED())
++ dtrace_entry(f);
++
+ co = f->f_code;
+ names = co->co_names;
+ consts = co->co_consts;
+@@ -2383,6 +2515,10 @@
+ PyObject **sp;
+ PCALL(PCALL_ALL);
+ sp = stack_pointer;
++#ifdef HAVE_DTRACE
++ f->f_calllineno = PyCode_Addr2Line(f->f_code,
++ f->f_lasti);
++#endif
+ #ifdef WITH_TSC
+ x = call_function(&sp, oparg, &intr0, &intr1);
+ #else
+@@ -2425,6 +2561,11 @@
+ } else
+ Py_INCREF(func);
+ sp = stack_pointer;
++#ifdef HAVE_DTRACE
++ f->f_calllineno = PyCode_Addr2Line(f->f_code,
++ f->f_lasti);
++#endif
++
+ READ_TIMESTAMP(intr0);
+ x = ext_do_call(func, &sp, flags, na, nk);
+ READ_TIMESTAMP(intr1);
+@@ -2723,6 +2864,8 @@
+
+ /* pop frame */
+ exit_eval_frame:
++ if (PYTHON_FUNCTION_RETURN_ENABLED())
++ dtrace_return(f);
+ Py_LeaveRecursiveCall();
+ tstate->frame = f->f_back;
+
+diff --git Python-2.6.4/Python/phelper.d Python-2.6.4/Python/phelper.d
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/Python/phelper.d
+@@ -0,0 +1,139 @@
++
++/*
++ * Python ustack helper. This relies on the first argument (PyFrame *) being
++ * on the stack; see Python/ceval.c for the contortions we go through to ensure
++ * this is the case.
++ *
++ * On x86, the PyFrame * is two slots up from the frame pointer; on SPARC, it's
++ * eight.
++ */
++
++/*
++ * Yes, this is as gross as it looks. DTrace cannot handle static functions,
++ * and our stat_impl.h has them in ILP32.
++ */
++#define _SYS_STAT_H
++
++#include <stdio.h>
++#include <sys/types.h>
++
++#include "pyport.h"
++#include "object.h"
++#include "pystate.h"
++#include "pyarena.h"
++#include "pythonrun.h"
++#include "compile.h"
++#include "frameobject.h"
++#include "stringobject.h"
++
++#if defined(__i386)
++#define startframe PyEval_EvalFrameEx
++#define endframe PyEval_EvalCodeEx
++#elif defined(__amd64)
++#define PyEval_EvalFrameEx PyEval_EvalFrameExReal
++#define startframe PyEval_EvalFrameExReal
++#define endframe PyEval_EvalCodeEx
++#elif defined(__sparc)
++#define PyEval_EvalFrameEx PyEval_EvalFrameExReal
++#define startframe PyEval_EvalFrameEx
++#define endframe PyEval_EvalFrameExReal
++#endif
++
++#ifdef __sparcv9
++#define STACK_BIAS (2048-1)
++#else
++#define STACK_BIAS 0
++#endif
++
++/*
++ * Not defining PHELPER lets us test this code as a normal D script.
++ */
++#ifdef PHELPER
++
++#define at_evalframe(addr) \
++ ((uintptr_t)addr >= ((uintptr_t)&``startframe) && \
++ (uintptr_t)addr < ((uintptr_t)&``endframe))
++#define probe dtrace:helper:ustack:
++#define print_result(r) (r)
++
++#if defined(__i386) || defined(__amd64)
++#define frame_ptr_addr ((uintptr_t)arg1 + sizeof(uintptr_t) * 2)
++#elif defined(__sparc)
++#define frame_ptr_addr ((uintptr_t)arg1 + STACK_BIAS + sizeof(uintptr_t) * 8)
++#else
++#error unknown architecture
++#endif
++
++#else /* PHELPER */
++
++#define at_evalframe(addr) (1)
++#define probe pid$target::PyEval_EvalFrame:entry
++#define print_result(r) (trace(r))
++
++#if defined(__i386) || defined(__amd64)
++#define frame_ptr_addr ((uintptr_t)uregs[R_SP] + sizeof(uintptr_t))
++#elif defined(__sparc)
++/*
++ * Not implemented: we could just use R_I0, but what's the point?
++ */
++#else
++#error unknown architecture
++#endif
++
++#endif /* PHELPER */
++
++extern uintptr_t PyEval_EvalFrameEx;
++extern uintptr_t PyEval_EvalCodeEx;
++
++#define copyin_obj(addr, obj) ((obj *)copyin((uintptr_t)addr, sizeof(obj)))
++#define pystr_addr(addr) ((char *)addr + offsetof(PyStringObject, ob_sval))
++#define copyin_str(dest, addr, obj) \
++ (copyinto((uintptr_t)pystr_addr(addr), obj->ob_size, (dest)))
++#define add_str(addr, obj) \
++ copyin_str(this->result + this->pos, addr, obj); \
++ this->pos += obj->ob_size; \
++ this->result[this->pos] = '\0';
++#define add_digit(nr, div) ((nr / div) ? \
++ (this->result[this->pos++] = '0' + ((nr / div) % 10)) : \
++ (this->result[this->pos] = '\0'))
++#define add_char(c) (this->result[this->pos++] = c)
++
++probe /at_evalframe(arg0)/
++{
++ this->framep = *(uintptr_t *)copyin(frame_ptr_addr, sizeof(uintptr_t));
++ this->frameo = copyin_obj(this->framep, PyFrameObject);
++ this->codep = this->frameo->f_code;
++ this->lineno = this->frameo->f_calllineno;
++ this->codeo = copyin_obj(this->codep, PyCodeObject);
++ this->filenamep = this->codeo->co_filename;
++ this->fnamep = this->codeo->co_name;
++ this->filenameo = copyin_obj(this->filenamep, PyStringObject);
++ this->fnameo = copyin_obj(this->fnamep, PyStringObject);
++
++ this->len = 1 + this->filenameo->ob_size + 1 + 5 + 2 +
++ this->fnameo->ob_size + 1 + 1;
++
++ this->result = (char *)alloca(this->len);
++ this->pos = 0;
++
++ add_char('@');
++ add_str(this->filenamep, this->filenameo);
++ add_char(':');
++ add_digit(this->lineno, 10000);
++ add_digit(this->lineno, 1000);
++ add_digit(this->lineno, 100);
++ add_digit(this->lineno, 10);
++ add_digit(this->lineno, 1);
++ add_char(' ');
++ add_char('(');
++ add_str(this->fnamep, this->fnameo);
++ add_char(')');
++ this->result[this->pos] = '\0';
++
++ print_result(stringof(this->result));
++}
++
++probe /!at_evalframe(arg0)/
++{
++ NULL;
++}
+diff --git Python-2.6.4/Python/python.d Python-2.6.4/Python/python.d
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/Python/python.d
+@@ -0,0 +1,10 @@
++provider python {
++ probe function__entry(const char *, const char *, int);
++ probe function__return(const char *, const char *, int);
++};
++
++#pragma D attributes Evolving/Evolving/Common provider python provider
++#pragma D attributes Private/Private/Common provider python module
++#pragma D attributes Private/Private/Common provider python function
++#pragma D attributes Evolving/Evolving/Common provider python name
++#pragma D attributes Evolving/Evolving/Common provider python args
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-08-ctypes.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,28 @@
+diff --git Python-2.6.4/Modules/_ctypes/callproc.c Python-2.6.4/Modules/_ctypes/callproc.c
+--- Python-2.6.4/Modules/_ctypes/callproc.c
++++ Python-2.6.4/Modules/_ctypes/callproc.c
+@@ -73,6 +73,8 @@
+ #include <malloc.h>
+ #endif
+
++#include <alloca.h>
++
+ #include <ffi.h>
+ #include "ctypes.h"
+
+diff --git Python-2.6.4/Modules/_ctypes/libffi/src/x86/ffitarget.h Python-2.6.4/Modules/_ctypes/libffi/src/x86/ffitarget.h
+--- Python-2.6.4/Modules/_ctypes/libffi/src/x86/ffitarget.h
++++ Python-2.6.4/Modules/_ctypes/libffi/src/x86/ffitarget.h
+@@ -54,10 +54,10 @@
+ #endif
+
+ /* ---- Intel x86 and AMD x86-64 - */
+-#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__))
++#if !defined(X86_WIN32) && (defined(__i386__) || defined(__i386) || defined(__x86_64__))
+ FFI_SYSV,
+ FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */
+-#ifdef __i386__
++#if defined (__i386__) || defined (__i386)
+ FFI_DEFAULT_ABI = FFI_SYSV,
+ #else
+ FFI_DEFAULT_ABI = FFI_UNIX64,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-09-ucred.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,2427 @@
+diff --git Python-2.6.4/Modules/ucred.c Python-2.6.4/Modules/ucred.c
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/Modules/ucred.c
+@@ -0,0 +1,391 @@
++/*
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this software and associated documentation files (the "Software"), to
++ * deal in the Software without restriction, including without limitation the
++ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++ * sell copies of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++#include <Python.h>
++
++#include <stdio.h>
++#include <priv.h>
++#include <ucred.h>
++#include <ctype.h>
++#include <tsol/label.h>
++
++typedef struct {
++ PyObject_HEAD
++ ucred_t *ucred;
++} pyucred_t;
++
++#define pyucred_getlongid(name, type) \
++ static PyObject * \
++ pyucred_get##name(pyucred_t *uc) \
++ { \
++ type val; \
++ \
++ if (uc->ucred == NULL) { \
++ errno = EINVAL; \
++ PyErr_SetFromErrno(PyExc_OSError); \
++ return (NULL); \
++ } \
++ \
++ if ((val = ucred_get##name(uc->ucred)) == -1) { \
++ PyErr_SetFromErrno(PyExc_OSError); \
++ return (NULL); \
++ } \
++ \
++ return (Py_BuildValue("l", (long)val)); \
++ }
++
++pyucred_getlongid(euid, uid_t)
++pyucred_getlongid(ruid, uid_t)
++pyucred_getlongid(suid, uid_t)
++pyucred_getlongid(egid, gid_t)
++pyucred_getlongid(rgid, gid_t)
++pyucred_getlongid(sgid, gid_t)
++pyucred_getlongid(pid, pid_t)
++pyucred_getlongid(projid, projid_t)
++pyucred_getlongid(zoneid, zoneid_t)
++
++static PyObject *
++pyucred_getgroups(pyucred_t *uc)
++{
++ const gid_t *groups;
++ PyObject *list;
++ int len;
++ int i;
++
++ if (uc->ucred == NULL) {
++ errno = EINVAL;
++ PyErr_SetFromErrno(PyExc_OSError);
++ return (NULL);
++ }
++
++ if ((len = ucred_getgroups(uc->ucred, &groups)) == -1) {
++ PyErr_SetFromErrno(PyExc_OSError);
++ return (NULL);
++ }
++
++ if ((list = PyList_New(len)) == NULL)
++ return (NULL);
++
++ for (i = 0; i < len; i++) {
++ PyObject *gid = Py_BuildValue("l", (long)groups[i]);
++ if (PyList_SetItem(list, i, gid) == -1)
++ return (NULL);
++ }
++
++ return (list);
++}
++
++static PyObject *
++pyucred_getlabel(pyucred_t *uc)
++{
++ m_label_t *label;
++ PyObject *ret;
++ char *str;
++
++ if (uc->ucred == NULL) {
++ errno = EINVAL;
++ PyErr_SetFromErrno(PyExc_OSError);
++ return (NULL);
++ }
++
++ label = ucred_getlabel(uc->ucred);
++ if (label == NULL)
++ return (Py_BuildValue("s", ""));
++
++ if (label_to_str(label, &str, M_LABEL, DEF_NAMES) == -1) {
++ PyErr_SetFromErrno(PyExc_OSError);
++ return (NULL);
++ }
++
++ ret = Py_BuildValue("s", str);
++ free(str);
++ return (ret);
++}
++
++static PyObject *
++pyucred_getpflags(pyucred_t *uc, PyObject *args, PyObject *kwargs)
++{
++ static char *kwlist[] = { "flags", NULL };
++ uint_t flags;
++
++ if (uc->ucred == NULL) {
++ errno = EINVAL;
++ PyErr_SetFromErrno(PyExc_OSError);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist,
++ &flags))
++ return (NULL);
++
++ if ((flags = ucred_getpflags(uc->ucred, flags)) == (uint_t)-1) {
++ PyErr_SetFromErrno(PyExc_OSError);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("i", flags));
++}
++
++static PyObject *
++pyucred_has_priv(pyucred_t *uc, PyObject *args, PyObject *kwargs)
++{
++ static char *kwlist[] = { "set", "priv", NULL };
++ const priv_set_t *privs;
++ const char *set;
++ const char *priv;
++
++ if (uc->ucred == NULL) {
++ errno = EINVAL;
++ PyErr_SetFromErrno(PyExc_OSError);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ss", kwlist,
++ &set, &priv))
++ return (NULL);
++
++ if ((privs = ucred_getprivset(uc->ucred, set)) == NULL) {
++ PyErr_SetFromErrno(PyExc_OSError);
++ return (NULL);
++ }
++
++ if (priv_ismember(privs, priv)) {
++ Py_INCREF(Py_True);
++ return Py_True;
++ }
++
++ Py_INCREF(Py_False);
++ return Py_False;
++}
++
++PyDoc_STRVAR(pyucred_getlabel_doc,
++ "getlabel() -> string\n"
++ "\n"
++ "Return the Trusted Extensions label string, or an "
++ "empty string if not available. The label string is "
++ "converted using the default name and M_LABEL (human-readable). "
++ "Raises OSError. See label_to_str(3TSOL).");
++PyDoc_STRVAR(pyucred_getpflags_doc,
++ "getpflags(flags) -> int\n"
++ "\n"
++ "Return the values of the specified privilege flags.");
++PyDoc_STRVAR(pyucred_has_priv_doc,
++ "has_priv(set, priv) -> bool\n"
++ "\n"
++ "Return true if the given privilege is set in the "
++ "specified set. Raises OSError if the set or privilege is "
++ "invalid, or a problem occurs.\n"
++ "\n"
++ "Currently, the following privilege sets are defined, as "
++ "described in privileges(5):\n"
++ "\n"
++ "Effective\n"
++ "Permitted\n"
++ "Inheritable\n"
++ "Limit\n");
++
++static PyMethodDef pyucred_methods[] = {
++ { "geteuid", (PyCFunction)pyucred_geteuid, METH_NOARGS,
++ "Return the effective user ID." },
++ { "getruid", (PyCFunction)pyucred_getruid, METH_NOARGS,
++ "Return the real user ID." },
++ { "getsuid", (PyCFunction)pyucred_getsuid, METH_NOARGS,
++ "Return the saved user ID." },
++ { "getegid", (PyCFunction)pyucred_getegid, METH_NOARGS,
++ "Return the effective group ID." },
++ { "getrgid", (PyCFunction)pyucred_getrgid, METH_NOARGS,
++ "Return the real group ID." },
++ { "getsgid", (PyCFunction)pyucred_getsgid, METH_NOARGS,
++ "Return the saved group ID." },
++ { "getpid", (PyCFunction)pyucred_getpid, METH_NOARGS,
++ "Return the effective user ID." },
++ { "getprojid", (PyCFunction)pyucred_getprojid, METH_NOARGS,
++ "Return the project ID." },
++ { "getzoneid", (PyCFunction)pyucred_getzoneid, METH_NOARGS,
++ "Return the zone ID." },
++ { "getgroups", (PyCFunction)pyucred_getgroups, METH_NOARGS,
++ "Return a list of group IDs." },
++ { "getlabel", (PyCFunction)pyucred_getlabel, METH_NOARGS,
++ pyucred_getlabel_doc },
++ { "getpflags", (PyCFunction)pyucred_getpflags,
++ METH_VARARGS|METH_KEYWORDS, pyucred_getpflags_doc },
++ { "has_priv", (PyCFunction)pyucred_has_priv,
++ METH_VARARGS|METH_KEYWORDS, pyucred_has_priv_doc },
++ { NULL }
++};
++
++static int
++pyucred_init(PyObject *self, PyObject *args, PyObject *kwargs)
++{
++ pyucred_t *uc = (pyucred_t *)self;
++ uc->ucred = NULL;
++ return (0);
++}
++
++static void
++pyucred_dealloc(PyObject *self)
++{
++ pyucred_t *uc = (pyucred_t *)self;
++ if (uc->ucred != NULL)
++ ucred_free(uc->ucred);
++ self->ob_type->tp_free(self);
++}
++
++static PyTypeObject pyucred_type = {
++ PyObject_HEAD_INIT(NULL)
++ 0, /*ob_size*/
++ "ucred.ucred", /*tp_name*/
++ sizeof (pyucred_t), /*tp_basicsize*/
++ 0, /*tp_itemsize*/
++ pyucred_dealloc, /*tp_dealloc*/
++ 0, /*tp_print*/
++ 0, /*tp_getattr*/
++ 0, /*tp_setattr*/
++ 0, /*tp_compare*/
++ 0, /*tp_repr*/
++ 0, /*tp_as_number*/
++ 0, /*tp_as_sequence*/
++ 0, /*tp_as_mapping*/
++ 0, /*tp_hash */
++ 0, /*tp_call*/
++ 0, /*tp_str*/
++ 0, /*tp_getattro*/
++ 0, /*tp_setattro*/
++ 0, /*tp_as_buffer*/
++ Py_TPFLAGS_DEFAULT, /*tp_flags*/
++ "user credentials", /*tp_doc */
++ 0, /* tp_traverse */
++ 0, /* tp_clear */
++ 0, /* tp_richcompare */
++ 0, /* tp_weaklistoffset */
++ 0, /* tp_iter */
++ 0, /* tp_iternext */
++ pyucred_methods, /* tp_methods */
++ 0, /* tp_members */
++ 0, /* tp_getset */
++ 0, /* tp_base */
++ 0, /* tp_dict */
++ 0, /* tp_descr_get */
++ 0, /* tp_descr_set */
++ 0, /* tp_dictoffset */
++ (initproc)pyucred_init, /* tp_init */
++ 0, /* tp_alloc */
++ 0, /* tp_new */
++};
++
++static PyObject *
++pyucred_new(const ucred_t *uc)
++{
++ pyucred_t *self;
++
++ self = (pyucred_t *)PyObject_CallObject((PyObject *)&pyucred_type, NULL);
++
++ if (self == NULL)
++ return (NULL);
++
++ self->ucred = (ucred_t *)uc;
++
++ return ((PyObject *)self);
++}
++
++static PyObject *
++pyucred_get(PyObject *o, PyObject *args, PyObject *kwargs)
++{
++ static char *kwlist[] = { "pid", NULL };
++ ucred_t *ucred = NULL;
++ int pid;
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist,
++ &pid))
++ return (NULL);
++
++ ucred = ucred_get(pid);
++
++ if (ucred == NULL) {
++ PyErr_SetFromErrno(PyExc_OSError);
++ return (NULL);
++ }
++
++ return (pyucred_new(ucred));
++}
++
++static PyObject *
++pyucred_getpeer(PyObject *o, PyObject *args, PyObject *kwargs)
++{
++ static char *kwlist[] = { "fd", NULL };
++ ucred_t *ucred = NULL;
++ int fd;
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist,
++ &fd))
++ return (NULL);
++
++ if (getpeerucred(fd, &ucred) == -1) {
++ PyErr_SetFromErrno(PyExc_OSError);
++ return (NULL);
++ }
++
++ return (pyucred_new(ucred));
++}
++
++PyDoc_STRVAR(pyucred_get_doc,
++ "get(pid) -> ucred\n"
++ "\n"
++ "Return the credentials of the specified process ID. "
++ "Raises OSError. See ucred_get(3C).");
++PyDoc_STRVAR(pyucred_getpeer_doc,
++ "getpeer(fd) -> ucred\n"
++ "\n"
++ "Return the credentials of the peer endpoint of a "
++ "connection-oriented socket (SOCK_STREAM) or STREAM fd "
++ "at the time the endpoint was created or the connection "
++ "was established. Raises OSError. See getpeerucred(3C).");
++
++static struct PyMethodDef pyucred_module_methods[] = {
++ { "get", (PyCFunction) pyucred_get,
++ METH_VARARGS|METH_KEYWORDS, pyucred_get_doc },
++ { "getpeer", (PyCFunction) pyucred_getpeer,
++ METH_VARARGS|METH_KEYWORDS, pyucred_getpeer_doc },
++ { NULL, NULL, 0, NULL }
++};
++
++PyDoc_STRVAR(pyucred_module_doc,
++ "This module provides an interface to the user credential access "
++ "methods, obtainable either by process ID or file descriptor.");
++
++PyMODINIT_FUNC
++initucred(void)
++{
++ PyObject *m;
++
++ m = Py_InitModule3("ucred", pyucred_module_methods,
++ pyucred_module_doc);
++
++ pyucred_type.tp_new = PyType_GenericNew;
++ if (PyType_Ready(&pyucred_type) < 0)
++ return;
++
++ Py_INCREF(&pyucred_type);
++
++ PyModule_AddObject(m, "ucred", (PyObject *)&pyucred_type);
++}
+diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
+--- Python-2.6.4/setup.py
++++ Python-2.6.4/setup.py
+@@ -1277,6 +1277,13 @@
+ else:
+ missing.append('dl')
+
++ # ucred module (Solaris)
++ ucred_inc = find_file('ucred.h', [], inc_dirs)
++ tsol_inc = find_file('tsol/label.h', [], inc_dirs)
++ if ucred_inc is not None and tsol_inc is not None:
++ exts.append( Extension('ucred', ['ucred.c'],
++ libraries = ['tsol']) )
++
+ # Thomas Heller's _ctypes module
+ self.detect_ctypes(inc_dirs, lib_dirs)
+
+diff --git Python-2.6.4/setup.py.orig Python-2.6.4/setup.py.orig
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/setup.py.orig
+@@ -0,0 +1,1958 @@
++# Autodetecting setup.py script for building the Python extensions
++#
++
++__version__ = "$Revision: 75282 $"
++
++import sys, os, imp, re, optparse
++from glob import glob
++from platform import machine as platform_machine
++
++from distutils import log
++from distutils import sysconfig
++from distutils import text_file
++from distutils.errors import *
++from distutils.core import Extension, setup
++from distutils.command.build_ext import build_ext
++from distutils.command.install import install
++from distutils.command.install_lib import install_lib
++
++# This global variable is used to hold the list of modules to be disabled.
++disabled_module_list = []
++
++def add_dir_to_list(dirlist, dir):
++ """Add the directory 'dir' to the list 'dirlist' (at the front) if
++ 1) 'dir' is not already in 'dirlist'
++ 2) 'dir' actually exists, and is a directory."""
++ if dir is not None and os.path.isdir(dir) and dir not in dirlist:
++ dirlist.insert(0, dir)
++
++def find_file(filename, std_dirs, paths):
++ """Searches for the directory where a given file is located,
++ and returns a possibly-empty list of additional directories, or None
++ if the file couldn't be found at all.
++
++ 'filename' is the name of a file, such as readline.h or libcrypto.a.
++ 'std_dirs' is the list of standard system directories; if the
++ file is found in one of them, no additional directives are needed.
++ 'paths' is a list of additional locations to check; if the file is
++ found in one of them, the resulting list will contain the directory.
++ """
++
++ # Check the standard locations
++ for dir in std_dirs:
++ f = os.path.join(dir, filename)
++ if os.path.exists(f): return []
++
++ # Check the additional directories
++ for dir in paths:
++ f = os.path.join(dir, filename)
++ if os.path.exists(f):
++ return [dir]
++
++ # Not found anywhere
++ return None
++
++def find_library_file(compiler, libname, std_dirs, paths):
++ result = compiler.find_library_file(std_dirs + paths, libname)
++ if result is None:
++ return None
++
++ # Check whether the found file is in one of the standard directories
++ dirname = os.path.dirname(result)
++ for p in std_dirs:
++ # Ensure path doesn't end with path separator
++ p = p.rstrip(os.sep)
++ if p == dirname:
++ return [ ]
++
++ # Otherwise, it must have been in one of the additional directories,
++ # so we have to figure out which one.
++ for p in paths:
++ # Ensure path doesn't end with path separator
++ p = p.rstrip(os.sep)
++ if p == dirname:
++ return [p]
++ else:
++ assert False, "Internal error: Path not found in std_dirs or paths"
++
++def module_enabled(extlist, modname):
++ """Returns whether the module 'modname' is present in the list
++ of extensions 'extlist'."""
++ extlist = [ext for ext in extlist if ext.name == modname]
++ return len(extlist)
++
++def find_module_file(module, dirlist):
++ """Find a module in a set of possible folders. If it is not found
++ return the unadorned filename"""
++ list = find_file(module, [], dirlist)
++ if not list:
++ return module
++ if len(list) > 1:
++ log.info("WARNING: multiple copies of %s found"%module)
++ return os.path.join(list[0], module)
++
++class PyBuildExt(build_ext):
++
++ def __init__(self, dist):
++ build_ext.__init__(self, dist)
++ self.failed = []
++
++ def build_extensions(self):
++
++ # Detect which modules should be compiled
++ missing = self.detect_modules()
++
++ # Remove modules that are present on the disabled list
++ extensions = [ext for ext in self.extensions
++ if ext.name not in disabled_module_list]
++ # move ctypes to the end, it depends on other modules
++ ext_map = dict((ext.name, i) for i, ext in enumerate(extensions))
++ if "_ctypes" in ext_map:
++ ctypes = extensions.pop(ext_map["_ctypes"])
++ extensions.append(ctypes)
++ self.extensions = extensions
++
++ # Fix up the autodetected modules, prefixing all the source files
++ # with Modules/ and adding Python's include directory to the path.
++ (srcdir,) = sysconfig.get_config_vars('srcdir')
++ if not srcdir:
++ # Maybe running on Windows but not using CYGWIN?
++ raise ValueError("No source directory; cannot proceed.")
++
++ # Figure out the location of the source code for extension modules
++ # (This logic is copied in distutils.test.test_sysconfig,
++ # so building in a separate directory does not break test_distutils.)
++ moddir = os.path.join(os.getcwd(), srcdir, 'Modules')
++ moddir = os.path.normpath(moddir)
++ srcdir, tail = os.path.split(moddir)
++ srcdir = os.path.normpath(srcdir)
++ moddir = os.path.normpath(moddir)
++
++ moddirlist = [moddir]
++ incdirlist = ['./Include']
++
++ # Platform-dependent module source and include directories
++ platform = self.get_platform()
++ if platform in ('darwin', 'mac') and ("--disable-toolbox-glue" not in
++ sysconfig.get_config_var("CONFIG_ARGS")):
++ # Mac OS X also includes some mac-specific modules
++ macmoddir = os.path.join(os.getcwd(), srcdir, 'Mac/Modules')
++ moddirlist.append(macmoddir)
++ incdirlist.append('./Mac/Include')
++
++ alldirlist = moddirlist + incdirlist
++
++ # Fix up the paths for scripts, too
++ self.distribution.scripts = [os.path.join(srcdir, filename)
++ for filename in self.distribution.scripts]
++
++ # Python header files
++ headers = glob("Include/*.h") + ["pyconfig.h"]
++
++ for ext in self.extensions[:]:
++ ext.sources = [ find_module_file(filename, moddirlist)
++ for filename in ext.sources ]
++ if ext.depends is not None:
++ ext.depends = [find_module_file(filename, alldirlist)
++ for filename in ext.depends]
++ else:
++ ext.depends = []
++ # re-compile extensions if a header file has been changed
++ ext.depends.extend(headers)
++
++ ext.include_dirs.append( '.' ) # to get config.h
++ for incdir in incdirlist:
++ ext.include_dirs.append( os.path.join(srcdir, incdir) )
++
++ # If a module has already been built statically,
++ # don't build it here
++ if ext.name in sys.builtin_module_names:
++ self.extensions.remove(ext)
++
++ if platform != 'mac':
++ # Parse Modules/Setup and Modules/Setup.local to figure out which
++ # modules are turned on in the file.
++ remove_modules = []
++ for filename in ('Modules/Setup', 'Modules/Setup.local'):
++ input = text_file.TextFile(filename, join_lines=1)
++ while 1:
++ line = input.readline()
++ if not line: break
++ line = line.split()
++ remove_modules.append(line[0])
++ input.close()
++
++ for ext in self.extensions[:]:
++ if ext.name in remove_modules:
++ self.extensions.remove(ext)
++
++ # When you run "make CC=altcc" or something similar, you really want
++ # those environment variables passed into the setup.py phase. Here's
++ # a small set of useful ones.
++ compiler = os.environ.get('CC')
++ args = {}
++ # unfortunately, distutils doesn't let us provide separate C and C++
++ # compilers
++ if compiler is not None:
++ (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
++ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
++ self.compiler.set_executables(**args)
++
++ build_ext.build_extensions(self)
++
++ longest = max([len(e.name) for e in self.extensions])
++ if self.failed:
++ longest = max(longest, max([len(name) for name in self.failed]))
++
++ def print_three_column(lst):
++ lst.sort(key=str.lower)
++ # guarantee zip() doesn't drop anything
++ while len(lst) % 3:
++ lst.append("")
++ for e, f, g in zip(lst[::3], lst[1::3], lst[2::3]):
++ print "%-*s %-*s %-*s" % (longest, e, longest, f,
++ longest, g)
++
++ if missing:
++ print
++ print "Failed to find the necessary bits to build these modules:"
++ print_three_column(missing)
++ print ("To find the necessary bits, look in setup.py in"
++ " detect_modules() for the module's name.")
++ print
++
++ if self.failed:
++ failed = self.failed[:]
++ print
++ print "Failed to build these modules:"
++ print_three_column(failed)
++ print
++
++ def build_extension(self, ext):
++
++ if ext.name == '_ctypes':
++ if not self.configure_ctypes(ext):
++ return
++
++ try:
++ build_ext.build_extension(self, ext)
++ except (CCompilerError, DistutilsError), why:
++ self.announce('WARNING: building of extension "%s" failed: %s' %
++ (ext.name, sys.exc_info()[1]))
++ self.failed.append(ext.name)
++ return
++ # Workaround for Mac OS X: The Carbon-based modules cannot be
++ # reliably imported into a command-line Python
++ if 'Carbon' in ext.extra_link_args:
++ self.announce(
++ 'WARNING: skipping import check for Carbon-based "%s"' %
++ ext.name)
++ return
++
++ if self.get_platform() == 'darwin' and (
++ sys.maxint > 2**32 and '-arch' in ext.extra_link_args):
++ # Don't bother doing an import check when an extension was
++ # build with an explicit '-arch' flag on OSX. That's currently
++ # only used to build 32-bit only extensions in a 4-way
++ # universal build and loading 32-bit code into a 64-bit
++ # process will fail.
++ self.announce(
++ 'WARNING: skipping import check for "%s"' %
++ ext.name)
++ return
++
++ # Workaround for Cygwin: Cygwin currently has fork issues when many
++ # modules have been imported
++ if self.get_platform() == 'cygwin':
++ self.announce('WARNING: skipping import check for Cygwin-based "%s"'
++ % ext.name)
++ return
++ ext_filename = os.path.join(
++ self.build_lib,
++ self.get_ext_filename(self.get_ext_fullname(ext.name)))
++ try:
++ imp.load_dynamic(ext.name, ext_filename)
++ except ImportError, why:
++ self.failed.append(ext.name)
++ self.announce('*** WARNING: renaming "%s" since importing it'
++ ' failed: %s' % (ext.name, why), level=3)
++ assert not self.inplace
++ basename, tail = os.path.splitext(ext_filename)
++ newname = basename + "_failed" + tail
++ if os.path.exists(newname):
++ os.remove(newname)
++ os.rename(ext_filename, newname)
++
++ # XXX -- This relies on a Vile HACK in
++ # distutils.command.build_ext.build_extension(). The
++ # _built_objects attribute is stored there strictly for
++ # use here.
++ # If there is a failure, _built_objects may not be there,
++ # so catch the AttributeError and move on.
++ try:
++ for filename in self._built_objects:
++ os.remove(filename)
++ except AttributeError:
++ self.announce('unable to remove files (ignored)')
++ except:
++ exc_type, why, tb = sys.exc_info()
++ self.announce('*** WARNING: importing extension "%s" '
++ 'failed with %s: %s' % (ext.name, exc_type, why),
++ level=3)
++ self.failed.append(ext.name)
++
++ def get_platform(self):
++ # Get value of sys.platform
++ for platform in ['cygwin', 'beos', 'darwin', 'atheos', 'osf1']:
++ if sys.platform.startswith(platform):
++ return platform
++ return sys.platform
++
++ def detect_modules(self):
++ if sys.platform != 'sunos5':
++ # Ensure that /usr/local is always used
++ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
++ # Add paths specified in the environment variables LDFLAGS and
++ # CPPFLAGS for header and library files.
++ # We must get the values from the Makefile and not the environment
++ # directly since an inconsistently reproducible issue comes up where
++ # the environment variable is not set even though the value were passed
++ # into configure and stored in the Makefile (issue found on OS X 10.3).
++ for env_var, arg_name, dir_list in (
++ ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
++ ('LDFLAGS', '-L', self.compiler.library_dirs),
++ ('CPPFLAGS', '-I', self.compiler.include_dirs)):
++ env_val = sysconfig.get_config_var(env_var)
++ if env_val:
++ # To prevent optparse from raising an exception about any
++ # options in env_val that it doesn't know about we strip out
++ # all double dashes and any dashes followed by a character
++ # that is not for the option we are dealing with.
++ #
++ # Please note that order of the regex is important! We must
++ # strip out double-dashes first so that we don't end up with
++ # substituting "--Long" to "-Long" and thus lead to "ong" being
++ # used for a library directory.
++ env_val = re.sub(r'(^|\s+)-(-|(?!%s))' % arg_name[1],
++ ' ', env_val)
++ parser = optparse.OptionParser()
++ # Make sure that allowing args interspersed with options is
++ # allowed
++ parser.allow_interspersed_args = True
++ parser.error = lambda msg: None
++ parser.add_option(arg_name, dest="dirs", action="append")
++ options = parser.parse_args(env_val.split())[0]
++ if options.dirs:
++ for directory in reversed(options.dirs):
++ add_dir_to_list(dir_list, directory)
++
++ if os.path.normpath(sys.prefix) != '/usr':
++ add_dir_to_list(self.compiler.library_dirs,
++ sysconfig.get_config_var("LIBDIR"))
++ add_dir_to_list(self.compiler.include_dirs,
++ sysconfig.get_config_var("INCLUDEDIR"))
++
++ try:
++ have_unicode = unicode
++ except NameError:
++ have_unicode = 0
++
++ # lib_dirs and inc_dirs are used to search for files;
++ # if a file is found in one of those directories, it can
++ # be assumed that no additional -I,-L directives are needed.
++ lib_dirs = self.compiler.library_dirs + [
++ '/lib64', '/usr/lib64',
++ '/lib', '/usr/lib',
++ ]
++ inc_dirs = self.compiler.include_dirs + ['/usr/include']
++ exts = []
++ missing = []
++
++ config_h = sysconfig.get_config_h_filename()
++ config_h_vars = sysconfig.parse_config_h(open(config_h))
++
++ platform = self.get_platform()
++ (srcdir,) = sysconfig.get_config_vars('srcdir')
++
++ # Check for AtheOS which has libraries in non-standard locations
++ if platform == 'atheos':
++ lib_dirs += ['/system/libs', '/atheos/autolnk/lib']
++ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep)
++ inc_dirs += ['/system/include', '/atheos/autolnk/include']
++ inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
++
++ # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
++ if platform in ['osf1', 'unixware7', 'openunix8']:
++ lib_dirs += ['/usr/ccs/lib']
++
++ if platform == 'darwin':
++ # This should work on any unixy platform ;-)
++ # If the user has bothered specifying additional -I and -L flags
++ # in OPT and LDFLAGS we might as well use them here.
++ # NOTE: using shlex.split would technically be more correct, but
++ # also gives a bootstrap problem. Let's hope nobody uses directories
++ # with whitespace in the name to store libraries.
++ cflags, ldflags = sysconfig.get_config_vars(
++ 'CFLAGS', 'LDFLAGS')
++ for item in cflags.split():
++ if item.startswith('-I'):
++ inc_dirs.append(item[2:])
++
++ for item in ldflags.split():
++ if item.startswith('-L'):
++ lib_dirs.append(item[2:])
++
++ # Check for MacOS X, which doesn't need libm.a at all
++ math_libs = ['m']
++ if platform in ['darwin', 'beos', 'mac']:
++ math_libs = []
++
++ # XXX Omitted modules: gl, pure, dl, SGI-specific modules
++
++ #
++ # The following modules are all pretty straightforward, and compile
++ # on pretty much any POSIXish platform.
++ #
++
++ # Some modules that are normally always on:
++ exts.append( Extension('_weakref', ['_weakref.c']) )
++
++ # array objects
++ exts.append( Extension('array', ['arraymodule.c']) )
++ # complex math library functions
++ exts.append( Extension('cmath', ['cmathmodule.c'],
++ libraries=math_libs) )
++
++ # math library functions, e.g. sin()
++ exts.append( Extension('math', ['mathmodule.c'],
++ libraries=math_libs) )
++ # fast string operations implemented in C
++ exts.append( Extension('strop', ['stropmodule.c']) )
++ # time operations and variables
++ exts.append( Extension('time', ['timemodule.c'],
++ libraries=math_libs) )
++ exts.append( Extension('datetime', ['datetimemodule.c', 'timemodule.c'],
++ libraries=math_libs) )
++ # fast iterator tools implemented in C
++ exts.append( Extension("itertools", ["itertoolsmodule.c"]) )
++ # code that will be builtins in the future, but conflict with the
++ # current builtins
++ exts.append( Extension('future_builtins', ['future_builtins.c']) )
++ # random number generator implemented in C
++ exts.append( Extension("_random", ["_randommodule.c"]) )
++ # high-performance collections
++ exts.append( Extension("_collections", ["_collectionsmodule.c"]) )
++ # bisect
++ exts.append( Extension("_bisect", ["_bisectmodule.c"]) )
++ # heapq
++ exts.append( Extension("_heapq", ["_heapqmodule.c"]) )
++ # operator.add() and similar goodies
++ exts.append( Extension('operator', ['operator.c']) )
++ # Python 3.0 _fileio module
++ exts.append( Extension("_fileio", ["_fileio.c"]) )
++ # Python 3.0 _bytesio module
++ exts.append( Extension("_bytesio", ["_bytesio.c"]) )
++ # _functools
++ exts.append( Extension("_functools", ["_functoolsmodule.c"]) )
++ # _json speedups
++ exts.append( Extension("_json", ["_json.c"]) )
++ # Python C API test module
++ exts.append( Extension('_testcapi', ['_testcapimodule.c'],
++ depends=['testcapi_long.h']) )
++ # profilers (_lsprof is for cProfile.py)
++ exts.append( Extension('_hotshot', ['_hotshot.c']) )
++ exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) )
++ # static Unicode character database
++ if have_unicode:
++ exts.append( Extension('unicodedata', ['unicodedata.c']) )
++ else:
++ missing.append('unicodedata')
++ # access to ISO C locale support
++ data = open('pyconfig.h').read()
++ m = re.search(r"#s*define\s+WITH_LIBINTL\s+1\s*", data)
++ if m is not None:
++ locale_libs = ['intl']
++ else:
++ locale_libs = []
++ if platform == 'darwin':
++ locale_extra_link_args = ['-framework', 'CoreFoundation']
++ else:
++ locale_extra_link_args = []
++
++
++ exts.append( Extension('_locale', ['_localemodule.c'],
++ libraries=locale_libs,
++ extra_link_args=locale_extra_link_args) )
++
++ # Modules with some UNIX dependencies -- on by default:
++ # (If you have a really backward UNIX, select and socket may not be
++ # supported...)
++
++ # fcntl(2) and ioctl(2)
++ exts.append( Extension('fcntl', ['fcntlmodule.c']) )
++ if platform not in ['mac']:
++ # pwd(3)
++ exts.append( Extension('pwd', ['pwdmodule.c']) )
++ # grp(3)
++ exts.append( Extension('grp', ['grpmodule.c']) )
++ # spwd, shadow passwords
++ if (config_h_vars.get('HAVE_GETSPNAM', False) or
++ config_h_vars.get('HAVE_GETSPENT', False)):
++ exts.append( Extension('spwd', ['spwdmodule.c']) )
++ else:
++ missing.append('spwd')
++ else:
++ missing.extend(['pwd', 'grp', 'spwd'])
++
++ # select(2); not on ancient System V
++ exts.append( Extension('select', ['selectmodule.c']) )
++
++ # Fred Drake's interface to the Python parser
++ exts.append( Extension('parser', ['parsermodule.c']) )
++
++ # cStringIO and cPickle
++ exts.append( Extension('cStringIO', ['cStringIO.c']) )
++ exts.append( Extension('cPickle', ['cPickle.c']) )
++
++ # Memory-mapped files (also works on Win32).
++ if platform not in ['atheos', 'mac']:
++ exts.append( Extension('mmap', ['mmapmodule.c']) )
++ else:
++ missing.append('mmap')
++
++ # Lance Ellinghaus's syslog module
++ if platform not in ['mac']:
++ # syslog daemon interface
++ exts.append( Extension('syslog', ['syslogmodule.c']) )
++ else:
++ missing.append('syslog')
++
++ # George Neville-Neil's timing module:
++ # Deprecated in PEP 4 http://www.python.org/peps/pep-0004.html
++ # http://mail.python.org/pipermail/python-dev/2006-January/060023.html
++ #exts.append( Extension('timing', ['timingmodule.c']) )
++
++ #
++ # Here ends the simple stuff. From here on, modules need certain
++ # libraries, are platform-specific, or present other surprises.
++ #
++
++ # Multimedia modules
++ # These don't work for 64-bit platforms!!!
++ # These represent audio samples or images as strings:
++
++ # Operations on audio samples
++ # According to #993173, this one should actually work fine on
++ # 64-bit platforms.
++ exts.append( Extension('audioop', ['audioop.c']) )
++
++ # Disabled on 64-bit platforms
++ if sys.maxint != 9223372036854775807L:
++ # Operations on images
++ exts.append( Extension('imageop', ['imageop.c']) )
++ else:
++ missing.extend(['imageop'])
++
++ # readline
++ do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
++ if platform == 'darwin': # and os.uname()[2] < '9.':
++ # MacOSX 10.4 has a broken readline. Don't try to build
++ # the readline module unless the user has installed a fixed
++ # readline package
++ # FIXME: The readline emulation on 10.5 is better, but the
++ # readline module doesn't compile out of the box.
++ if find_file('readline/rlconf.h', inc_dirs, []) is None:
++ do_readline = False
++ if do_readline:
++ if sys.platform == 'darwin':
++ # In every directory on the search path search for a dynamic
++ # library and then a static library, instead of first looking
++ # for dynamic libraries on the entiry path.
++ # This way a staticly linked custom readline gets picked up
++ # before the (broken) dynamic library in /usr/lib.
++ readline_extra_link_args = ('-Wl,-search_paths_first',)
++ else:
++ readline_extra_link_args = ()
++
++ readline_libs = ['readline']
++ if self.compiler.find_library_file(lib_dirs,
++ 'ncursesw'):
++ readline_libs.append('ncursesw')
++ elif self.compiler.find_library_file(lib_dirs,
++ 'ncurses'):
++ readline_libs.append('ncurses')
++ elif self.compiler.find_library_file(lib_dirs, 'curses'):
++ readline_libs.append('curses')
++ elif self.compiler.find_library_file(lib_dirs +
++ ['/usr/lib/termcap'],
++ 'termcap'):
++ readline_libs.append('termcap')
++ exts.append( Extension('readline', ['readline.c'],
++ library_dirs=['/usr/lib/termcap'],
++ extra_link_args=readline_extra_link_args,
++ libraries=readline_libs) )
++ else:
++ missing.append('readline')
++
++ if platform not in ['mac']:
++ # crypt module.
++
++ if self.compiler.find_library_file(lib_dirs, 'crypt'):
++ libs = ['crypt']
++ else:
++ libs = []
++ exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
++ else:
++ missing.append('crypt')
++
++ # CSV files
++ exts.append( Extension('_csv', ['_csv.c']) )
++
++ # socket(2)
++ socket_libs = []
++ if self.compiler.find_library_file(lib_dirs,
++ 'socket'):
++ socket_libs.append('socket')
++ if self.compiler.find_library_file(lib_dirs,
++ 'nsl'):
++ socket_libs.append('nsl')
++ if self.compiler.find_library_file(lib_dirs,
++ 'resolv'):
++ socket_libs.append('resolv')
++ exts.append( Extension('_socket', ['socketmodule.c'],
++ depends = ['socketmodule.h'],
++ libraries = socket_libs) )
++ # Detect SSL support for the socket module (via _ssl)
++ search_for_ssl_incs_in = [
++ '/usr/sfw/include',
++ '/usr/contrib/ssl/include/'
++ ]
++ ssl_incs = find_file('openssl/ssl.h', inc_dirs,
++ search_for_ssl_incs_in
++ )
++ if ssl_incs is not None:
++ krb5_h = find_file('krb5.h', inc_dirs,
++ ['/usr/kerberos/include'])
++ if krb5_h:
++ ssl_incs += krb5_h
++ if sys.maxint == 2147483647L:
++ sfw_libdir = '/usr/sfw/lib';
++ else:
++ sfw_libdir = '/usr/sfw/lib/64';
++ ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
++ [sfw_libdir,
++ '/usr/contrib/ssl/lib/'
++ ] )
++
++ if (ssl_incs is not None and
++ ssl_libs is not None):
++ exts.append( Extension('_ssl', ['_ssl.c'],
++ include_dirs = ssl_incs,
++ library_dirs = ssl_libs,
++ runtime_library_dirs = ssl_libs,
++ libraries = ['ssl', 'crypto'],
++ depends = ['socketmodule.h']), )
++ else:
++ missing.append('_ssl')
++
++ # find out which version of OpenSSL we have
++ openssl_ver = 0
++ openssl_ver_re = re.compile(
++ '^\s*#\s*define\s+OPENSSL_VERSION_NUMBER\s+(0x[0-9a-fA-F]+)' )
++ for ssl_inc_dir in inc_dirs + search_for_ssl_incs_in:
++ name = os.path.join(ssl_inc_dir, 'openssl', 'opensslv.h')
++ if os.path.isfile(name):
++ try:
++ incfile = open(name, 'r')
++ for line in incfile:
++ m = openssl_ver_re.match(line)
++ if m:
++ openssl_ver = eval(m.group(1))
++ break
++ except IOError:
++ pass
++
++ # first version found is what we'll use (as the compiler should)
++ if openssl_ver:
++ break
++
++ #print 'openssl_ver = 0x%08x' % openssl_ver
++
++ if (ssl_incs is not None and
++ ssl_libs is not None and
++ openssl_ver >= 0x00907000):
++ # The _hashlib module wraps optimized implementations
++ # of hash functions from the OpenSSL library.
++ exts.append( Extension('_hashlib', ['_hashopenssl.c'],
++ include_dirs = ssl_incs,
++ library_dirs = ssl_libs,
++ libraries = ['ssl', 'crypto']) )
++ # these aren't strictly missing since they are unneeded.
++ #missing.extend(['_sha', '_md5'])
++ else:
++ # The _sha module implements the SHA1 hash algorithm.
++ exts.append( Extension('_sha', ['shamodule.c']) )
++ # The _md5 module implements the RSA Data Security, Inc. MD5
++ # Message-Digest Algorithm, described in RFC 1321. The
++ # necessary files md5.c and md5.h are included here.
++ exts.append( Extension('_md5',
++ sources = ['md5module.c', 'md5.c'],
++ depends = ['md5.h']) )
++ missing.append('_hashlib')
++
++ if (openssl_ver < 0x00908000):
++ # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
++ exts.append( Extension('_sha256', ['sha256module.c']) )
++ exts.append( Extension('_sha512', ['sha512module.c']) )
++
++ # Modules that provide persistent dictionary-like semantics. You will
++ # probably want to arrange for at least one of them to be available on
++ # your machine, though none are defined by default because of library
++ # dependencies. The Python module anydbm.py provides an
++ # implementation independent wrapper for these; dumbdbm.py provides
++ # similar functionality (but slower of course) implemented in Python.
++
++ # Sleepycat^WOracle Berkeley DB interface.
++ # http://www.oracle.com/database/berkeley-db/db/index.html
++ #
++ # This requires the Sleepycat^WOracle DB code. The supported versions
++ # are set below. Visit the URL above to download
++ # a release. Most open source OSes come with one or more
++ # versions of BerkeleyDB already installed.
++
++ max_db_ver = (4, 7)
++ min_db_ver = (3, 3)
++ db_setup_debug = False # verbose debug prints from this script?
++
++ def allow_db_ver(db_ver):
++ """Returns a boolean if the given BerkeleyDB version is acceptable.
++
++ Args:
++ db_ver: A tuple of the version to verify.
++ """
++ if not (min_db_ver <= db_ver <= max_db_ver):
++ return False
++ # Use this function to filter out known bad configurations.
++ if (4, 6) == db_ver[:2]:
++ # BerkeleyDB 4.6.x is not stable on many architectures.
++ arch = platform_machine()
++ if arch not in ('i386', 'i486', 'i586', 'i686',
++ 'x86_64', 'ia64'):
++ return False
++ return True
++
++ def gen_db_minor_ver_nums(major):
++ if major == 4:
++ for x in range(max_db_ver[1]+1):
++ if allow_db_ver((4, x)):
++ yield x
++ elif major == 3:
++ for x in (3,):
++ if allow_db_ver((3, x)):
++ yield x
++ else:
++ raise ValueError("unknown major BerkeleyDB version", major)
++
++ # construct a list of paths to look for the header file in on
++ # top of the normal inc_dirs.
++ db_inc_paths = [
++ '/usr/include/db4',
++ '/usr/local/include/db4',
++ '/opt/sfw/include/db4',
++ '/usr/include/db3',
++ '/usr/local/include/db3',
++ '/opt/sfw/include/db3',
++ # Fink defaults (http://fink.sourceforge.net/)
++ '/sw/include/db4',
++ '/sw/include/db3',
++ ]
++ # 4.x minor number specific paths
++ for x in gen_db_minor_ver_nums(4):
++ db_inc_paths.append('/usr/include/db4%d' % x)
++ db_inc_paths.append('/usr/include/db4.%d' % x)
++ db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x)
++ db_inc_paths.append('/usr/local/include/db4%d' % x)
++ db_inc_paths.append('/pkg/db-4.%d/include' % x)
++ db_inc_paths.append('/opt/db-4.%d/include' % x)
++ # MacPorts default (http://www.macports.org/)
++ db_inc_paths.append('/opt/local/include/db4%d' % x)
++ # 3.x minor number specific paths
++ for x in gen_db_minor_ver_nums(3):
++ db_inc_paths.append('/usr/include/db3%d' % x)
++ db_inc_paths.append('/usr/local/BerkeleyDB.3.%d/include' % x)
++ db_inc_paths.append('/usr/local/include/db3%d' % x)
++ db_inc_paths.append('/pkg/db-3.%d/include' % x)
++ db_inc_paths.append('/opt/db-3.%d/include' % x)
++
++ # Add some common subdirectories for Sleepycat DB to the list,
++ # based on the standard include directories. This way DB3/4 gets
++ # picked up when it is installed in a non-standard prefix and
++ # the user has added that prefix into inc_dirs.
++ std_variants = []
++ for dn in inc_dirs:
++ std_variants.append(os.path.join(dn, 'db3'))
++ std_variants.append(os.path.join(dn, 'db4'))
++ for x in gen_db_minor_ver_nums(4):
++ std_variants.append(os.path.join(dn, "db4%d"%x))
++ std_variants.append(os.path.join(dn, "db4.%d"%x))
++ for x in gen_db_minor_ver_nums(3):
++ std_variants.append(os.path.join(dn, "db3%d"%x))
++ std_variants.append(os.path.join(dn, "db3.%d"%x))
++
++ db_inc_paths = std_variants + db_inc_paths
++ db_inc_paths = [p for p in db_inc_paths if os.path.exists(p)]
++
++ db_ver_inc_map = {}
++
++ class db_found(Exception): pass
++ try:
++ # See whether there is a Sleepycat header in the standard
++ # search path.
++ for d in inc_dirs + db_inc_paths:
++ f = os.path.join(d, "db.h")
++ if db_setup_debug: print "db: looking for db.h in", f
++ if os.path.exists(f):
++ f = open(f).read()
++ m = re.search(r"#define\WDB_VERSION_MAJOR\W(\d+)", f)
++ if m:
++ db_major = int(m.group(1))
++ m = re.search(r"#define\WDB_VERSION_MINOR\W(\d+)", f)
++ db_minor = int(m.group(1))
++ db_ver = (db_major, db_minor)
++
++ # Avoid 4.6 prior to 4.6.21 due to a BerkeleyDB bug
++ if db_ver == (4, 6):
++ m = re.search(r"#define\WDB_VERSION_PATCH\W(\d+)", f)
++ db_patch = int(m.group(1))
++ if db_patch < 21:
++ print "db.h:", db_ver, "patch", db_patch,
++ print "being ignored (4.6.x must be >= 4.6.21)"
++ continue
++
++ if ( (not db_ver_inc_map.has_key(db_ver)) and
++ allow_db_ver(db_ver) ):
++ # save the include directory with the db.h version
++ # (first occurrence only)
++ db_ver_inc_map[db_ver] = d
++ if db_setup_debug:
++ print "db.h: found", db_ver, "in", d
++ else:
++ # we already found a header for this library version
++ if db_setup_debug: print "db.h: ignoring", d
++ else:
++ # ignore this header, it didn't contain a version number
++ if db_setup_debug:
++ print "db.h: no version number version in", d
++
++ db_found_vers = db_ver_inc_map.keys()
++ db_found_vers.sort()
++
++ while db_found_vers:
++ db_ver = db_found_vers.pop()
++ db_incdir = db_ver_inc_map[db_ver]
++
++ # check lib directories parallel to the location of the header
++ db_dirs_to_check = [
++ db_incdir.replace("include", 'lib64'),
++ db_incdir.replace("include", 'lib'),
++ ]
++ db_dirs_to_check = filter(os.path.isdir, db_dirs_to_check)
++
++ # Look for a version specific db-X.Y before an ambiguoius dbX
++ # XXX should we -ever- look for a dbX name? Do any
++ # systems really not name their library by version and
++ # symlink to more general names?
++ for dblib in (('db-%d.%d' % db_ver),
++ ('db%d%d' % db_ver),
++ ('db%d' % db_ver[0])):
++ dblib_file = self.compiler.find_library_file(
++ db_dirs_to_check + lib_dirs, dblib )
++ if dblib_file:
++ dblib_dir = [ os.path.abspath(os.path.dirname(dblib_file)) ]
++ raise db_found
++ else:
++ if db_setup_debug: print "db lib: ", dblib, "not found"
++
++ except db_found:
++ if db_setup_debug:
++ print "bsddb using BerkeleyDB lib:", db_ver, dblib
++ print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir
++ db_incs = [db_incdir]
++ dblibs = [dblib]
++ # We add the runtime_library_dirs argument because the
++ # BerkeleyDB lib we're linking against often isn't in the
++ # system dynamic library search path. This is usually
++ # correct and most trouble free, but may cause problems in
++ # some unusual system configurations (e.g. the directory
++ # is on an NFS server that goes away).
++ exts.append(Extension('_bsddb', ['_bsddb.c'],
++ depends = ['bsddb.h'],
++ library_dirs=dblib_dir,
++ runtime_library_dirs=dblib_dir,
++ include_dirs=db_incs,
++ libraries=dblibs))
++ else:
++ if db_setup_debug: print "db: no appropriate library found"
++ db_incs = None
++ dblibs = []
++ dblib_dir = None
++ missing.append('_bsddb')
++
++ # The sqlite interface
++ sqlite_setup_debug = False # verbose debug prints from this script?
++
++ # We hunt for #define SQLITE_VERSION "n.n.n"
++ # We need to find >= sqlite version 3.0.8
++ sqlite_incdir = sqlite_libdir = None
++ sqlite_inc_paths = [ '/usr/include',
++ '/usr/include/sqlite',
++ '/usr/include/sqlite3',
++ '/usr/local/include',
++ '/usr/local/include/sqlite',
++ '/usr/local/include/sqlite3',
++ ]
++ MIN_SQLITE_VERSION_NUMBER = (3, 0, 8)
++ MIN_SQLITE_VERSION = ".".join([str(x)
++ for x in MIN_SQLITE_VERSION_NUMBER])
++
++ # Scan the default include directories before the SQLite specific
++ # ones. This allows one to override the copy of sqlite on OSX,
++ # where /usr/include contains an old version of sqlite.
++ for d in inc_dirs + sqlite_inc_paths:
++ f = os.path.join(d, "sqlite3.h")
++ if os.path.exists(f):
++ if sqlite_setup_debug: print "sqlite: found %s"%f
++ incf = open(f).read()
++ m = re.search(
++ r'\s*.*#\s*.*define\s.*SQLITE_VERSION\W*"(.*)"', incf)
++ if m:
++ sqlite_version = m.group(1)
++ sqlite_version_tuple = tuple([int(x)
++ for x in sqlite_version.split(".")])
++ if sqlite_version_tuple >= MIN_SQLITE_VERSION_NUMBER:
++ # we win!
++ if sqlite_setup_debug:
++ print "%s/sqlite3.h: version %s"%(d, sqlite_version)
++ sqlite_incdir = d
++ break
++ else:
++ if sqlite_setup_debug:
++ print "%s: version %d is too old, need >= %s"%(d,
++ sqlite_version, MIN_SQLITE_VERSION)
++ elif sqlite_setup_debug:
++ print "sqlite: %s had no SQLITE_VERSION"%(f,)
++
++ if sqlite_incdir:
++ sqlite_dirs_to_check = [
++ os.path.join(sqlite_incdir, '..', 'lib64'),
++ os.path.join(sqlite_incdir, '..', 'lib'),
++ os.path.join(sqlite_incdir, '..', '..', 'lib64'),
++ os.path.join(sqlite_incdir, '..', '..', 'lib'),
++ ]
++ sqlite_libfile = self.compiler.find_library_file(
++ sqlite_dirs_to_check + lib_dirs, 'sqlite3')
++ if sqlite_libfile:
++ sqlite_libdir = [os.path.abspath(os.path.dirname(sqlite_libfile))]
++
++ if sqlite_incdir and sqlite_libdir:
++ sqlite_srcs = ['_sqlite/cache.c',
++ '_sqlite/connection.c',
++ '_sqlite/cursor.c',
++ '_sqlite/microprotocols.c',
++ '_sqlite/module.c',
++ '_sqlite/prepare_protocol.c',
++ '_sqlite/row.c',
++ '_sqlite/statement.c',
++ '_sqlite/util.c', ]
++
++ sqlite_defines = []
++ if sys.platform != "win32":
++ sqlite_defines.append(('MODULE_NAME', '"sqlite3"'))
++ else:
++ sqlite_defines.append(('MODULE_NAME', '\\"sqlite3\\"'))
++
++
++ if sys.platform == 'darwin':
++ # In every directory on the search path search for a dynamic
++ # library and then a static library, instead of first looking
++ # for dynamic libraries on the entiry path.
++ # This way a staticly linked custom sqlite gets picked up
++ # before the dynamic library in /usr/lib.
++ sqlite_extra_link_args = ('-Wl,-search_paths_first',)
++ else:
++ sqlite_extra_link_args = ()
++
++ exts.append(Extension('_sqlite3', sqlite_srcs,
++ define_macros=sqlite_defines,
++ include_dirs=["Modules/_sqlite",
++ sqlite_incdir],
++ library_dirs=sqlite_libdir,
++ runtime_library_dirs=sqlite_libdir,
++ extra_link_args=sqlite_extra_link_args,
++ libraries=["sqlite3",]))
++ else:
++ missing.append('_sqlite3')
++
++ # Look for Berkeley db 1.85. Note that it is built as a different
++ # module name so it can be included even when later versions are
++ # available. A very restrictive search is performed to avoid
++ # accidentally building this module with a later version of the
++ # underlying db library. May BSD-ish Unixes incorporate db 1.85
++ # symbols into libc and place the include file in /usr/include.
++ #
++ # If the better bsddb library can be built (db_incs is defined)
++ # we do not build this one. Otherwise this build will pick up
++ # the more recent berkeleydb's db.h file first in the include path
++ # when attempting to compile and it will fail.
++ f = "/usr/include/db.h"
++ if os.path.exists(f) and not db_incs:
++ data = open(f).read()
++ m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
++ if m is not None:
++ # bingo - old version used hash file format version 2
++ ### XXX this should be fixed to not be platform-dependent
++ ### but I don't have direct access to an osf1 platform and
++ ### seemed to be muffing the search somehow
++ libraries = platform == "osf1" and ['db'] or None
++ if libraries is not None:
++ exts.append(Extension('bsddb185', ['bsddbmodule.c'],
++ libraries=libraries))
++ else:
++ exts.append(Extension('bsddb185', ['bsddbmodule.c']))
++ else:
++ missing.append('bsddb185')
++ else:
++ missing.append('bsddb185')
++
++ # The standard Unix dbm module:
++ if platform not in ['cygwin']:
++ if find_file("ndbm.h", inc_dirs, []) is not None:
++ # Some systems have -lndbm, others don't
++ if self.compiler.find_library_file(lib_dirs, 'ndbm'):
++ ndbm_libs = ['ndbm']
++ else:
++ ndbm_libs = []
++ exts.append( Extension('dbm', ['dbmmodule.c'],
++ define_macros=[('HAVE_NDBM_H',None)],
++ libraries = ndbm_libs ) )
++ elif self.compiler.find_library_file(lib_dirs, 'gdbm'):
++ gdbm_libs = ['gdbm']
++ if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'):
++ gdbm_libs.append('gdbm_compat')
++ if find_file("gdbm/ndbm.h", inc_dirs, []) is not None:
++ exts.append( Extension(
++ 'dbm', ['dbmmodule.c'],
++ define_macros=[('HAVE_GDBM_NDBM_H',None)],
++ libraries = gdbm_libs ) )
++ elif find_file("gdbm-ndbm.h", inc_dirs, []) is not None:
++ exts.append( Extension(
++ 'dbm', ['dbmmodule.c'],
++ define_macros=[('HAVE_GDBM_DASH_NDBM_H',None)],
++ libraries = gdbm_libs ) )
++ else:
++ missing.append('dbm')
++ elif db_incs is not None:
++ exts.append( Extension('dbm', ['dbmmodule.c'],
++ library_dirs=dblib_dir,
++ runtime_library_dirs=dblib_dir,
++ include_dirs=db_incs,
++ define_macros=[('HAVE_BERKDB_H',None),
++ ('DB_DBM_HSEARCH',None)],
++ libraries=dblibs))
++ else:
++ missing.append('dbm')
++
++ # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
++ if (self.compiler.find_library_file(lib_dirs, 'gdbm')):
++ exts.append( Extension('gdbm', ['gdbmmodule.c'],
++ libraries = ['gdbm'] ) )
++ else:
++ missing.append('gdbm')
++
++ # Unix-only modules
++ if platform not in ['mac', 'win32']:
++ # Steen Lumholt's termios module
++ exts.append( Extension('termios', ['termios.c']) )
++ # Jeremy Hylton's rlimit interface
++ if platform not in ['atheos']:
++ exts.append( Extension('resource', ['resource.c']) )
++ else:
++ missing.append('resource')
++
++ # Sun yellow pages. Some systems have the functions in libc.
++ if platform not in ['cygwin', 'atheos', 'qnx6']:
++ if (self.compiler.find_library_file(lib_dirs, 'nsl')):
++ libs = ['nsl']
++ else:
++ libs = []
++ exts.append( Extension('nis', ['nismodule.c'],
++ libraries = libs) )
++ else:
++ missing.append('nis')
++ else:
++ missing.extend(['nis', 'resource', 'termios'])
++
++ # Curses support, requiring the System V version of curses, often
++ # provided by the ncurses library.
++ curses_lib_dirs = []
++ curses_inc_dirs = []
++ if platform == 'sunos5':
++ # look for ncurses in /usr/gnu on Solaris
++ curses_inc_dirs.append('/usr/include/ncurses')
++ curses_lib_dirs.append('/usr/gnu/lib')
++ curses_lib_dirs.append('/usr/gnu/lib/amd64')
++ curses_lib_dirs.append('/usr/gnu/lib/sparcv9')
++ panel_library = 'panel'
++ if (self.compiler.find_library_file(lib_dirs, 'ncursesw')):
++ curses_libs = ['ncursesw']
++ # Bug 1464056: If _curses.so links with ncursesw,
++ # _curses_panel.so must link with panelw.
++ panel_library = 'panelw'
++ exts.append( Extension('_curses', ['_cursesmodule.c'],
++ libraries = curses_libs) )
++ elif (self.compiler.find_library_file(lib_dirs + curses_lib_dirs, 'ncurses')):
++ curses_libs = ['ncurses']
++ exts.append( Extension('_curses', ['_cursesmodule.c'],
++ libraries = curses_libs,
++ library_dirs = curses_lib_dirs,
++ runtime_library_dirs = curses_lib_dirs,
++ include_dirs = curses_inc_dirs ) )
++ elif (self.compiler.find_library_file(lib_dirs, 'curses')
++ and platform != 'darwin'):
++ # OSX has an old Berkeley curses, not good enough for
++ # the _curses module.
++ if (self.compiler.find_library_file(lib_dirs, 'terminfo')):
++ curses_libs = ['curses', 'terminfo']
++ elif (self.compiler.find_library_file(lib_dirs, 'termcap')):
++ curses_libs = ['curses', 'termcap']
++ else:
++ curses_libs = ['curses']
++
++ exts.append( Extension('_curses', ['_cursesmodule.c'],
++ libraries = curses_libs) )
++ else:
++ missing.append('_curses')
++
++ # If the curses module is enabled, check for the panel module
++ if (module_enabled(exts, '_curses') and
++ self.compiler.find_library_file(lib_dirs + curses_lib_dirs, panel_library)):
++ exts.append( Extension('_curses_panel', ['_curses_panel.c'],
++ libraries = [panel_library] + curses_libs,
++ include_dirs = curses_inc_dirs,
++ library_dirs = curses_lib_dirs,
++ runtime_library_dirs = curses_lib_dirs ) )
++ else:
++ missing.append('_curses_panel')
++
++ # Andrew Kuchling's zlib module. Note that some versions of zlib
++ # 1.1.3 have security problems. See CERT Advisory CA-2002-07:
++ # http://www.cert.org/advisories/CA-2002-07.html
++ #
++ # zlib 1.1.4 is fixed, but at least one vendor (RedHat) has decided to
++ # patch its zlib 1.1.3 package instead of upgrading to 1.1.4. For
++ # now, we still accept 1.1.3, because we think it's difficult to
++ # exploit this in Python, and we'd rather make it RedHat's problem
++ # than our problem <wink>.
++ #
++ # You can upgrade zlib to version 1.1.4 yourself by going to
++ # http://www.gzip.org/zlib/
++ zlib_inc = find_file('zlib.h', [], inc_dirs)
++ have_zlib = False
++ if zlib_inc is not None:
++ zlib_h = zlib_inc[0] + '/zlib.h'
++ version = '"0.0.0"'
++ version_req = '"1.1.3"'
++ fp = open(zlib_h)
++ while 1:
++ line = fp.readline()
++ if not line:
++ break
++ if line.startswith('#define ZLIB_VERSION'):
++ version = line.split()[2]
++ break
++ if version >= version_req:
++ if (self.compiler.find_library_file(lib_dirs, 'z')):
++ if sys.platform == "darwin":
++ zlib_extra_link_args = ('-Wl,-search_paths_first',)
++ else:
++ zlib_extra_link_args = ()
++ exts.append( Extension('zlib', ['zlibmodule.c'],
++ libraries = ['z'],
++ extra_link_args = zlib_extra_link_args))
++ have_zlib = True
++ else:
++ missing.append('zlib')
++ else:
++ missing.append('zlib')
++ else:
++ missing.append('zlib')
++
++ # Helper module for various ascii-encoders. Uses zlib for an optimized
++ # crc32 if we have it. Otherwise binascii uses its own.
++ if have_zlib:
++ extra_compile_args = ['-DUSE_ZLIB_CRC32']
++ libraries = ['z']
++ extra_link_args = zlib_extra_link_args
++ else:
++ extra_compile_args = []
++ libraries = []
++ extra_link_args = []
++ exts.append( Extension('binascii', ['binascii.c'],
++ extra_compile_args = extra_compile_args,
++ libraries = libraries,
++ extra_link_args = extra_link_args) )
++
++ # Gustavo Niemeyer's bz2 module.
++ if (self.compiler.find_library_file(lib_dirs, 'bz2')):
++ if sys.platform == "darwin":
++ bz2_extra_link_args = ('-Wl,-search_paths_first',)
++ else:
++ bz2_extra_link_args = ()
++ exts.append( Extension('bz2', ['bz2module.c'],
++ libraries = ['bz2'],
++ extra_link_args = bz2_extra_link_args) )
++ else:
++ missing.append('bz2')
++
++ # Interface to the Expat XML parser
++ #
++ # Expat was written by James Clark and is now maintained by a
++ # group of developers on SourceForge; see www.libexpat.org for
++ # more information. The pyexpat module was written by Paul
++ # Prescod after a prototype by Jack Jansen. The Expat source
++ # is included in Modules/expat/. Usage of a system
++ # shared libexpat.so/expat.dll is not advised.
++ #
++ # More information on Expat can be found at www.libexpat.org.
++ #
++ expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')
++ define_macros = [
++ ('HAVE_EXPAT_CONFIG_H', '1'),
++ ]
++
++ exts.append(Extension('pyexpat',
++ define_macros = define_macros,
++ include_dirs = [expatinc],
++ sources = ['pyexpat.c',
++ 'expat/xmlparse.c',
++ 'expat/xmlrole.c',
++ 'expat/xmltok.c',
++ ],
++ ))
++
++ # Fredrik Lundh's cElementTree module. Note that this also
++ # uses expat (via the CAPI hook in pyexpat).
++
++ if os.path.isfile(os.path.join(srcdir, 'Modules', '_elementtree.c')):
++ define_macros.append(('USE_PYEXPAT_CAPI', None))
++ exts.append(Extension('_elementtree',
++ define_macros = define_macros,
++ include_dirs = [expatinc],
++ sources = ['_elementtree.c'],
++ ))
++ else:
++ missing.append('_elementtree')
++
++ # Hye-Shik Chang's CJKCodecs modules.
++ if have_unicode:
++ exts.append(Extension('_multibytecodec',
++ ['cjkcodecs/multibytecodec.c']))
++ for loc in ('kr', 'jp', 'cn', 'tw', 'hk', 'iso2022'):
++ exts.append(Extension('_codecs_%s' % loc,
++ ['cjkcodecs/_codecs_%s.c' % loc]))
++ else:
++ missing.append('_multibytecodec')
++ for loc in ('kr', 'jp', 'cn', 'tw', 'hk', 'iso2022'):
++ missing.append('_codecs_%s' % loc)
++
++ # Dynamic loading module
++ if sys.maxint == 0x7fffffff:
++ # This requires sizeof(int) == sizeof(long) == sizeof(char*)
++ dl_inc = find_file('dlfcn.h', [], inc_dirs)
++ if (dl_inc is not None) and (platform not in ['atheos']):
++ exts.append( Extension('dl', ['dlmodule.c']) )
++ else:
++ missing.append('dl')
++ else:
++ missing.append('dl')
++
++ # Thomas Heller's _ctypes module
++ self.detect_ctypes(inc_dirs, lib_dirs)
++
++ # Richard Oudkerk's multiprocessing module
++ if platform == 'win32': # Windows
++ macros = dict()
++ libraries = ['ws2_32']
++
++ elif platform == 'darwin': # Mac OSX
++ macros = dict(
++ HAVE_SEM_OPEN=1,
++ HAVE_SEM_TIMEDWAIT=0,
++ HAVE_FD_TRANSFER=1,
++ HAVE_BROKEN_SEM_GETVALUE=1
++ )
++ libraries = []
++
++ elif platform == 'cygwin': # Cygwin
++ macros = dict(
++ HAVE_SEM_OPEN=1,
++ HAVE_SEM_TIMEDWAIT=1,
++ HAVE_FD_TRANSFER=0,
++ HAVE_BROKEN_SEM_UNLINK=1
++ )
++ libraries = []
++
++ elif platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):
++ # FreeBSD's P1003.1b semaphore support is very experimental
++ # and has many known problems. (as of June 2008)
++ macros = dict( # FreeBSD
++ HAVE_SEM_OPEN=0,
++ HAVE_SEM_TIMEDWAIT=0,
++ HAVE_FD_TRANSFER=1,
++ )
++ libraries = []
++
++ elif platform.startswith('openbsd'):
++ macros = dict( # OpenBSD
++ HAVE_SEM_OPEN=0, # Not implemented
++ HAVE_SEM_TIMEDWAIT=0,
++ HAVE_FD_TRANSFER=1,
++ )
++ libraries = []
++
++ elif platform.startswith('netbsd'):
++ macros = dict( # at least NetBSD 5
++ HAVE_SEM_OPEN=1,
++ HAVE_SEM_TIMEDWAIT=0,
++ HAVE_FD_TRANSFER=1,
++ HAVE_BROKEN_SEM_GETVALUE=1
++ )
++ libraries = []
++
++ else: # Linux and other unices
++ macros = dict(
++ HAVE_SEM_OPEN=1,
++ HAVE_SEM_TIMEDWAIT=1,
++ HAVE_FD_TRANSFER=1
++ )
++ libraries = ['rt']
++
++ if platform == 'win32':
++ multiprocessing_srcs = [ '_multiprocessing/multiprocessing.c',
++ '_multiprocessing/semaphore.c',
++ '_multiprocessing/pipe_connection.c',
++ '_multiprocessing/socket_connection.c',
++ '_multiprocessing/win32_functions.c'
++ ]
++
++ else:
++ multiprocessing_srcs = [ '_multiprocessing/multiprocessing.c',
++ '_multiprocessing/socket_connection.c'
++ ]
++
++ if macros.get('HAVE_SEM_OPEN', False):
++ multiprocessing_srcs.append('_multiprocessing/semaphore.c')
++
++ multiproc_libs = []
++ if platform == 'sunos5':
++ multiproc_libs = [ "xnet" ]
++
++ exts.append ( Extension('_multiprocessing', multiprocessing_srcs,
++ define_macros=macros.items(),
++ libraries=multiproc_libs,
++ include_dirs=["Modules/_multiprocessing"]))
++ # End multiprocessing
++
++
++ # Platform-specific libraries
++ if platform == 'linux2':
++ # Linux-specific modules
++ exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
++ else:
++ missing.append('linuxaudiodev')
++
++ if platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
++ 'freebsd7', 'freebsd8'):
++ exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
++ else:
++ missing.append('ossaudiodev')
++
++ if platform == 'sunos5':
++ # SunOS specific modules
++ exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
++ else:
++ missing.append('sunaudiodev')
++
++ if platform == 'darwin':
++ # _scproxy
++ exts.append(Extension("_scproxy", [os.path.join(srcdir, "Mac/Modules/_scproxy.c")],
++ extra_link_args= [
++ '-framework', 'SystemConfiguration',
++ '-framework', 'CoreFoundation'
++ ]))
++
++
++ if platform == 'darwin' and ("--disable-toolbox-glue" not in
++ sysconfig.get_config_var("CONFIG_ARGS")):
++
++ if os.uname()[2] > '8.':
++ # We're on Mac OS X 10.4 or later, the compiler should
++ # support '-Wno-deprecated-declarations'. This will
++ # surpress deprecation warnings for the Carbon extensions,
++ # these extensions wrap the Carbon APIs and even those
++ # parts that are deprecated.
++ carbon_extra_compile_args = ['-Wno-deprecated-declarations']
++ else:
++ carbon_extra_compile_args = []
++
++ # Mac OS X specific modules.
++ def macSrcExists(name1, name2=''):
++ if not name1:
++ return None
++ names = (name1,)
++ if name2:
++ names = (name1, name2)
++ path = os.path.join(srcdir, 'Mac', 'Modules', *names)
++ return os.path.exists(path)
++
++ def addMacExtension(name, kwds, extra_srcs=[]):
++ dirname = ''
++ if name[0] == '_':
++ dirname = name[1:].lower()
++ cname = name + '.c'
++ cmodulename = name + 'module.c'
++ # Check for NNN.c, NNNmodule.c, _nnn/NNN.c, _nnn/NNNmodule.c
++ if macSrcExists(cname):
++ srcs = [cname]
++ elif macSrcExists(cmodulename):
++ srcs = [cmodulename]
++ elif macSrcExists(dirname, cname):
++ # XXX(nnorwitz): If all the names ended with module, we
++ # wouldn't need this condition. ibcarbon is the only one.
++ srcs = [os.path.join(dirname, cname)]
++ elif macSrcExists(dirname, cmodulename):
++ srcs = [os.path.join(dirname, cmodulename)]
++ else:
++ raise RuntimeError("%s not found" % name)
++
++ # Here's the whole point: add the extension with sources
++ exts.append(Extension(name, srcs + extra_srcs, **kwds))
++
++ # Core Foundation
++ core_kwds = {'extra_compile_args': carbon_extra_compile_args,
++ 'extra_link_args': ['-framework', 'CoreFoundation'],
++ }
++ addMacExtension('_CF', core_kwds, ['cf/pycfbridge.c'])
++ addMacExtension('autoGIL', core_kwds)
++
++
++
++ # Carbon
++ carbon_kwds = {'extra_compile_args': carbon_extra_compile_args,
++ 'extra_link_args': ['-framework', 'Carbon'],
++ }
++ CARBON_EXTS = ['ColorPicker', 'gestalt', 'MacOS', 'Nav',
++ 'OSATerminology', 'icglue',
++ # All these are in subdirs
++ '_AE', '_AH', '_App', '_CarbonEvt', '_Cm', '_Ctl',
++ '_Dlg', '_Drag', '_Evt', '_File', '_Folder', '_Fm',
++ '_Help', '_Icn', '_IBCarbon', '_List',
++ '_Menu', '_Mlte', '_OSA', '_Res', '_Qd', '_Qdoffs',
++ '_Scrap', '_Snd', '_TE',
++ ]
++ for name in CARBON_EXTS:
++ addMacExtension(name, carbon_kwds)
++
++ # Workaround for a bug in the version of gcc shipped with Xcode 3.
++ # The _Win extension should build just like the other Carbon extensions, but
++ # this actually results in a hard crash of the linker.
++ #
++ if '-arch ppc64' in cflags and '-arch ppc' in cflags:
++ win_kwds = {'extra_compile_args': carbon_extra_compile_args + ['-arch', 'i386', '-arch', 'ppc'],
++ 'extra_link_args': ['-framework', 'Carbon', '-arch', 'i386', '-arch', 'ppc'],
++ }
++ addMacExtension('_Win', win_kwds)
++ else:
++ addMacExtension('_Win', carbon_kwds)
++
++
++ # Application Services & QuickTime
++ app_kwds = {'extra_compile_args': carbon_extra_compile_args,
++ 'extra_link_args': ['-framework','ApplicationServices'],
++ }
++ addMacExtension('_Launch', app_kwds)
++ addMacExtension('_CG', app_kwds)
++
++ exts.append( Extension('_Qt', ['qt/_Qtmodule.c'],
++ extra_compile_args=carbon_extra_compile_args,
++ extra_link_args=['-framework', 'QuickTime',
++ '-framework', 'Carbon']) )
++
++
++ self.extensions.extend(exts)
++
++ # Call the method for detecting whether _tkinter can be compiled
++ self.detect_tkinter(inc_dirs, lib_dirs)
++
++ if '_tkinter' not in [e.name for e in self.extensions]:
++ missing.append('_tkinter')
++
++ return missing
++
++ def detect_tkinter_darwin(self, inc_dirs, lib_dirs):
++ # The _tkinter module, using frameworks. Since frameworks are quite
++ # different the UNIX search logic is not sharable.
++ from os.path import join, exists
++ framework_dirs = [
++ '/Library/Frameworks',
++ '/System/Library/Frameworks/',
++ join(os.getenv('HOME'), '/Library/Frameworks')
++ ]
++
++ # Find the directory that contains the Tcl.framework and Tk.framework
++ # bundles.
++ # XXX distutils should support -F!
++ for F in framework_dirs:
++ # both Tcl.framework and Tk.framework should be present
++ for fw in 'Tcl', 'Tk':
++ if not exists(join(F, fw + '.framework')):
++ break
++ else:
++ # ok, F is now directory with both frameworks. Continure
++ # building
++ break
++ else:
++ # Tk and Tcl frameworks not found. Normal "unix" tkinter search
++ # will now resume.
++ return 0
++
++ # For 8.4a2, we must add -I options that point inside the Tcl and Tk
++ # frameworks. In later release we should hopefully be able to pass
++ # the -F option to gcc, which specifies a framework lookup path.
++ #
++ include_dirs = [
++ join(F, fw + '.framework', H)
++ for fw in 'Tcl', 'Tk'
++ for H in 'Headers', 'Versions/Current/PrivateHeaders'
++ ]
++
++ # For 8.4a2, the X11 headers are not included. Rather than include a
++ # complicated search, this is a hard-coded path. It could bail out
++ # if X11 libs are not found...
++ include_dirs.append('/usr/X11R6/include')
++ frameworks = ['-framework', 'Tcl', '-framework', 'Tk']
++
++ # All existing framework builds of Tcl/Tk don't support 64-bit
++ # architectures.
++ cflags = sysconfig.get_config_vars('CFLAGS')[0]
++ archs = re.findall('-arch\s+(\w+)', cflags)
++ fp = os.popen("file %s/Tk.framework/Tk | grep 'for architecture'"%(F,))
++ detected_archs = []
++ for ln in fp:
++ a = ln.split()[-1]
++ if a in archs:
++ detected_archs.append(ln.split()[-1])
++ fp.close()
++
++ for a in detected_archs:
++ frameworks.append('-arch')
++ frameworks.append(a)
++
++ ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
++ define_macros=[('WITH_APPINIT', 1)],
++ include_dirs = include_dirs,
++ libraries = [],
++ extra_compile_args = frameworks[2:],
++ extra_link_args = frameworks,
++ )
++ self.extensions.append(ext)
++ return 1
++
++
++ def detect_tkinter(self, inc_dirs, lib_dirs):
++ # The _tkinter module.
++
++ # Rather than complicate the code below, detecting and building
++ # AquaTk is a separate method. Only one Tkinter will be built on
++ # Darwin - either AquaTk, if it is found, or X11 based Tk.
++ platform = self.get_platform()
++ if (platform == 'darwin' and
++ self.detect_tkinter_darwin(inc_dirs, lib_dirs)):
++ return
++
++ # Assume we haven't found any of the libraries or include files
++ # The versions with dots are used on Unix, and the versions without
++ # dots on Windows, for detection by cygwin.
++ added_lib_dirs = []
++ tcl_tk_lib_dirs = ['/usr/sfw/lib']
++ tcl_tk_inc_dirs = ['/usr/sfw/include']
++ tcllib = tklib = tcl_includes = tk_includes = None
++ for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
++ '82', '8.1', '81', '8.0', '80']:
++ tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version, tcl_tk_lib_dirs)
++ tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version, tcl_tk_lib_dirs)
++ if tklib and tcllib:
++ # Exit the loop when we've found the Tcl/Tk libraries
++ break
++
++ tklib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tk' + version)
++ tcllib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tcl' + version)
++ if tklib and tcllib:
++ # found the libs in a non-standard dir
++ added_lib_dirs.append(os.path.dirname(tcllib))
++ # Exit the loop when we've found the Tcl/Tk libraries
++ break
++
++ # Now check for the header files
++ if tklib and tcllib:
++ # Check for the include files on Debian and {Free,Open}BSD, where
++ # they're put in /usr/include/{tcl,tk}X.Y
++ dotversion = version
++ if '.' not in dotversion and "bsd" in sys.platform.lower():
++ # OpenBSD and FreeBSD use Tcl/Tk library names like libtcl83.a,
++ # but the include subdirs are named like .../include/tcl8.3.
++ dotversion = dotversion[:-1] + '.' + dotversion[-1]
++ tcl_include_sub = []
++ tk_include_sub = []
++ for dir in inc_dirs:
++ tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
++ tk_include_sub += [dir + os.sep + "tk" + dotversion]
++ tcl_include_sub += tcl_tk_inc_dirs
++ tk_include_sub += tcl_include_sub
++ tcl_includes = find_file('tcl.h', inc_dirs, tcl_include_sub)
++ tk_includes = find_file('tk.h', inc_dirs, tk_include_sub)
++
++ if (tcllib is None or tklib is None or
++ tcl_includes is None or tk_includes is None):
++ self.announce("INFO: Can't locate Tcl/Tk libs and/or headers", 2)
++ return
++
++ # OK... everything seems to be present for Tcl/Tk.
++
++ include_dirs = [] ; libs = [] ; defs = [] ; added_lib_dirs = []
++ for dir in tcl_includes + tk_includes:
++ if dir not in include_dirs:
++ include_dirs.append(dir)
++
++ # Check for various platform-specific directories
++ if platform == 'sunos5':
++ include_dirs.append('/usr/openwin/include')
++ added_lib_dirs.append('/usr/openwin/lib')
++ elif os.path.exists('/usr/X11R6/include'):
++ include_dirs.append('/usr/X11R6/include')
++ added_lib_dirs.append('/usr/X11R6/lib64')
++ added_lib_dirs.append('/usr/X11R6/lib')
++ elif os.path.exists('/usr/X11R5/include'):
++ include_dirs.append('/usr/X11R5/include')
++ added_lib_dirs.append('/usr/X11R5/lib')
++ else:
++ # Assume default location for X11
++ include_dirs.append('/usr/X11/include')
++ added_lib_dirs.append('/usr/X11/lib')
++
++ # If Cygwin, then verify that X is installed before proceeding
++ if platform == 'cygwin':
++ x11_inc = find_file('X11/Xlib.h', [], include_dirs)
++ if x11_inc is None:
++ return
++
++ # Check for BLT extension
++ if self.compiler.find_library_file(lib_dirs + added_lib_dirs,
++ 'BLT8.0'):
++ defs.append( ('WITH_BLT', 1) )
++ libs.append('BLT8.0')
++ elif self.compiler.find_library_file(lib_dirs + added_lib_dirs,
++ 'BLT'):
++ defs.append( ('WITH_BLT', 1) )
++ libs.append('BLT')
++
++ # Add the Tcl/Tk libraries
++ libs.append('tk'+ version)
++ libs.append('tcl'+ version)
++
++ if platform in ['aix3', 'aix4']:
++ libs.append('ld')
++
++ # Finally, link with the X11 libraries (not appropriate on cygwin)
++ if platform != "cygwin":
++ libs.append('X11')
++
++ ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
++ define_macros=[('WITH_APPINIT', 1)] + defs,
++ include_dirs = include_dirs,
++ libraries = libs,
++ library_dirs = added_lib_dirs,
++ runtime_library_dirs = added_lib_dirs
++ )
++ self.extensions.append(ext)
++
++## # Uncomment these lines if you want to play with xxmodule.c
++## ext = Extension('xx', ['xxmodule.c'])
++## self.extensions.append(ext)
++
++ # XXX handle these, but how to detect?
++ # *** Uncomment and edit for PIL (TkImaging) extension only:
++ # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \
++ # *** Uncomment and edit for TOGL extension only:
++ # -DWITH_TOGL togl.c \
++ # *** Uncomment these for TOGL extension only:
++ # -lGL -lGLU -lXext -lXmu \
++
++ def configure_ctypes_darwin(self, ext):
++ # Darwin (OS X) uses preconfigured files, in
++ # the Modules/_ctypes/libffi_osx directory.
++ (srcdir,) = sysconfig.get_config_vars('srcdir')
++ ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules',
++ '_ctypes', 'libffi_osx'))
++ sources = [os.path.join(ffi_srcdir, p)
++ for p in ['ffi.c',
++ 'x86/darwin64.S',
++ 'x86/x86-darwin.S',
++ 'x86/x86-ffi_darwin.c',
++ 'x86/x86-ffi64.c',
++ 'powerpc/ppc-darwin.S',
++ 'powerpc/ppc-darwin_closure.S',
++ 'powerpc/ppc-ffi_darwin.c',
++ 'powerpc/ppc64-darwin_closure.S',
++ ]]
++
++ # Add .S (preprocessed assembly) to C compiler source extensions.
++ self.compiler.src_extensions.append('.S')
++
++ include_dirs = [os.path.join(ffi_srcdir, 'include'),
++ os.path.join(ffi_srcdir, 'powerpc')]
++ ext.include_dirs.extend(include_dirs)
++ ext.sources.extend(sources)
++ return True
++
++ def configure_ctypes(self, ext):
++ if not self.use_system_libffi:
++ if sys.platform == 'darwin':
++ return self.configure_ctypes_darwin(ext)
++
++ (srcdir,) = sysconfig.get_config_vars('srcdir')
++ ffi_builddir = os.path.join(self.build_temp, 'libffi')
++ ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules',
++ '_ctypes', 'libffi'))
++ ffi_configfile = os.path.join(ffi_builddir, 'fficonfig.py')
++
++ from distutils.dep_util import newer_group
++
++ config_sources = [os.path.join(ffi_srcdir, fname)
++ for fname in os.listdir(ffi_srcdir)
++ if os.path.isfile(os.path.join(ffi_srcdir, fname))]
++ if self.force or newer_group(config_sources,
++ ffi_configfile):
++ from distutils.dir_util import mkpath
++ mkpath(ffi_builddir)
++ config_args = []
++
++ # Pass empty CFLAGS because we'll just append the resulting
++ # CFLAGS to Python's; -g or -O2 is to be avoided.
++ cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
++ % (ffi_builddir, ffi_srcdir, " ".join(config_args))
++
++ res = os.system(cmd)
++ if res or not os.path.exists(ffi_configfile):
++ print "Failed to configure _ctypes module"
++ return False
++
++ fficonfig = {}
++ execfile(ffi_configfile, globals(), fficonfig)
++ ffi_srcdir = os.path.join(fficonfig['ffi_srcdir'], 'src')
++
++ # Add .S (preprocessed assembly) to C compiler source extensions.
++ self.compiler.src_extensions.append('.S')
++
++ include_dirs = [os.path.join(ffi_builddir, 'include'),
++ ffi_builddir, ffi_srcdir]
++ extra_compile_args = fficonfig['ffi_cflags'].split()
++
++ ext.sources.extend(fficonfig['ffi_sources'])
++ ext.include_dirs.extend(include_dirs)
++ ext.extra_compile_args.extend(extra_compile_args)
++ return True
++
++ def detect_ctypes(self, inc_dirs, lib_dirs):
++ self.use_system_libffi = False
++ include_dirs = []
++ extra_compile_args = []
++ extra_link_args = []
++ sources = ['_ctypes/_ctypes.c',
++ '_ctypes/callbacks.c',
++ '_ctypes/callproc.c',
++ '_ctypes/stgdict.c',
++ '_ctypes/cfield.c',
++ '_ctypes/malloc_closure.c']
++ depends = ['_ctypes/ctypes.h']
++
++ if sys.platform == 'darwin':
++ sources.append('_ctypes/darwin/dlfcn_simple.c')
++ extra_compile_args.append('-DMACOSX')
++ include_dirs.append('_ctypes/darwin')
++# XXX Is this still needed?
++## extra_link_args.extend(['-read_only_relocs', 'warning'])
++
++ elif sys.platform == 'sunos5':
++ # XXX This shouldn't be necessary; it appears that some
++ # of the assembler code is non-PIC (i.e. it has relocations
++ # when it shouldn't. The proper fix would be to rewrite
++ # the assembler code to be PIC.
++ # This only works with GCC; the Sun compiler likely refuses
++ # this option. If you want to compile ctypes with the Sun
++ # compiler, please research a proper solution, instead of
++ # finding some -z option for the Sun compiler.
++ extra_link_args.append('-mimpure-text')
++
++ elif sys.platform.startswith('hp-ux'):
++ extra_link_args.append('-fPIC')
++
++ ext = Extension('_ctypes',
++ include_dirs=include_dirs,
++ extra_compile_args=extra_compile_args,
++ extra_link_args=extra_link_args,
++ libraries=[],
++ sources=sources,
++ depends=depends)
++ ext_test = Extension('_ctypes_test',
++ sources=['_ctypes/_ctypes_test.c'])
++ self.extensions.extend([ext, ext_test])
++
++ if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):
++ return
++
++ if sys.platform == 'darwin':
++ # OS X 10.5 comes with libffi.dylib; the include files are
++ # in /usr/include/ffi
++ inc_dirs.append('/usr/include/ffi')
++
++ ffi_inc = find_file('ffi.h', [], inc_dirs)
++ if ffi_inc is not None:
++ ffi_h = ffi_inc[0] + '/ffi.h'
++ fp = open(ffi_h)
++ while 1:
++ line = fp.readline()
++ if not line:
++ ffi_inc = None
++ break
++ if line.startswith('#define LIBFFI_H'):
++ break
++ ffi_lib = None
++ if ffi_inc is not None:
++ for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'):
++ if (self.compiler.find_library_file(lib_dirs, lib_name)):
++ ffi_lib = lib_name
++ break
++
++ if ffi_inc and ffi_lib:
++ ext.include_dirs.extend(ffi_inc)
++ ext.libraries.append(ffi_lib)
++ self.use_system_libffi = True
++
++
++class PyBuildInstall(install):
++ # Suppress the warning about installation into the lib_dynload
++ # directory, which is not in sys.path when running Python during
++ # installation:
++ def initialize_options (self):
++ install.initialize_options(self)
++ self.warn_dir=0
++
++class PyBuildInstallLib(install_lib):
++ # Do exactly what install_lib does but make sure correct access modes get
++ # set on installed directories and files. All installed files with get
++ # mode 644 unless they are a shared library in which case they will get
++ # mode 755. All installed directories will get mode 755.
++
++ so_ext = sysconfig.get_config_var("SO")
++
++ def install(self):
++ outfiles = install_lib.install(self)
++ self.set_file_modes(outfiles, 0644, 0755)
++ self.set_dir_modes(self.install_dir, 0755)
++ return outfiles
++
++ def set_file_modes(self, files, defaultMode, sharedLibMode):
++ if not self.is_chmod_supported(): return
++ if not files: return
++
++ for filename in files:
++ if os.path.islink(filename): continue
++ mode = defaultMode
++ if filename.endswith(self.so_ext): mode = sharedLibMode
++ log.info("changing mode of %s to %o", filename, mode)
++ if not self.dry_run: os.chmod(filename, mode)
++
++ def set_dir_modes(self, dirname, mode):
++ if not self.is_chmod_supported(): return
++ os.path.walk(dirname, self.set_dir_modes_visitor, mode)
++
++ def set_dir_modes_visitor(self, mode, dirname, names):
++ if os.path.islink(dirname): return
++ log.info("changing mode of %s to %o", dirname, mode)
++ if not self.dry_run: os.chmod(dirname, mode)
++
++ def is_chmod_supported(self):
++ return hasattr(os, 'chmod')
++
++SUMMARY = """
++Python is an interpreted, interactive, object-oriented programming
++language. It is often compared to Tcl, Perl, Scheme or Java.
++
++Python combines remarkable power with very clear syntax. It has
++modules, classes, exceptions, very high level dynamic data types, and
++dynamic typing. There are interfaces to many system calls and
++libraries, as well as to various windowing systems (X11, Motif, Tk,
++Mac, MFC). New built-in modules are easily written in C or C++. Python
++is also usable as an extension language for applications that need a
++programmable interface.
++
++The Python implementation is portable: it runs on many brands of UNIX,
++on Windows, DOS, OS/2, Mac, Amiga... If your favorite system isn't
++listed here, it may still be supported, if there's a C compiler for
++it. Ask around on comp.lang.python -- or just try compiling Python
++yourself.
++"""
++
++CLASSIFIERS = """
++Development Status :: 6 - Mature
++License :: OSI Approved :: Python Software Foundation License
++Natural Language :: English
++Programming Language :: C
++Programming Language :: Python
++Topic :: Software Development
++"""
++
++def main():
++ # turn off warnings when deprecated modules are imported
++ import warnings
++ warnings.filterwarnings("ignore",category=DeprecationWarning)
++ setup(# PyPI Metadata (PEP 301)
++ name = "Python",
++ version = sys.version.split()[0],
++ url = "http://www.python.org/%s" % sys.version[:3],
++ maintainer = "Guido van Rossum and the Python community",
++ maintainer_email = "[email protected]",
++ description = "A high-level object-oriented programming language",
++ long_description = SUMMARY.strip(),
++ license = "PSF license",
++ classifiers = filter(None, CLASSIFIERS.split("\n")),
++ platforms = ["Many"],
++
++ # Build info
++ cmdclass = {'build_ext':PyBuildExt, 'install':PyBuildInstall,
++ 'install_lib':PyBuildInstallLib},
++ # The struct module is defined here, because build_ext won't be
++ # called unless there's at least one extension module defined.
++ ext_modules=[Extension('_struct', ['_struct.c'])],
++
++ # Scripts to install
++ scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
++ 'Tools/scripts/2to3',
++ 'Lib/smtpd.py']
++ )
++
++# --install-platlib
++if __name__ == '__main__':
++ main()
+
+diff --git Python-2.6.4/Lib/test/ucredtext.py Python-2.6.4/Lib/test/ucredtext.py
+new file mode 100644
+--- /dev/null 2011-02-12 03:14:16.000000000 -0600
++++ Python-2.6.4/Lib/test/ucredtest.py 2011-01-20 13:52:42.945657919 -0600
+@@ -0,0 +1,45 @@
++#!/usr/bin/python2.6
++
++import ucred
++import os
++
++uc = ucred.get(os.getpid())
++
++print "pid = %d" % uc.getpid()
++print "euid = %d" % uc.geteuid()
++print "ruid = %d" % uc.getruid()
++print "suid = %d" % uc.getsuid()
++print "egid = %d" % uc.getegid()
++print "rgid = %d" % uc.getrgid()
++print "sgid = %d" % uc.getsgid()
++print "zoneid = %d" % uc.getzoneid()
++print "projid = %d" % uc.getprojid()
++print "groups = %s" % uc.getgroups()
++print "label = %s" % uc.getlabel()
++
++print "getpflags(0x1) = %d" % uc.getpflags(0x1)
++print "getpflags(0x2) = %d" % uc.getpflags(0x2)
++print "has_priv(Effective, proc_fork) = %d" % uc.has_priv("Effective", "proc_fork")
++print "has_priv(Permitted, proc_fork) = %d" % uc.has_priv("Permitted", "proc_fork")
++print "has_priv(Inheritable, proc_fork) = %d" % uc.has_priv("Inheritable", "proc_fork")
++print "has_priv(Limit, file_setid) = %d" % uc.has_priv("Limit", "file_setid")
++print "has_priv(Effective, file_setid) = %d" % uc.has_priv("Effective", "file_setid")
++try:
++ uc.has_priv("Effective", "proc_bork")
++except OSError, e:
++ print e
++try:
++ uc.has_priv("Defective", "proc_fork")
++except OSError, e:
++ print e
++try:
++ uc.has_priv("Defective", "proc_bork")
++except OSError, e:
++ print e
++
++del uc
++uc = ucred.ucred()
++try:
++ uc.getpid()
++except OSError, e:
++ print e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-10-gethostname.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,15 @@
+diff --git Python-2.6.4/Include/pyport.h Python-2.6.4/Include/pyport.h
+--- Python-2.6.4/Include/pyport.h
++++ Python-2.6.4/Include/pyport.h
+@@ -449,11 +449,6 @@
+ in platform-specific #ifdefs.
+ **************************************************************************/
+
+-#ifdef SOLARIS
+-/* Unchecked */
+-extern int gethostname(char *, int);
+-#endif
+-
+ #ifdef __BEOS__
+ /* Unchecked */
+ /* It's in the libs, but not the headers... - [cjh] */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-11-dlpi.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,1328 @@
+diff --git Python-2.6.4/Modules/dlpimodule.c Python-2.6.4/Modules/dlpimodule.c
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/Modules/dlpimodule.c
+@@ -0,0 +1,1206 @@
++/*
++ * Permission is hereby granted, free of charge, to any person obtaining a copy
++ * of this software and associated documentation files (the "Software"), to
++ * deal in the Software without restriction, including without limitation the
++ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
++ * sell copies of the Software, and to permit persons to whom the Software is
++ * furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included in
++ * all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++#include <Python.h>
++#include <stdio.h>
++#include <libdlpi.h>
++
++typedef struct {
++ PyObject_HEAD
++ dlpi_handle_t dlpihdl;
++} pylink_t;
++
++typedef struct {
++ PyObject *pyfunc;
++ PyObject *pyarg;
++} callback_data_t;
++
++/*
++ * dlpi_err: the only exception raised for libdlpi related error.
++ * The accompanying value is:
++ * (dlpi_error_number, string), when it's a dlpi specific error,
++ * or, (DL_SYSERR, errno, string), when it's coming from a system call.
++ */
++static PyObject *dlpi_err;
++
++static void
++dlpi_raise_exception(int err)
++{
++ PyObject *e = NULL;
++
++ if (err == DL_SYSERR) {
++ e = Py_BuildValue("(iis)", DL_SYSERR, errno, strerror(errno));
++ } else {
++ e = Py_BuildValue("(is)", err, dlpi_strerror(err));
++ }
++ if (e != NULL) {
++ PyErr_SetObject(dlpi_err, e);
++ Py_DECREF(e);
++ }
++}
++
++PyDoc_STRVAR(link_doc,
++ "link(linkname[, flags]) -> link object\n"
++ "\n"
++ "Open linkname with specified flags.\n"
++ "Three flags are supported: PASSIVE, RAW, NATIVE.\n"
++ "And these flags can be bitwise-OR'ed together(default flag is 0).\n"
++ "You need sys_net_rawaccess privilege to open a link.\n"
++ "See dlpi_open(3DLPI).\n"
++);
++static int
++link_init(PyObject *self, PyObject *args, PyObject *kwds)
++{
++ uint_t flags = 0;
++ dlpi_handle_t dh;
++ char *linkname;
++ int rval;
++ static char *keywords[] = {"linkname", "flags", NULL};
++ pylink_t *link = (pylink_t *)self;
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|I", keywords,
++ &linkname, &flags))
++ return (-1);
++
++ if ((rval = dlpi_open(linkname, &dh, flags)) != DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (-1);
++ }
++
++ link->dlpihdl = dh;
++
++ return (0);
++}
++
++static void
++link_dealloc(pylink_t *link)
++{
++ if (link->dlpihdl != NULL)
++ dlpi_close(link->dlpihdl);
++ link->ob_type->tp_free((PyObject *)link);
++}
++
++PyDoc_STRVAR(bind_doc,
++ "bind(sap) -> unsigned int\n"
++ "\n"
++ "Attempts to bind the link to specified SAP, or ANY_SAP.\n"
++ "Returns the SAP that the function actually bound to, which\n"
++ "could be different from the SAP requested.\n"
++ "See dlpi_bind(3DLPI).\n"
++);
++static PyObject *
++link_bind(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ uint_t sap = 0, boundsap = 0;
++ static char *keywords[] = {"sap", NULL};
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "I", keywords, &sap))
++ return (NULL);
++
++ if ((rval = dlpi_bind(link->dlpihdl, sap, &boundsap)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("I", boundsap));
++}
++
++PyDoc_STRVAR(unbind_doc,
++ "unbind() -> None\n"
++ "\n"
++ "Attempts to unbind the link from previously bound sap.\n"
++ "See dlpi_unbind(3DLPI).\n"
++);
++static PyObject *
++link_unbind(pylink_t *link)
++{
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((rval = dlpi_unbind(link->dlpihdl)) != DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ Py_INCREF(Py_None);
++ return (Py_None);
++}
++
++PyDoc_STRVAR(send_doc,
++ "send(destaddr, message[, sap, minpri, maxpri]) -> None\n"
++ "\n"
++ "Attempts to send message over this link to sap on destaddr.\n"
++ "If SAP is not specified, the bound SAP is used\n"
++ "You can also specify priority range (minpri, maxpri).\n"
++ "See dlpi_send(3DLPI).\n"
++);
++static PyObject *
++link_send(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ char *daddr = NULL, *msgbuf = NULL;
++ size_t daddrlen = 0, msglen = 0;
++ t_scalar_t minpri = DL_QOS_DONT_CARE, maxpri = DL_QOS_DONT_CARE;
++ uint_t sap = DLPI_ANY_SAP;
++ dlpi_sendinfo_t ds, *dsp = NULL;
++ static char *keywords[] =
++ {"destaddr", "message", "sap", "minpri", "maxpri", NULL};
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s#s#|Iii", keywords,
++ &daddr, &daddrlen, &msgbuf, &msglen, &sap, &minpri, &maxpri))
++ return (NULL);
++
++ if ((sap != DLPI_ANY_SAP) || (minpri != DL_QOS_DONT_CARE) ||
++ (maxpri != DL_QOS_DONT_CARE)) {
++ ds.dsi_sap = sap;
++ ds.dsi_prio.dl_min = minpri;
++ ds.dsi_prio.dl_max = maxpri;
++ dsp = &ds;
++ }
++
++ if ((rval = dlpi_send(link->dlpihdl, daddr, daddrlen,
++ msgbuf, msglen, dsp)) != DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ Py_INCREF(Py_None);
++ return (Py_None);
++}
++
++PyDoc_STRVAR(recv_doc,
++ "recv(msglen[, timeout]) -> (string, string), or (None, None)\n"
++ "\n"
++ "Attempts to receive message over this link.\n"
++ "You need to specify the message length for the received message.\n"
++ "And you can specify timeout value in milliseconds.\n"
++ "The default timeout value is -1 (wait forever).\n"
++ "Returns (source address, message data), or (None, None) when error occurs.\n"
++ "See dlpi_recv(3DLPI).\n"
++);
++static PyObject *
++link_recv(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ PyObject *obj;
++ char *saddr = NULL, *msgbuf = NULL;
++ size_t saddrlen = 0, msglen = 0, *saddrlenp = NULL, *msglenp = NULL;
++ int msec = -1; /* block until receive data */
++ static char *keywords[] = {"msglen", "timeout", NULL};
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "k|i",
++ keywords, &msglen, &msec))
++ return (NULL);
++
++ if (msglen > 0) {
++ msgbuf = malloc(msglen);
++ if (msgbuf == NULL) {
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++ saddrlen = DLPI_PHYSADDR_MAX;
++ saddr = malloc(saddrlen);
++ if (saddr == NULL) {
++ dlpi_raise_exception(DL_SYSERR);
++ free(msgbuf);
++ return (NULL);
++ }
++ msglenp = &msglen;
++ saddrlenp = &saddrlen;
++ }
++
++ if ((rval = dlpi_recv(link->dlpihdl, saddr, saddrlenp, msgbuf,
++ msglenp, msec, NULL)) != DLPI_SUCCESS) {
++ if (msgbuf != NULL)
++ free(msgbuf);
++ if (saddr != NULL)
++ free(saddr);
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ obj = Py_BuildValue("s#s#", saddr, saddrlen, msgbuf, msglen);
++ if (msgbuf != NULL)
++ free(msgbuf);
++ if (saddr != NULL)
++ free(saddr);
++ return (obj);
++}
++
++PyDoc_STRVAR(disabmulti_doc,
++ "disabmulti(address) -> None\n"
++ "\n"
++ "Disable a specified multicast address on this link.\n"
++ "See dlpi_disabmulti(3DLPI).\n"
++);
++static PyObject *
++link_disabmulti(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ char *addr = NULL;
++ size_t addrlen = 0;
++ static char *keywords[] = {"address", NULL};
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s#", keywords,
++ &addr, &addrlen))
++ return (NULL);
++
++ if ((addrlen == 0) || (addrlen > DLPI_PHYSADDR_MAX)) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((rval = dlpi_disabmulti(link->dlpihdl, addr, addrlen)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ Py_INCREF(Py_None);
++ return (Py_None);
++}
++
++PyDoc_STRVAR(enabmulti_doc,
++ "enabmulti(address) -> None\n"
++ "\n"
++ "Enable a specified multicast address on this link.\n"
++ "See dlpi_enabmulti(3DLPI).\n"
++);
++static PyObject *
++link_enabmulti(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ char *addr = NULL;
++ size_t addrlen = 0;
++ static char *keywords[] = {"address", NULL};
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s#", keywords,
++ &addr, &addrlen))
++ return (NULL);
++
++ if ((addrlen == 0) || (addrlen > DLPI_PHYSADDR_MAX)) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((rval = dlpi_enabmulti(link->dlpihdl, addr, addrlen)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ Py_INCREF(Py_None);
++ return (Py_None);
++}
++
++static void
++dlpi_callback(dlpi_handle_t hdl, dlpi_notifyinfo_t *ni, void *arg)
++{
++ callback_data_t *cd = (callback_data_t *)arg;
++ PyObject *arglist, *result;
++
++ switch (ni->dni_note) {
++ case DL_NOTE_SPEED:
++ arglist = Py_BuildValue("(OII)",
++ cd->pyarg, ni->dni_note, ni->dni_speed);
++ break;
++ case DL_NOTE_SDU_SIZE:
++ arglist = Py_BuildValue("(OII)",
++ cd->pyarg, ni->dni_note, ni->dni_size);
++ break;
++ case DL_NOTE_PHYS_ADDR:
++ arglist = Py_BuildValue("(OIs#)",
++ cd->pyarg, ni->dni_note, ni->dni_physaddr,
++ ni->dni_physaddrlen);
++ break;
++ default:
++ arglist = Py_BuildValue("(OIO)", cd->pyarg, ni->dni_note,
++ Py_None);
++ }
++
++ result = PyEval_CallObject(cd->pyfunc, arglist);
++ Py_DECREF(arglist);
++ if (result == NULL) {
++ PyErr_Clear(); /* cannot raise error */
++ }
++ Py_DECREF(result);
++ Py_DECREF(cd->pyfunc);
++ Py_XDECREF(cd->pyarg);
++ free(cd);
++}
++
++PyDoc_STRVAR(enabnotify_doc,
++ "enabnotify(events, function[, arg]) -> unsigned long\n"
++ "\n"
++ "Enables a notification callback for the set of specified events,\n"
++ "which must be one or more (by a logical OR) events listed as below:\n"
++ "NOTE_LINK_DOWN Notify when link has gone down\n"
++ "NOTE_LINK_UP Notify when link has come up\n"
++ "NOTE_PHYS_ADDR Notify when address changes\n"
++ "NOTE_SDU_SIZE Notify when MTU changes\n"
++ "NOTE_SPEED Notify when speed changes\n"
++ "NOTE_PROMISC_ON_PHYS Notify when PROMISC_PHYS is set\n"
++ "NOTE_PROMISC_OFF_PHYS Notify when PROMISC_PHYS is cleared\n"
++ "Returns a handle for this registration.\n"
++ "See dlpi_enabnotify(3DLPI).\n"
++);
++static PyObject *
++link_enabnotify(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ PyObject *func = NULL, *arg = NULL;
++ callback_data_t *cd;
++ uint_t notes = 0;
++ static char *keywords[] = {"events", "function", "arg", NULL};
++ dlpi_notifyid_t id;
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "IO|O",
++ keywords, ¬es, &func, &arg))
++ return (NULL);
++
++ if (!PyCallable_Check(func)) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ cd = malloc(sizeof(callback_data_t));
++ if (cd == NULL) {
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++ Py_INCREF(func);
++ Py_XINCREF(arg);
++ cd->pyfunc = func;
++ cd->pyarg = arg;
++
++ if ((rval = dlpi_enabnotify(link->dlpihdl, notes, dlpi_callback,
++ cd, &id)) != DLPI_SUCCESS) {
++ free(cd);
++ Py_DECREF(func);
++ Py_XDECREF(arg);
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("k", id));
++}
++
++PyDoc_STRVAR(disabnotify_doc,
++ "disabnotify(handle) -> argument object, or None\n"
++ "\n"
++ "Disables the notification registration associated with handle.\n"
++ "You should get this handle by calling enabnotify().\n"
++ "Returns the argument passed in when registering the callback, or None.\n"
++ "See dlpi_disabnotify(3DLPI).\n"
++);
++static PyObject *
++link_disabnotify(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ dlpi_notifyid_t id;
++ callback_data_t *arg;
++ PyObject *pyargsaved;
++ static char *keywords[] = {"handle", NULL};
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "k", keywords, &id))
++ return (NULL);
++
++ if ((rval = dlpi_disabnotify(link->dlpihdl, id, (void **)&arg)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ /* clean up */
++ pyargsaved = arg->pyarg;
++ Py_XINCREF(pyargsaved);
++ Py_XDECREF(arg->pyarg);
++ Py_DECREF(arg->pyfunc);
++ free(arg);
++
++ if (pyargsaved != NULL)
++ return (pyargsaved);
++
++ Py_INCREF(Py_None);
++ return (Py_None);
++}
++
++PyDoc_STRVAR(get_sap_doc,
++ "get_sap() -> unsigned int\n"
++ "\n"
++ "Returns the sap bound to this link.\n"
++ "See dlpi_info(3DLPI).\n"
++);
++static PyObject *
++link_get_sap(pylink_t *link)
++{
++ dlpi_info_t info;
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("I", info.di_sap));
++}
++
++PyDoc_STRVAR(get_fd_doc,
++ "get_fd() -> int\n"
++ "\n"
++ "Returns the integer file descriptor that can be used to directly\n"
++ "operate on the link.\n"
++ "See dlpi_fd(3DLPI).\n"
++);
++static PyObject *
++link_get_fd(pylink_t *link)
++{
++ int fd;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((fd = dlpi_fd(link->dlpihdl)) == -1) {
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("i", fd));
++}
++
++PyDoc_STRVAR(get_linkname_doc,
++ "get_linkname() -> string\n"
++ "\n"
++ "Returns the name of the link.\n"
++ "See dlpi_linkname(3DLPI).\n"
++);
++static PyObject *
++link_get_linkname(pylink_t *link)
++{
++ const char *name = NULL;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((name = dlpi_linkname(link->dlpihdl)) == NULL) {
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("s", name));
++}
++
++PyDoc_STRVAR(get_bcastaddr_doc,
++ "get_bcastaddr() -> string, or None\n"
++ "\n"
++ "Returns the broadcast address of the link.\n"
++ "Returns None if the broadcast address is empty.\n"
++ "See dlpi_info(3DLPI).\n"
++);
++static PyObject *
++link_get_bcastaddr(pylink_t *link)
++{
++ char *addr[DLPI_PHYSADDR_MAX];
++ size_t addrlen = 0;
++ dlpi_info_t info;
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ if (info.di_bcastaddrlen == 0) {
++ Py_INCREF(Py_None);
++ return (Py_None);
++ }
++
++ return (Py_BuildValue("s#", info.di_bcastaddr, info.di_bcastaddrlen));
++}
++
++PyDoc_STRVAR(get_physaddr_doc,
++ "get_physaddr(addrtype) -> string, or None\n"
++ "\n"
++ "Addrtype can be any one of the value listed below:\n"
++ "FACT_PHYS_ADDR Factory physical address\n"
++ "CURR_PHYS_ADDR Current physical address\n"
++ "Returns the corresponding physical address of the link.\n"
++ "See dlpi_get_physaddr(3DLPI).\n"
++);
++static PyObject *
++link_get_physaddr(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ char *addr[DLPI_PHYSADDR_MAX];
++ size_t addrlen = DLPI_PHYSADDR_MAX;
++ static char *keywords[] = {"addrtype", NULL};
++ uint_t type;
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "I", keywords, &type))
++ return (NULL);
++
++ if ((rval = dlpi_get_physaddr(link->dlpihdl, type, addr, &addrlen)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("s#", addr, addrlen));
++}
++
++PyDoc_STRVAR(set_physaddr_doc,
++ "set_physaddr(address) -> None\n"
++ "\n"
++ "Sets the physical address of the link.\n"
++ "See dlpi_set_physaddr(3DLPI).\n"
++);
++static PyObject *
++link_set_physaddr(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ char *addr = NULL;
++ size_t addrlen = 0;
++ static char *keywords[] = {"address", NULL};
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s#", keywords,
++ &addr, &addrlen))
++ return (NULL);
++
++ if ((rval = dlpi_set_physaddr(link->dlpihdl, DL_CURR_PHYS_ADDR,
++ addr, addrlen)) != DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ Py_INCREF(Py_None);
++ return (Py_None);
++}
++
++PyDoc_STRVAR(promiscon_doc,
++ "promiscon([level]) -> None\n"
++ "\n"
++ "Enables promiscuous mode for the link at levels:\n"
++ "PROMISC_PHYS Promiscuous mode at the physical level(default)\n"
++ "PROMISC_SAP Promiscuous mode at the SAP level\n"
++ "PROMISC_MULTI Promiscuous mode for all multicast addresses\n"
++ "See dlpi_promiscon(3DLPI).\n"
++);
++static PyObject *
++link_promiscon(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ uint_t level = DL_PROMISC_PHYS;
++ static char *keywords[] = {"level", NULL};
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|I", keywords, &level))
++ return (NULL);
++
++ if ((rval = dlpi_promiscon(link->dlpihdl, level)) != DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ Py_INCREF(Py_None);
++ return (Py_None);
++}
++
++PyDoc_STRVAR(promiscoff_doc,
++ "promiscoff([level]) -> None\n"
++ "\n"
++ "Disables promiscuous mode for the link at levels:\n"
++ "PROMISC_PHYS Promiscuous mode at the physical level(default)\n"
++ "PROMISC_SAP Promiscuous mode at the SAP level\n"
++ "PROMISC_MULTI Promiscuous mode for all multicast addresses\n"
++ "See dlpi_promiscoff(3DLPI).\n"
++);
++static PyObject *
++link_promiscoff(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ uint_t level = DL_PROMISC_PHYS;
++ static char *keywords[] = {"level", NULL};
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "|I", keywords, &level))
++ return (NULL);
++
++ if ((rval = dlpi_promiscoff(link->dlpihdl, level)) != DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ Py_INCREF(Py_None);
++ return (Py_None);
++}
++
++PyDoc_STRVAR(get_timeout_doc,
++ "get_timeout() -> int\n"
++ "\n"
++ "Returns current time out value of the link.\n"
++ "See dlpi_info(3DLPI).\n"
++);
++static PyObject *
++link_get_timeout(pylink_t *link)
++{
++ dlpi_info_t info;
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("i", info.di_timeout));
++}
++
++PyDoc_STRVAR(get_mactype_doc,
++ "get_mactype() -> unsigned char\n"
++ "\n"
++ "Returns MAC type of the link.\n"
++ "See <sys/dlpi.h> for the list of possible MAC types.\n"
++ "See dlpi_info(3DLPI).\n"
++);
++static PyObject *
++link_get_mactype(pylink_t *link)
++{
++ dlpi_info_t info;
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("B", info.di_mactype));
++}
++
++PyDoc_STRVAR(set_timeout_doc,
++ "set_timeout(timeout) -> None\n"
++ "\n"
++ "Sets time out value of the link (default value: DEF_TIMEOUT).\n"
++ "See dlpi_set_timeout(3DLPI).\n"
++);
++static PyObject *
++link_set_timeout(pylink_t *link, PyObject *args, PyObject *kwds)
++{
++ int timeout = DLPI_DEF_TIMEOUT;
++ static char *keywords[] = {"timeout", NULL};
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", keywords, &timeout))
++ return (NULL);
++
++ if ((rval = dlpi_set_timeout(link->dlpihdl, timeout)) != DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ Py_INCREF(Py_None);
++ return (Py_None);
++}
++
++PyDoc_STRVAR(get_sdu_doc,
++ "get_sdu() -> (unsigned int, unsigned int)\n"
++ "\n"
++ "Returns (min sdu, max sdu).\n"
++ "See dlpi_info(3DLPI).\n"
++);
++static PyObject *
++link_get_sdu(pylink_t *link)
++{
++ dlpi_info_t info;
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("II", info.di_min_sdu, info.di_max_sdu));
++}
++
++PyDoc_STRVAR(get_state_doc,
++ "get_state() -> unsigned int\n"
++ "\n"
++ "Returns current state of the link (either UNBOUND or IDLE).\n"
++ "See dlpi_info(3DLPI).\n"
++);
++static PyObject *
++link_get_state(pylink_t *link)
++{
++ dlpi_info_t info;
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("I", info.di_state));
++}
++
++PyDoc_STRVAR(get_qos_select_doc,
++ "get_qos_select() -> (unsigned int, int, int, int)\n"
++ "\n"
++ "Returns (qos type, trans delay, priority, residul err).\n"
++ "Unsupported QOS parameters are set to UNKNOWN.\n"
++ "See dlpi_info(3DLPI).\n"
++);
++static PyObject *
++link_get_qos_select(pylink_t *link)
++{
++ dlpi_info_t info;
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("Iiiii",
++ info.di_qos_sel.dl_qos_type,
++ info.di_qos_sel.dl_trans_delay,
++ info.di_qos_sel.dl_priority,
++ info.di_qos_sel.dl_residual_error));
++}
++
++PyDoc_STRVAR(get_qos_range_doc,
++ "get_qos_range() -> \n"
++ " (unsigned int, (int, int), (int, int), (int, int), int)\n"
++ "\n"
++ "Returns (qos type, (trans delay target, trans delay accept),\n"
++ "(min priority, max priority), (min protection, max protection),\n"
++ "residual err).\n"
++ "Unsupported QOS range values are set to UNKNOWN.\n"
++ "See dlpi_info(3DLPI).\n"
++);
++static PyObject *
++link_get_qos_range(pylink_t *link)
++{
++ dlpi_info_t info;
++ int rval;
++
++ if (link->dlpihdl == NULL) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ if ((rval = dlpi_info(link->dlpihdl, &info, 0)) !=
++ DLPI_SUCCESS) {
++ dlpi_raise_exception(rval);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("I(ii)(ii)(ii)i",
++ info.di_qos_range.dl_qos_type,
++ info.di_qos_range.dl_trans_delay.dl_target_value,
++ info.di_qos_range.dl_trans_delay.dl_accept_value,
++ info.di_qos_range.dl_priority.dl_min,
++ info.di_qos_range.dl_priority.dl_max,
++ info.di_qos_range.dl_protection.dl_min,
++ info.di_qos_range.dl_protection.dl_max,
++ info.di_qos_range.dl_residual_error));
++}
++
++static PyMethodDef pylink_methods[] = {
++ {"bind", (PyCFunction)link_bind, METH_VARARGS|METH_KEYWORDS, bind_doc},
++ {"unbind", (PyCFunction)link_unbind, METH_NOARGS, unbind_doc},
++ {"send", (PyCFunction)link_send, METH_VARARGS|METH_KEYWORDS,
++ send_doc},
++ {"recv", (PyCFunction)link_recv, METH_VARARGS|METH_KEYWORDS,
++ recv_doc},
++ {"disabmulti", (PyCFunction)link_disabmulti, METH_VARARGS|METH_KEYWORDS,
++ disabmulti_doc},
++ {"enabmulti", (PyCFunction)link_enabmulti, METH_VARARGS|METH_KEYWORDS,
++ enabmulti_doc},
++ {"enabnotify", (PyCFunction)link_enabnotify,
++ METH_VARARGS|METH_KEYWORDS, enabnotify_doc},
++ {"disabnotify", (PyCFunction)link_disabnotify,
++ METH_VARARGS|METH_KEYWORDS, disabnotify_doc},
++ {"get_fd", (PyCFunction)link_get_fd, METH_NOARGS, get_fd_doc},
++ {"get_sap", (PyCFunction)link_get_sap, METH_NOARGS, get_sap_doc},
++ {"get_mactype", (PyCFunction)link_get_mactype, METH_NOARGS,
++ get_mactype_doc},
++ {"get_linkname", (PyCFunction)link_get_linkname, METH_NOARGS,
++ get_linkname_doc},
++ {"get_bcastaddr", (PyCFunction)link_get_bcastaddr, METH_NOARGS,
++ get_bcastaddr_doc},
++ {"get_physaddr", (PyCFunction)link_get_physaddr,
++ METH_VARARGS|METH_KEYWORDS, get_physaddr_doc},
++ {"set_physaddr", (PyCFunction)link_set_physaddr,
++ METH_VARARGS|METH_KEYWORDS, set_physaddr_doc},
++ {"promiscon", (PyCFunction)link_promiscon, METH_VARARGS|METH_KEYWORDS,
++ promiscon_doc},
++ {"promiscoff", (PyCFunction)link_promiscoff, METH_VARARGS|METH_KEYWORDS,
++ promiscoff_doc},
++ {"get_timeout", (PyCFunction)link_get_timeout, METH_NOARGS,
++ get_timeout_doc},
++ {"set_timeout", (PyCFunction)link_set_timeout,
++ METH_VARARGS|METH_KEYWORDS, set_timeout_doc},
++ {"get_sdu", (PyCFunction)link_get_sdu, METH_NOARGS, get_sdu_doc},
++ {"get_state", (PyCFunction)link_get_state, METH_NOARGS,
++ get_state_doc},
++ {"get_qos_select", (PyCFunction)link_get_qos_select, METH_NOARGS,
++ get_qos_select_doc},
++ {"get_qos_range", (PyCFunction)link_get_qos_range, METH_NOARGS,
++ get_qos_range_doc},
++ {NULL}
++};
++
++static PyTypeObject pylink_type = {
++ PyObject_HEAD_INIT(0) /* Must fill in type value later */
++ 0, /* ob_size */
++ "dlpi.link", /* tp_name */
++ sizeof(pylink_t), /* tp_basicsize */
++ 0, /* tp_itemsize */
++ (destructor)link_dealloc, /* tp_dealloc */
++ 0, /* tp_print */
++ 0, /* tp_getattr */
++ 0, /* tp_setattr */
++ 0, /* tp_compare */
++ 0, /* tp_repr */
++ 0, /* tp_as_number */
++ 0, /* tp_as_sequence */
++ 0, /* tp_as_mapping */
++ 0, /* tp_hash */
++ 0, /* tp_call */
++ 0, /* tp_str */
++ 0, /* tp_getattro */
++ 0, /* tp_setattro */
++ 0, /* tp_as_buffer */
++ Py_TPFLAGS_DEFAULT, /* tp_flags */
++ link_doc, /* tp_doc */
++ 0, /* tp_traverse */
++ 0, /* tp_clear */
++ 0, /* tp_richcompare */
++ 0, /* tp_weaklistoffset */
++ 0, /* tp_iter */
++ 0, /* tp_iternext */
++ pylink_methods, /* tp_methods */
++ 0, /* tp_members */
++ 0, /* tp_getset */
++ 0, /* tp_base */
++ 0, /* tp_dict */
++ 0, /* tp_descr_get */
++ 0, /* tp_descr_set */
++ 0, /* tp_dictoffset */
++ (initproc)link_init, /* tp_init */
++ 0, /* tp_alloc */
++ PyType_GenericNew, /* tp_new */
++ 0, /* tp_free */
++};
++
++PyDoc_STRVAR(arptype_doc,
++ "arptype(arptype) -> unsigned int\n"
++ "\n"
++ "Converts a DLPI MAC type to an ARP hardware type defined\n"
++ " in <netinet/arp.h>\n"
++ "See dlpi_arptype(3DLPI)\n"
++);
++static PyObject *
++arptype(PyObject *dlpi, PyObject *args, PyObject *kwds)
++{
++ static char *keywords[] = {"arptype", NULL};
++ uint_t dlpityp, arptyp;
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "I", keywords, &dlpityp))
++ return (NULL);
++
++ if ((arptyp = dlpi_arptype(dlpityp)) == 0) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("I", arptyp));
++}
++
++PyDoc_STRVAR(iftype_doc,
++ "iftype(iftype) -> unsigned int\n"
++ "\n"
++ "Converts a DLPI MAC type to a BSD socket interface type\n"
++ "defined in <net/if_types.h>\n"
++ "See dlpi_iftype(3DLPI)\n"
++);
++static PyObject *
++iftype(PyObject *dlpi, PyObject *args, PyObject *kwds)
++{
++ static char *keywords[] = {"iftype", NULL};
++ uint_t dlpityp, iftyp;
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "I", keywords, &dlpityp))
++ return (NULL);
++
++ if ((iftyp = dlpi_iftype(dlpityp)) == 0) {
++ errno = EINVAL;
++ dlpi_raise_exception(DL_SYSERR);
++ return (NULL);
++ }
++
++ return (Py_BuildValue("I", iftyp));
++}
++
++PyDoc_STRVAR(mactype_doc,
++ "mactype(mactype) -> string\n"
++ "\n"
++ "Returns a string that describes the specified mactype.\n"
++ "Valid mac types are defined in <sys/dlpi.h>.\n"
++ "See dlpi_mactype(3DLPI)\n"
++);
++static PyObject *
++mactype(PyObject *dlpi, PyObject *args, PyObject *kwds)
++{
++ static char *keywords[] = {"mactype", NULL};
++ uint_t mactyp;
++
++ if (!PyArg_ParseTupleAndKeywords(args, kwds, "I", keywords, &mactyp))
++ return (NULL);
++
++ return (Py_BuildValue("s", dlpi_mactype(mactyp)));
++}
++
++static boolean_t
++link_walker(const char *name, void *arg)
++{
++ PyObject *linkname;
++ PyObject *list = (PyObject *)arg;
++
++ if ((list == NULL) || !PyList_Check(list))
++ return (_B_FALSE);
++
++ linkname = Py_BuildValue("s", name);
++ if (PyList_Append(list, linkname) == -1)
++ return (_B_TRUE);
++
++ Py_DECREF(linkname);
++ return (_B_FALSE);
++}
++
++PyDoc_STRVAR(listlink_doc,
++ "listlink() -> list\n"
++ "\n"
++ "Returns a list containing link names of all links on the system.\n"
++);
++static PyObject *
++listlink(PyObject *dlpi)
++{
++ PyObject *list;
++
++ if ((list = PyList_New(0)) == NULL)
++ return (NULL);
++
++ dlpi_walk(link_walker, list, 0);
++ return (list);
++}
++
++static PyMethodDef dlpi_methods[] = {
++ {"arptype", (PyCFunction)arptype, METH_VARARGS|METH_KEYWORDS,
++ arptype_doc},
++ {"iftype", (PyCFunction)iftype, METH_VARARGS|METH_KEYWORDS,
++ iftype_doc},
++ {"mactype", (PyCFunction)mactype, METH_VARARGS|METH_KEYWORDS,
++ mactype_doc},
++ {"listlink", (PyCFunction)listlink, METH_NOARGS, listlink_doc},
++ {NULL}
++};
++
++PyMODINIT_FUNC
++initdlpi(void)
++{
++ PyObject *mod;
++
++ if (PyType_Ready(&pylink_type) < 0)
++ return;
++
++ mod = Py_InitModule("dlpi", dlpi_methods);
++ if (mod == NULL)
++ return;
++
++ dlpi_err = PyErr_NewException("dlpi.error", NULL, NULL);
++ if (dlpi_err == NULL)
++ return;
++ PyModule_AddObject(mod, "error", dlpi_err);
++
++ Py_INCREF(&pylink_type);
++ PyModule_AddObject(mod, "link", (PyObject *)&pylink_type);
++ PyModule_AddIntConstant(mod, "PASSIVE", DLPI_PASSIVE);
++ PyModule_AddIntConstant(mod, "RAW", DLPI_RAW);
++ PyModule_AddIntConstant(mod, "NATIVE", DLPI_NATIVE);
++ PyModule_AddIntConstant(mod, "ANY_SAP", DLPI_ANY_SAP);
++ PyModule_AddIntConstant(mod, "DEF_TIMEOUT", DLPI_DEF_TIMEOUT);
++ PyModule_AddIntConstant(mod, "NOTE_LINK_DOWN", DL_NOTE_LINK_DOWN);
++ PyModule_AddIntConstant(mod, "NOTE_LINK_UP", DL_NOTE_LINK_UP);
++ PyModule_AddIntConstant(mod, "NOTE_PHYS_ADDR", DL_NOTE_PHYS_ADDR);
++ PyModule_AddIntConstant(mod, "NOTE_SDU_SIZE", DL_NOTE_SDU_SIZE);
++ PyModule_AddIntConstant(mod, "NOTE_SPEED", DL_NOTE_SPEED);
++ PyModule_AddIntConstant(mod, "NOTE_PROMISC_ON_PHYS",
++ DL_NOTE_PROMISC_ON_PHYS);
++ PyModule_AddIntConstant(mod, "NOTE_PROMISC_OFF_PHYS",
++ DL_NOTE_PROMISC_OFF_PHYS);
++ PyModule_AddIntConstant(mod, "FACT_PHYS_ADDR", DL_FACT_PHYS_ADDR);
++ PyModule_AddIntConstant(mod, "CURR_PHYS_ADDR", DL_CURR_PHYS_ADDR);
++ PyModule_AddIntConstant(mod, "PROMISC_PHYS", DL_PROMISC_PHYS);
++ PyModule_AddIntConstant(mod, "PROMISC_SAP", DL_PROMISC_SAP);
++ PyModule_AddIntConstant(mod, "PROMISC_MULTI", DL_PROMISC_MULTI);
++ PyModule_AddIntConstant(mod, "UNKNOWN", DL_UNKNOWN);
++ PyModule_AddIntConstant(mod, "UNBOUND", DL_UNBOUND);
++ PyModule_AddIntConstant(mod, "IDLE", DL_IDLE);
++ PyModule_AddIntConstant(mod, "SYSERR", DL_SYSERR);
++}
+diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
+--- Python-2.6.4/setup.py
++++ Python-2.6.4/setup.py
+@@ -1284,6 +1284,12 @@
+ exts.append( Extension('ucred', ['ucred.c'],
+ libraries = ['tsol']) )
+
++ # dlpi module (Solaris)
++ dlpi_inc = find_file('libdlpi.h', [], inc_dirs)
++ if dlpi_inc is not None:
++ exts.append( Extension('dlpi', ['dlpimodule.c'],
++ libraries = ['dlpi']) )
++
+ # Thomas Heller's _ctypes module
+ self.detect_ctypes(inc_dirs, lib_dirs)
+
+diff --git Python-2.6.4/lib/test/dlpitest.py Python-2.6.4/Lib/test/dlpitest.py
+new file mode 100644
+--- /dev/null 2011-02-12 03:13:26.000000000 -0600
++++ Python-2.6.4/Lib/test/dlpitest.py 2011-01-20 13:52:42.895865414 -0600
+@@ -0,0 +1,96 @@
++#!/usr/bin/python2.6
++
++import dlpi
++import sys
++import time
++import struct
++
++#test listlink
++linklist = dlpi.listlink()
++print "Found %d links:" % len(linklist)
++print linklist
++
++#pick up the first data link for below testing
++linkname = linklist[0]
++
++#open link
++print "opening link: " + linkname + "..."
++testlink = dlpi.link(linkname)
++
++#read some info of testlink
++print "linkname is %s" % testlink.get_linkname()
++print "link fd is %d" % testlink.get_fd()
++mactype = testlink.get_mactype()
++print "dlpi mactype is %d" % mactype
++print "after convert:"
++print "\tmactype is %s" % dlpi.mactype(mactype)
++print "\tiftype is %d" % dlpi.iftype(mactype)
++print "\tarptype is %d" % dlpi.arptype(mactype)
++bcastaddr = testlink.get_bcastaddr()
++print "broadcast addr is: ",
++print struct.unpack("BBBBBB",bcastaddr)
++physaddr = testlink.get_physaddr(dlpi.FACT_PHYS_ADDR)
++print "factory physical address is: ",
++print struct.unpack("BBBBBB",physaddr)
++print "current timeout value is %d" % testlink.get_timeout()
++print "sdu is:",
++print testlink.get_sdu()
++print "qos select is:",
++print testlink.get_qos_select()
++print "qos range is:",
++print testlink.get_qos_range()
++
++#set some config value of testlink and read them again
++print "setting current physiacal addr to aa:0:10:13:27:5"
++testlink.set_physaddr('\xaa\0\x10\x13\x27\5')
++physaddr = testlink.get_physaddr(dlpi.CURR_PHYS_ADDR)
++print "current physical addr is: ",
++print struct.unpack("BBBBBB",physaddr)
++print "set timeout value to 6..."
++testlink.set_timeout(6)
++print "timeout value is %d" % testlink.get_timeout()
++
++#test enable/disable multicast
++print "enable/disable multicast address 1:0:5e:0:0:5"
++testlink.enabmulti('\1\0\x5e\0\0\5')
++testlink.disabmulti('\1\0\x5e\0\0\5')
++
++#test bind
++print "binding to SAP 0x9000..."
++testlink.bind(0x9000)
++print "sap is %x" % testlink.get_sap()
++print "state is: %d" % testlink.get_state()
++
++#test send
++print "sending broadcast loopback packet..."
++testlink.send(bcastaddr, '\0\1\2\3\4\5')
++
++#test notify functionality
++arg = "notification callback arg"
++def notify(arg, notes, value):
++ print "NOTE_PROMISC_ON_PHYS notification received with arg: '%s'" % arg
++print "enabled notification on NOTE_PROMISC_ON_PHYS"
++id = testlink.enabnotify(dlpi.NOTE_PROMISC_ON_PHYS, notify, arg) #enable notification
++testlink.promiscon() #trigger the event (will be seen while receiving pkt below)
++
++#test receive
++print "testing receiving..."
++try:
++ testlink.recv(0, 0) #should see NOTE_PROMISC_ON_PHYS event here
++except dlpi.error, err:
++ errnum, errinfo = err
++ if errnum == 10006:
++ pass #timeout error is expected here
++ else: #test fails if reach here
++ print "test failed",
++ print errnum,
++ print err
++
++testlink.promiscoff()
++testlink.disabnotify(id) #disable notification
++
++#test unbind
++print "unbinding..."
++testlink.unbind()
++print "sap is %x" % testlink.get_sap()
++print "state is: %d" % testlink.get_state()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-12-encoding-alias.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,35 @@
+diff --git Python-2.6.4/Lib/encodings/aliases.py Python-2.6.4/Lib/encodings/aliases.py
+--- Python-2.6.4/Lib/encodings/aliases.py
++++ Python-2.6.4/Lib/encodings/aliases.py
+@@ -73,6 +73,7 @@
+
+ # cp1251 codec
+ '1251' : 'cp1251',
++ 'ansi_1251' : 'cp1251',
+ 'windows_1251' : 'cp1251',
+
+ # cp1252 codec
+@@ -217,6 +218,7 @@
+ 'u_jis' : 'euc_jp',
+
+ # euc_kr codec
++ '5601' : 'euc_kr',
+ 'euckr' : 'euc_kr',
+ 'korean' : 'euc_kr',
+ 'ksc5601' : 'euc_kr',
+@@ -457,6 +459,7 @@
+ 'shiftjis' : 'shift_jis',
+ 'sjis' : 'shift_jis',
+ 's_jis' : 'shift_jis',
++ 'pck' : 'shift_jis',
+
+ # shift_jis_2004 codec
+ 'shiftjis2004' : 'shift_jis_2004',
+@@ -476,6 +479,7 @@
+ 'tis_620_0' : 'tis_620',
+ 'tis_620_2529_0' : 'tis_620',
+ 'tis_620_2529_1' : 'tis_620',
++ 'tis620.2533' : 'tis_620',
+ 'iso_ir_166' : 'tis_620',
+
+ # utf_16 codec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-13-cflags.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,12 @@
+diff --git Python-2.6.4/configure.in Python-2.6.4/configure.in
+--- Python-2.6.4/configure.in
++++ Python-2.6.4/configure.in
+@@ -1110,6 +1110,8 @@
+ # environment?
+ Darwin*)
+ ;;
++ SunOS*)
++ ;;
+ *)
+ BASECFLAGS="$BASECFLAGS -OPT:Olimit=0"
+ ;;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-14-ctypes-util-find-library.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,39 @@
+diff --git Python-2.6.4/Lib/ctypes/util.py Python-2.6.4/Lib/ctypes/util.py
+--- Python-2.6.4/Lib/ctypes/util.py
++++ Python-2.6.4/Lib/ctypes/util.py
+@@ -164,6 +164,35 @@
+ res.sort(cmp= lambda x,y: cmp(_num_version(x), _num_version(y)))
+ return res[-1]
+
++ elif sys.platform == "sunos5":
++
++ def _findLib_crle(name, is64):
++ if not os.path.exists('/usr/bin/crle'):
++ return None
++
++ if is64:
++ cmd = 'env LC_ALL=C /usr/bin/crle -64 2>/dev/null'
++ else:
++ cmd = 'env LC_ALL=C /usr/bin/crle 2>/dev/null'
++
++ for line in os.popen(cmd).readlines():
++ line = line.strip()
++ if (line.startswith('Default Library Path (ELF):')):
++ paths = line.split()[4]
++
++ if not paths:
++ return None
++
++ for dir in paths.split(":"):
++ libfile = os.path.join(dir, "lib%s.so" % name)
++ if os.path.exists(libfile):
++ return libfile
++
++ return None
++
++ def find_library(name, is64 = False):
++ return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
++
+ else:
+
+ def _findLib_ldconfig(name):
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-15-getcwd.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,21 @@
+diff --git Python-2.6.4/Modules/posixmodule.c Python-2.6.4/Modules/posixmodule.c
+--- Python-2.6.4/Modules/posixmodule.c
++++ Python-2.6.4/Modules/posixmodule.c
+@@ -1978,6 +1978,8 @@
+ char *res = NULL;
+ PyObject *dynamic_return;
+
++ int maxsize = pathconf(".", _PC_PATH_MAX);
++
+ Py_BEGIN_ALLOW_THREADS
+ do {
+ bufsize = bufsize + bufsize_incr;
+@@ -1994,7 +1996,7 @@
+ if (res == NULL) {
+ free(tmpbuf);
+ }
+- } while ((res == NULL) && (errno == ERANGE));
++ } while ((res == NULL) && (errno == ERANGE) && (bufsize < maxsize));
+ Py_END_ALLOW_THREADS
+
+ if (res == NULL)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-16-privrbac.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,1581 @@
+diff --git Python-2.6.4/Modules/authattr.c Python-2.6.4/Modules/authattr.c
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/Modules/authattr.c
+@@ -0,0 +1,262 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++
++/*
++ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++/*
++ * RBAC Bindings for Python - auth_attr functions
++ */
++
++#include <auth_attr.h>
++#include "Python.h"
++#include "pyrbac.h"
++
++static PyObject*
++pyrbac_setauthattr(PyObject* self, PyObject* args) {
++ setauthattr();
++ return Py_None;
++}
++
++static PyObject*
++pyrbac_endauthattr(PyObject* self, PyObject* args) {
++ endauthattr();
++ return Py_None;
++}
++
++PyObject*
++pyrbac_getauthnamattr(PyObject* self, char* authname, int mode) {
++
++
++
++ authattr_t * ret_authattr = (mode == PYRBAC_NAM_MODE) ? getauthnam(authname) : getauthattr();
++ if (ret_authattr == NULL)
++ return Py_None;
++
++ PyObject* kv_data = PyDict_New();
++ if (kv_data == NULL) {
++ free_authattr(ret_authattr);
++ return NULL;
++ }
++
++ if(ret_authattr->attr != NULL) {
++ int len;
++ for(len = 0; len < ret_authattr->attr->length; len++) {
++ kv_t current = ret_authattr->attr->data[len];
++
++ PyObject* set = PyList_New(NULL);
++ char* saveptr;
++ char* item = strtok_r(current.value, ",", &saveptr);
++ PyList_Append(set, PyString_FromString(item));
++
++ while((item = strtok_r(NULL, ",", &saveptr)) != NULL) {
++ if(PyList_Append(set, PyString_FromString(item)) != 0) {
++ Py_XDECREF(set);
++ Py_XDECREF(kv_data);
++ free_authattr(ret_authattr);
++ return NULL;
++ }
++ }
++ if(PyDict_SetItemString(kv_data, current.key, set)) {
++ free_authattr(ret_authattr);
++ return NULL;
++ }
++ }
++ }
++ PyObject * retval = Py_BuildValue("{s:s,s:s,s:s,s:s,s:s,s:O}",
++ "name",ret_authattr->name,
++ "res1",ret_authattr->res1,
++ "res2",ret_authattr->res2,
++ "short",ret_authattr->short_desc,
++ "long",ret_authattr->long_desc,
++ "attributes",kv_data);
++
++ free_authattr(ret_authattr);
++ return retval;
++
++}
++
++static PyObject*
++pyrbac_getauthattr(PyObject* self, PyObject* args) {
++ return(pyrbac_getauthnamattr(self, NULL, PYRBAC_ATTR_MODE));
++}
++
++static PyObject*
++pyrbac_getauthnam(PyObject* self, PyObject* args) {
++ char* name = NULL;
++ if(!PyArg_ParseTuple(args, "s:getauthnam", &name))
++ return NULL;
++ return(pyrbac_getauthnamattr(self, name, PYRBAC_NAM_MODE));
++}
++
++static PyObject *
++pyrbac_chkauthattr(PyObject* self, PyObject* args) {
++ char* authstring = NULL;
++ char* username = NULL;
++ if(!PyArg_ParseTuple(args, "ss:chkauthattr", &authstring, &username))
++ return NULL;
++ return PyBool_FromLong((long)chkauthattr(authstring, username));
++}
++
++static PyObject*
++pyrbac_authattr_next(PyObject* self, PyObject* args) {
++ PyObject* retval = pyrbac_getauthattr(self, args);
++ if( retval == Py_None ) {
++ setauthattr();
++ return NULL;
++ }
++ return retval;
++}
++static PyObject*
++pyrbac_authattr__iter__(PyObject* self, PyObject* args) {
++ return self;
++}
++
++typedef struct {
++ PyObject_HEAD
++} Authattr;
++
++static void
++Authattr_dealloc(Authattr* self) {
++ endauthattr();
++ self->ob_type->tp_free((PyObject*) self);
++}
++
++static PyObject*
++Authattr_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
++ Authattr *self;
++ self = (Authattr*)type->tp_alloc(type, 0);
++
++ return ((PyObject *) self);
++}
++
++static int
++Authattr_init(Authattr* self, PyObject *args, PyObject *kwargs) {
++ setauthattr();
++ return 0;
++}
++
++static char pyrbac_authattr__doc__[];
++
++PyDoc_STRVAR(pyrbac_authattr__doc__, """provides interfaces to the auth_attr \
++database. may be iterated over to return all auth_attr entries\n\n\
++Methods provided:\n\
++setauthattr\n\
++endauthattr\n\
++getauthattr\n\
++chkauthattr\n\
++getauthnam""");
++
++static char pyrbac_setauthattr__doc__[];
++static char pyrbac_endauthattr__doc__[];
++static char pyrbac_getauthattr__doc__[];
++static char pyrbac_chkauthattr__doc__[];
++
++PyDoc_STRVAR(pyrbac_setauthattr__doc__,
++"\"rewinds\" the auth_attr functions to the first entry in the db. Called \
++automatically by the constructor\n\tArguments: None\n\tReturns: None");
++
++PyDoc_STRVAR(pyrbac_endauthattr__doc__,
++"closes the auth_attr database, cleans up storage. called automatically by \
++the destructor\n\tArguments: None\n\tReturns: None");
++
++PyDoc_STRVAR(pyrbac_chkauthattr__doc__, "verifies if a user has a given \
++authorization.\n\tArguments: 2 Python strings, 'authname' and 'username'\n\
++\tReturns: True if the user is authorized, False otherwise");
++
++PyDoc_STRVAR(pyrbac_getauthattr__doc__,
++"return one entry from the auth_attr database\n\
++\tArguments: None\n\
++\tReturns: a dict representing the authattr_t struct:\n\
++\t\t\"name\": Authorization Name\n\
++\t\t\"res1\": reserved\n\
++\t\t\"res2\": reserved\n\
++\t\t\"short\": Short Description\n\
++\t\t\"long\": Long Description\n\
++\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
++or a string depending on value");
++
++PyDoc_STRVAR(pyrbac_getauthnam__doc__,
++"searches the auth_attr database for a given authorization name\n\
++\tArguments: a Python string containing the auth name\n\
++\tReturns: a dict representing the authattr_t struct:\n\
++\t\t\"name\": Authorization Name\n\
++\t\t\"res1\": reserved\n\
++\t\t\"res2\": reserved\n\
++\t\t\"short\": Short Description\n\
++\t\t\"long\": Long Description\n\
++\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
++or a string depending on value");
++
++static PyMethodDef Authattr_methods[] = {
++ {"setauthattr", pyrbac_setauthattr, METH_NOARGS, pyrbac_setauthattr__doc__},
++ {"endauthattr", pyrbac_endauthattr, METH_NOARGS, pyrbac_endauthattr__doc__},
++ {"chkauthattr", pyrbac_chkauthattr, METH_VARARGS, pyrbac_chkauthattr__doc__},
++ {"getauthattr", pyrbac_getauthattr, METH_NOARGS, pyrbac_getauthattr__doc__},
++ {"getauthnam", pyrbac_getauthnam, METH_VARARGS, pyrbac_getauthnam__doc__},
++ {NULL}
++};
++
++PyTypeObject AuthattrType = {
++ PyObject_HEAD_INIT(NULL)
++ 0, /*ob_size*/
++ "rbac.authattr", /*tp_name*/
++ sizeof(Authattr), /*tp_basicsize*/
++ 0, /*tp_itemsize*/
++ (destructor)Authattr_dealloc, /*tp_dealloc*/
++ 0, /*tp_print*/
++ 0, /*tp_getattr*/
++ 0, /*tp_setattr*/
++ 0, /*tp_compare*/
++ 0, /*tp_repr*/
++ 0, /*tp_as_number*/
++ 0, /*tp_as_sequence*/
++ 0, /*tp_as_mapping*/
++ 0, /*tp_hash */
++ 0, /*tp_call*/
++ 0, /*tp_str*/
++ 0, /*tp_getattro*/
++ 0, /*tp_setattro*/
++ 0, /*tp_as_buffer*/
++ Py_TPFLAGS_DEFAULT |
++ Py_TPFLAGS_BASETYPE |
++ Py_TPFLAGS_HAVE_ITER, /*tp_flags*/
++ pyrbac_authattr__doc__, /* tp_doc */
++ 0, /* tp_traverse */
++ 0, /* tp_clear */
++ 0, /* tp_richcompare */
++ 0, /* tp_weaklistoffset */
++ pyrbac_authattr__iter__, /* tp_iter */
++ pyrbac_authattr_next, /* tp_iternext */
++ Authattr_methods, /* tp_methods */
++ 0, /* tp_members */
++ 0, /* tp_getset */
++ 0, /* tp_base */
++ 0, /* tp_dict */
++ 0, /* tp_descr_get */
++ 0, /* tp_descr_set */
++ 0, /* tp_dictoffset */
++ (initproc)Authattr_init, /* tp_init */
++ 0, /* tp_alloc */
++ Authattr_new, /* tp_new */
++};
+diff --git Python-2.6.4/Modules/execattr.c Python-2.6.4/Modules/execattr.c
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/Modules/execattr.c
+@@ -0,0 +1,314 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++
++/*
++ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++/*
++ * RBAC Bindings for Python - exec_attr functions
++ */
++
++#include <exec_attr.h>
++#include "Python.h"
++#include "pyrbac.h"
++
++static PyObject *
++pyrbac_setexecattr(PyObject* self, PyObject* args) {
++ setexecattr();
++ return Py_None;
++}
++
++static PyObject *
++pyrbac_endexecattr(PyObject* self, PyObject* args) {
++ endexecattr();
++ return Py_None;
++}
++
++PyObject *
++pyrbac_getexecuserprofattr(PyObject* self, char* userprofname, char* type, char* id, int mode) {
++
++ PyObject* ep_data = (mode == PYRBAC_ATTR_MODE) ? NULL : PyList_New(0);
++
++ if (ep_data == NULL && mode != PYRBAC_ATTR_MODE )
++ return NULL;
++
++ execattr_t *execprof;
++ if (mode == PYRBAC_USER_MODE)
++ execprof = getexecuser(userprofname, type, id, GET_ALL);
++ else if (mode == PYRBAC_PROF_MODE)
++ execprof = getexecprof(userprofname, type, id, GET_ALL);
++ else if (mode == PYRBAC_ATTR_MODE)
++ execprof = getexecattr();
++ else
++ return NULL;
++
++ if (execprof == NULL)
++ return Py_None;
++
++ execattr_t *execprof_head = execprof;
++
++ while(execprof != NULL) {
++
++ PyObject* kv_data = PyDict_New();
++
++ if(execprof->attr != NULL) {
++ int len;
++ for(len = 0; len < execprof->attr->length; len++) {
++ kv_t current = execprof->attr->data[len];
++
++ PyObject* set = PyList_New(NULL);
++ char* saveptr;
++ char* item = strtok_r(current.value, ",", &saveptr);
++ PyList_Append(set, PyString_FromString(item));
++
++ while((item = strtok_r(NULL, ",", &saveptr)) != NULL) {
++ if(PyList_Append(set, PyString_FromString(item)) != 0) {
++ Py_XDECREF(set);
++ Py_XDECREF(kv_data);
++ free_execattr(execprof_head);
++ return NULL;
++ }
++ }
++ if(PyDict_SetItemString(kv_data, current.key, set)) {
++ free_execattr(execprof_head);
++ return NULL;
++ }
++ }
++ }
++ PyObject* entry = Py_BuildValue("{s:s,s:s,s:s,s:s,s:s,s:s,s:O}",
++ "name", execprof->name,
++ "type", execprof->type,
++ "policy", execprof->policy,
++ "res1", execprof->res1,
++ "res2", execprof->res2,
++ "id", execprof->id,
++ "attributes", kv_data);
++
++ if (entry == NULL) {
++ Py_XDECREF(kv_data);
++ free_execattr(execprof_head);
++ return NULL;
++ }
++
++ if (mode == PYRBAC_ATTR_MODE) {
++ free_execattr(execprof_head);
++ return(entry);
++ }
++ PyList_Append(ep_data, entry);
++ execprof = execprof->next;
++ }
++
++ free_execattr(execprof_head);
++ return(ep_data);
++
++}
++
++static PyObject *
++pyrbac_getexecuser(PyObject* self, PyObject* args) {
++ char* username = NULL;
++ char* type = NULL;
++ char* id = NULL;
++
++ if(!PyArg_ParseTuple(args, "sss:getexecuser", &username, &type, &id))
++ return NULL;
++
++ return (pyrbac_getexecuserprofattr(self, username, type, id, PYRBAC_USER_MODE));
++}
++
++static PyObject *
++pyrbac_getexecprof(PyObject* self, PyObject* args) {
++
++ char* profname = NULL;
++ char* type = NULL;
++ char* id = NULL;
++
++ if(!PyArg_ParseTuple(args, "sss:getexecprof", &profname, &type, &id))
++ return NULL;
++
++ return (pyrbac_getexecuserprofattr(self, profname, type, id, PYRBAC_PROF_MODE));
++}
++
++static PyObject*
++pyrbac_getexecattr(PyObject* self, PyObject* args) {
++ return pyrbac_getexecuserprofattr(self, NULL, NULL, NULL, PYRBAC_ATTR_MODE);
++}
++
++static PyObject*
++pyrbac_execattr_next(PyObject* self, PyObject* args) {
++ PyObject* retval = pyrbac_getexecattr(self, args);
++ if( retval == Py_None ) {
++ setexecattr();
++ return NULL;
++ }
++ return retval;
++}
++static PyObject*
++pyrbac_execattr__iter__(PyObject* self, PyObject* args) {
++ return self;
++}
++
++typedef struct {
++ PyObject_HEAD
++} Execattr;
++
++static void
++Execattr_dealloc(Execattr* self) {
++ endexecattr();
++ self->ob_type->tp_free((PyObject*) self);
++}
++
++static PyObject*
++Execattr_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
++ Execattr *self;
++ self = (Execattr*)type->tp_alloc(type, 0);
++
++ return ((PyObject *) self);
++}
++
++static int
++Execattr_init(Execattr* self, PyObject *args, PyObject *kwargs) {
++ setexecattr();
++ return 0;
++}
++
++static char pyrbac_execattr__doc__[];
++
++PyDoc_STRVAR(pyrbac_execattr__doc__, "provides functions for \
++interacting with the execution profiles database. May be iterated over to \
++enumerate exec_attr(4) entries\n\n\
++Methods provided:\n\
++setexecattr\n\
++endexecattr\n\
++getexecattr\n\
++getexecprof\n\
++getexecuser");
++
++
++static char pyrbac_getexecuser__doc__[];
++static char pyrbac_getexecprof__doc__[];
++static char pyrbac_getexecattr__doc__[];
++static char pyrbac_setexecattr__doc__[];
++static char pyrbac_endexecattr__doc__[];
++
++PyDoc_STRVAR(pyrbac_setexecattr__doc__,
++"\"rewinds\" the exec_attr functions to the first entry in the db. Called \
++automatically by the constructor.\n\
++\tArguments: None\
++\tReturns: None");
++
++PyDoc_STRVAR(pyrbac_endexecattr__doc__,
++"closes the exec_attr database, cleans up storage. called automatically by \
++the destructor.\n\
++\tArguments: None\
++\tReturns: None");
++
++PyDoc_STRVAR(pyrbac_getexecuser__doc__, "corresponds with getexecuser(3SECDB)\
++\nTakes: \'username\', \'type\', \'id\'\n\
++Return: a single exec_attr entry\n\
++\tArguments: None\n\
++\tReturns: a dict representation of an execattr_t struct:\n\
++\t\t\"name\": Authorization Name\n\
++\t\t\"type\": Profile Type\n\
++\t\t\"policy\": Policy attributes are relevant in\n\
++\t\t\"res1\": reserved\n\
++\t\t\"res2\": reserved\n\
++\t\t\"id\": unique identifier\n\
++\t\t\"attributes\": A Python dict keyed by attribute & valued as\
++either a list or a string depending on value");
++
++PyDoc_STRVAR(pyrbac_getexecprof__doc__, "corresponds with getexecprof(3SECDB)\
++\nTakes: \'profile name\', \'type\', \'id\'\n\
++\tReturns: a dict representation of an execattr_t struct:\n\
++\t\t\"name\": Authorization Name\n\
++\t\t\"type\": Profile Type\n\
++\t\t\"policy\": Policy attributes are relevant in\n\
++\t\t\"res1\": reserved\n\
++\t\t\"res2\": reserved\n\
++\t\t\"id\": unique identifier\n\
++\t\t\"attributes\": A Python dict keyed by attribute & valued as\
++either a list or a string depending on value");
++
++PyDoc_STRVAR(pyrbac_getexecattr__doc__, "corresponds with getexecattr(3SECDB)\
++\nTakes 0 arguments\n\
++\tReturns: a dict representation of an execattr_t struct:\n\
++\t\t\"name\": Authorization Name\n\
++\t\t\"type\": Profile Type\n\
++\t\t\"policy\": Policy attributes are relevant in\n\
++\t\t\"res1\": reserved\n\
++\t\t\"res2\": reserved\n\
++\t\t\"id\": unique identifier\n\
++\t\t\"attributes\": A Python dict keyed by attribute & valued as\
++either a list or a string depending on value");
++
++static PyMethodDef Execattr_methods[] = {
++ {"setexecattr", pyrbac_setexecattr, METH_NOARGS, pyrbac_setexecattr__doc__},
++ {"endexecattr", pyrbac_endexecattr, METH_NOARGS, pyrbac_endexecattr__doc__},
++ {"getexecprof", pyrbac_getexecprof, METH_VARARGS, pyrbac_getexecprof__doc__},
++ {"getexecuser", pyrbac_getexecuser, METH_VARARGS, pyrbac_getexecuser__doc__},
++ {"getexecattr", pyrbac_getexecattr, METH_NOARGS, pyrbac_getexecattr__doc__},
++ {NULL}
++};
++
++PyTypeObject ExecattrType = {
++ PyObject_HEAD_INIT(NULL)
++ 0, /*ob_size*/
++ "rbac.execattr", /*tp_name*/
++ sizeof(Execattr), /*tp_basicsize*/
++ 0, /*tp_itemsize*/
++ (destructor)Execattr_dealloc, /*tp_dealloc*/
++ 0, /*tp_print*/
++ 0, /*tp_getattr*/
++ 0, /*tp_setattr*/
++ 0, /*tp_compare*/
++ 0, /*tp_repr*/
++ 0, /*tp_as_number*/
++ 0, /*tp_as_sequence*/
++ 0, /*tp_as_mapping*/
++ 0, /*tp_hash */
++ 0, /*tp_call*/
++ 0, /*tp_str*/
++ 0, /*tp_getattro*/
++ 0, /*tp_setattro*/
++ 0, /*tp_as_buffer*/
++ Py_TPFLAGS_DEFAULT |
++ Py_TPFLAGS_BASETYPE |
++ Py_TPFLAGS_HAVE_ITER, /*tp_flags*/
++ pyrbac_execattr__doc__, /* tp_doc */
++ 0, /* tp_traverse */
++ 0, /* tp_clear */
++ 0, /* tp_richcompare */
++ 0, /* tp_weaklistoffset */
++ pyrbac_execattr__iter__, /* tp_iter */
++ pyrbac_execattr_next, /* tp_iternext */
++ Execattr_methods, /* tp_methods */
++ 0, /* tp_members */
++ 0, /* tp_getset */
++ 0, /* tp_base */
++ 0, /* tp_dict */
++ 0, /* tp_descr_get */
++ 0, /* tp_descr_set */
++ 0, /* tp_dictoffset */
++ (initproc)Execattr_init, /* tp_init */
++ 0, /* tp_alloc */
++ Execattr_new, /* tp_new */
++};
+diff --git Python-2.6.4/Modules/privileges.c Python-2.6.4/Modules/privileges.c
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/Modules/privileges.c
+@@ -0,0 +1,230 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++
++/*
++ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++/*
++ * privileges(5) bindings for Python
++ */
++
++#include <priv.h>
++#include "Python.h"
++
++static PyObject *
++pyprivileges_setppriv( PyObject *self, PyObject *args) {
++ priv_op_t op = -1 ;
++ priv_ptype_t which = NULL;
++
++ PyObject* set_list = NULL;
++
++ priv_set_t * set = NULL;
++
++ if(!PyArg_ParseTuple(args, "iiO:setppriv", &op, &which, &set_list))
++ return NULL;
++
++ if((op != PRIV_ON && op != PRIV_OFF && op != PRIV_SET) ||
++ (which != PRIV_PERMITTED && which != PRIV_EFFECTIVE &&
++ which != PRIV_INHERITABLE && which != PRIV_LIMIT))
++ return NULL;
++
++ PyObject* set_string = PyList_GetItem(set_list, 0);
++ int i;
++ for (i = 1; i < PyList_Size(set_list); ++i) {
++ PyString_Concat(&set_string, PyString_FromString(","));
++ PyString_Concat(&set_string, PyList_GetItem(set_list, i));
++ }
++
++ set = priv_str_to_set(PyString_AsString(set_string), ",", NULL );
++
++ if ( set == NULL )
++ return NULL;
++
++ long ret = (long) setppriv(op, which, set);
++ priv_freeset(set);
++ // Python inverts true & false
++ if(ret)
++ Py_RETURN_FALSE;
++
++ Py_RETURN_TRUE;
++}
++
++static PyObject *
++pyprivileges_getppriv( PyObject *self, PyObject *args) {
++
++ char* set_str = NULL;
++ priv_ptype_t which = NULL;
++ priv_set_t * set = priv_allocset();
++ if (set == NULL)
++ return NULL;
++
++ if(!PyArg_ParseTuple(args, "i:getppriv", &which))
++ return NULL;
++
++ if (which != PRIV_PERMITTED && which != PRIV_EFFECTIVE &&
++ which != PRIV_INHERITABLE && which != PRIV_LIMIT)
++ return NULL;
++
++ if (getppriv(which, set) != 0)
++ return NULL;
++
++ set_str = priv_set_to_str(set, ',', PRIV_STR_LIT);
++ priv_freeset(set);
++
++ PyObject* set_list = PyList_New(NULL);
++ char* saveptr;
++ char* item = strtok_r(set_str, ",", &saveptr);
++ PyList_Append(set_list, PyString_FromString(item));
++
++ while((item = strtok_r(NULL, ",", &saveptr)) != NULL) {
++ if(PyList_Append(set_list, PyString_FromString(item)) != 0) {
++ Py_XDECREF(set_list);
++ return NULL;
++ }
++ }
++
++ return(set_list);
++}
++
++static PyObject *
++pyprivileges_priv_inverse( PyObject *self, PyObject *args ) {
++
++ PyObject* set_list_in = NULL;
++ if(!PyArg_ParseTuple(args, "O:priv_inverse", &set_list_in))
++ return NULL;
++
++ PyObject* set_string = PyList_GetItem(set_list_in, 0);
++ int i;
++ for (i = 1; i < PyList_Size(set_list_in); ++i) {
++ PyString_Concat(set_string, PyString_FromString(","));
++ PyString_Concat(set_string, PyList_GetItem(set_list_in, i));
++ }
++
++ priv_set_t * set = priv_str_to_set(PyString_AsString(set_string), ",", NULL);
++ if (set == NULL)
++ return NULL;
++ priv_inverse(set);
++ char * ret_str = priv_set_to_str(set, ',', PRIV_STR_LIT);
++ priv_freeset(set);
++
++ PyObject* set_list_out = PyList_New(NULL);
++ char* saveptr;
++ char* item = strtok_r(ret_str, ",", &saveptr);
++ PyList_Append(set_list_out, PyString_FromString(item));
++
++ while((item = strtok_r(NULL, ",", &saveptr)) != NULL) {
++ if(PyList_Append(set_list_out, PyString_FromString(item)) != 0) {
++ Py_XDECREF(set_list_out);
++ return NULL;
++ }
++ }
++
++ Py_XDECREF(set_list_in);
++
++ return(set_list_out);
++}
++
++/* priv_ineffect is a convienient wrapper to priv_get
++ * however priv_set is, in the context of python, not
++ * much of a convienience, so it's omitted
++ */
++static PyObject *
++pyprivileges_priv_ineffect(PyObject* self, PyObject* args) {
++ char* privstring=NULL;
++ if (!PyArg_ParseTuple(args, "s:priv_ineffect", &privstring))
++ return NULL;
++ return PyBool_FromLong(priv_ineffect(privstring));
++}
++
++
++static char pyprivileges__doc__[];
++PyDoc_STRVAR(pyprivileges__doc__,
++"Provides functions for interacting with the Solaris privileges(5) framework\n\
++Functions provided:\n\
++setppriv\n\
++getppriv\n\
++priv_ineffect\n\
++priv_inverse");
++
++static char pyprivileges_setppriv__doc__[];
++static char pyprivileges_getppriv__doc__[];
++static char pyprivileges_priv_ineffect__doc__[];
++static char pyprivileges_priv_inverse__doc__[];
++
++PyDoc_STRVAR(pyprivileges_setppriv__doc__,
++"Facilitates setting the permitted/inheritable/limit/effective privileges set\n\
++\tArguments:\n\
++\t\tone of (PRIV_ON|PRIV_OFF|PRIV_SET)\n\
++\t\tone of (PRIV_PERMITTED|PRIV_INHERITABLE|PRIV_LIMIT|PRIV_EFFECTIVE)\n\
++\t\tset of privileges: a list of strings\n\
++\tReturns: True on success, False on failure\
++");
++
++PyDoc_STRVAR(pyprivileges_getppriv__doc__,
++"Return the process privilege set\n\
++\tArguments:\n\
++\t\tone of (PRIV_PERMITTED|PRIV_INHERITABLE|PRIV_LIMIT|PRIV_EFFECTIVE)\n\
++\tReturns: a Python list of strings");
++
++PyDoc_STRVAR(pyprivileges_priv_ineffect__doc__,
++"Checks for a privileges presence in the effective set\n\
++\tArguments: a String\n\
++\tReturns: True if the privilege is in effect, False otherwise");
++
++PyDoc_STRVAR(pyprivileges_priv_inverse__doc__,
++"The complement of the set of privileges\n\
++\tArguments: a list of strings\n\tReturns: a list of strings");
++
++static PyMethodDef module_methods[] = {
++ {"setppriv", pyprivileges_setppriv, METH_VARARGS, pyprivileges_setppriv__doc__},
++ {"getppriv", pyprivileges_getppriv, METH_VARARGS, pyprivileges_getppriv__doc__},
++ {"priv_ineffect", pyprivileges_priv_ineffect, METH_VARARGS, pyprivileges_priv_ineffect__doc__},
++ {"priv_inverse", pyprivileges_priv_inverse, METH_VARARGS, pyprivileges_priv_inverse__doc__},
++ {NULL}
++};
++
++
++#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
++#define PyMODINIT_FUNC void
++#endif
++PyMODINIT_FUNC
++initprivileges(void) {
++ PyObject* m;
++
++ m = Py_InitModule3("privileges", module_methods, pyprivileges__doc__);
++ if ( m == NULL )
++ return;
++
++ PyObject* d = PyModule_GetDict(m);
++ if (d == NULL)
++ return;
++
++ PyDict_SetItemString(d, "PRIV_ON", PyInt_FromLong((long)PRIV_ON));
++ PyDict_SetItemString(d, "PRIV_OFF", PyInt_FromLong((long)PRIV_OFF));
++ PyDict_SetItemString(d, "PRIV_SET", PyInt_FromLong((long)PRIV_SET));
++
++ PyDict_SetItemString(d, "PRIV_PERMITTED", PyInt_FromLong((long)PRIV_PERMITTED));
++ PyDict_SetItemString(d, "PRIV_INHERITABLE", PyInt_FromLong((long)PRIV_INHERITABLE));
++ PyDict_SetItemString(d, "PRIV_LIMIT", PyInt_FromLong((long)PRIV_LIMIT));
++ PyDict_SetItemString(d, "PRIV_EFFECTIVE", PyInt_FromLong((long)PRIV_EFFECTIVE));
++}
+diff --git Python-2.6.4/Modules/pyrbac.c Python-2.6.4/Modules/pyrbac.c
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/Modules/pyrbac.c
+@@ -0,0 +1,69 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++
++/*
++ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++/*
++ * RBAC Bindings for Python
++ */
++
++#include <Python.h>
++#include "pyrbac.h"
++
++static PyMethodDef module_methods[] = {NULL};
++static char pyrbac__doc__[];
++
++PyDoc_STRVAR(pyrbac__doc__, "provides access to some objects \
++for interaction with the Solaris Role-Based Access Control \
++framework.\n\nDynamic objects:\n\
++userattr -- for interacting with user_attr(4)\n\
++authattr -- for interacting with auth_attr(4)\n\
++execattr -- for interacting with exec_attr(4)\n");
++
++#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */
++#define PyMODINIT_FUNC void
++#endif
++PyMODINIT_FUNC
++initrbac(void) {
++ PyObject* m;
++ if (PyType_Ready(&AuthattrType) < 0 ||
++ PyType_Ready(&ExecattrType) < 0 ||
++ PyType_Ready(&UserattrType) < 0 )
++ return;
++
++ m = Py_InitModule3("rbac", module_methods, pyrbac__doc__);
++ if ( m == NULL )
++ return;
++
++ Py_INCREF(&AuthattrType);
++ PyModule_AddObject(m, "authattr", (PyObject*)&AuthattrType);
++
++ Py_INCREF(&ExecattrType);
++ PyModule_AddObject(m, "execattr", (PyObject*)&ExecattrType);
++
++ Py_INCREF(&UserattrType);
++ PyModule_AddObject(m, "userattr", (PyObject*)&UserattrType);
++
++}
++
+diff --git Python-2.6.4/Modules/pyrbac.h Python-2.6.4/Modules/pyrbac.h
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/Modules/pyrbac.h
+@@ -0,0 +1,46 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++
++/*
++ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++/*
++ * RBAC bindings for python
++ */
++#ifndef PYRBAC_H
++#define PYRBAC_H
++
++#include <secdb.h>
++
++
++#define PYRBAC_USER_MODE 1
++#define PYRBAC_PROF_MODE 2
++#define PYRBAC_ATTR_MODE 3
++#define PYRBAC_NAM_MODE 4
++#define PYRBAC_UID_MODE 5
++
++PyTypeObject AuthattrType;
++PyTypeObject ExecattrType;
++PyTypeObject UserattrType;
++
++#endif
+diff --git Python-2.6.4/Modules/userattr.c Python-2.6.4/Modules/userattr.c
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/Modules/userattr.c
+@@ -0,0 +1,309 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++
++/*
++ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++/*
++ * RBAC Bindings for Python - user_attr functions
++ */
++
++#include <stdio.h>
++#include <user_attr.h>
++#include "Python.h"
++#include "pyrbac.h"
++
++static PyObject*
++pyrbac_setuserattr(PyObject* self, PyObject* args) {
++ setuserattr();
++ return Py_None;
++}
++
++static PyObject*
++pyrbac_enduserattr(PyObject* self, PyObject* args) {
++ enduserattr();
++ return Py_None;
++}
++
++PyObject*
++pyrbac_getuseruidnamattr(PyObject* self, void* arg, int mode, char* filename) {
++
++ userattr_t *ret_userattr;
++
++ if (mode == PYRBAC_ATTR_MODE) {
++ if (filename != NULL) {
++ FILE* file = fopen(filename, "r");
++ if (file == NULL)
++ return NULL;
++ ret_userattr = fgetuserattr(file);
++ if (fclose(file))
++ return NULL;
++ }
++ else
++ ret_userattr = getuserattr();
++ }
++ else if (mode == PYRBAC_NAM_MODE)
++ ret_userattr = getusernam((char*) arg);
++ else if (mode == PYRBAC_UID_MODE)
++ ret_userattr = getuseruid(*((uid_t*) arg));
++
++ if (ret_userattr == NULL)
++ return Py_None;
++
++ PyObject* entry = PyTuple_New(5);
++ if (entry == NULL) {
++ free_userattr(ret_userattr);
++ return NULL;
++ }
++
++ PyObject* kv_data = PyDict_New();
++
++ if(ret_userattr->attr != NULL) {
++ int len;
++ for(len = 0; len < ret_userattr->attr->length; len++) {
++ kv_t current = ret_userattr->attr->data[len];
++
++ PyObject* set = PyList_New(NULL);
++ char* saveptr;
++ char* item = strtok_r(current.value, ",", &saveptr);
++ PyList_Append(set, PyString_FromString(item));
++
++ while((item = strtok_r(NULL, ",", &saveptr)) != NULL) {
++ if(PyList_Append(set, PyString_FromString(item)) != 0) {
++ Py_XDECREF(set);
++ Py_XDECREF(kv_data);
++ free_userattr(ret_userattr);
++ return NULL;
++ }
++ }
++ if(PyDict_SetItemString(kv_data, current.key, set)) {
++ free_userattr(ret_userattr);
++ return NULL;
++ }
++ }
++ }
++ entry = Py_BuildValue("{s:s,s:s,s:s,s:s,s:O}",
++ "name", ret_userattr->name,
++ "qualifier", ret_userattr->qualifier,
++ "res1", ret_userattr->res1,
++ "res2", ret_userattr->res2,
++ "attributes", kv_data);
++
++ free_userattr(ret_userattr);
++
++ return entry;
++}
++
++
++static PyObject*
++pyrbac_getuserattr(PyObject* self, PyObject* args) {
++ return(pyrbac_getuseruidnamattr(self, (void*) NULL, PYRBAC_ATTR_MODE, NULL));
++}
++
++static PyObject*
++pyrbac_fgetuserattr(PyObject* self, PyObject* args) {
++ char* filename = NULL;
++ if(!PyArg_ParseTuple(args, "s:fgetuserattr", &filename))
++ return NULL;
++ return(pyrbac_getuseruidnamattr(self, NULL, PYRBAC_ATTR_MODE, filename));
++}
++
++static PyObject*
++pyrbac_getusernam(PyObject* self, PyObject* args) {
++ char* name = NULL;
++ if(!PyArg_ParseTuple(args, "s:getusernam", &name))
++ return NULL;
++ return(pyrbac_getuseruidnamattr(self, (void*) name, PYRBAC_NAM_MODE, NULL));
++}
++
++static PyObject*
++pyrbac_getuseruid(PyObject* self, PyObject* args) {
++ uid_t uid;
++ if(!PyArg_ParseTuple(args, "i:getuseruid", &uid))
++ return NULL;
++ return(pyrbac_getuseruidnamattr(self, (void*) &uid, PYRBAC_UID_MODE, NULL));
++}
++
++static PyObject*
++pyrbac_userattr_next(PyObject* self, PyObject* args) {
++ PyObject* retval = pyrbac_getuserattr(self, args);
++ if( retval == Py_None ) {
++ setuserattr();
++ return NULL;
++ }
++ return retval;
++}
++static PyObject*
++pyrbac_userattr__iter__(PyObject* self, PyObject* args) {
++ return self;
++}
++
++typedef struct {
++ PyObject_HEAD
++} Userattr;
++
++static void
++Userattr_dealloc(Userattr* self) {
++ enduserattr();
++ self->ob_type->tp_free((PyObject*) self);
++}
++
++static PyObject*
++Userattr_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
++ Userattr *self;
++ self = (Userattr*)type->tp_alloc(type, 0);
++
++ return ((PyObject *) self);
++}
++
++static int
++Userattr_init(Userattr* self, PyObject *args, PyObject *kwargs) {
++ setuserattr();
++ return 0;
++}
++
++static char pyrbac_userattr__doc__[];
++PyDoc_STRVAR(pyrbac_userattr__doc__, "provides functions for \
++interacting with the extended user attributes database. May be iterated over \
++to enumerate user_attr(4) entries\n\n\
++Methods provided:\n\
++setuserattr\n\
++enduserattr\n\
++getuserattr\n\
++fgetuserattr\n\
++getusernam\n\
++getuseruid");
++
++static char pyrbac_setuserattr__doc__[];
++static char pyrbac_enduserattr__doc__[];
++static char pyrbac_getuserattr__doc__[];
++static char pyrbac_getusernam__doc__[];
++static char pyrbac_getuseruid__doc__[];
++
++PyDoc_STRVAR(pyrbac_setuserattr__doc__, "\"rewinds\" the user_attr functions \
++to the first entry in the db. Called automatically by the constructor.\n\
++\tArguments: None\n\
++\tReturns: None");
++
++PyDoc_STRVAR(pyrbac_enduserattr__doc__, "closes the user_attr database, \
++cleans up storage. called automatically by the destructor\n\
++\tArguments: None\n\
++\tReturns: None");
++
++PyDoc_STRVAR(pyrbac_getuserattr__doc__, "Return a single user_attr entry\n \
++\tArguments: None\n\
++\tReturns: a dict representation of a userattr_t struct:\n\
++\t\t\"name\": username\n\
++\t\t\"qualifier\": reserved\n\
++\t\t\"res1\": reserved\n\
++\t\t\"res2\": reserved\n\
++\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
++or a string depending on value"
++);
++
++PyDoc_STRVAR(pyrbac_fgetuserattr__doc__, "Return a single user_attr entry \
++from a file, bypassing nsswitch.conf\n\
++\tArguments: \'filename\'\n\
++\tReturns: a dict representation of a userattr_t struct:\n\
++\t\t\"name\": username\n\
++\t\t\"qualifier\": reserved\n\
++\t\t\"res1\": reserved\n\
++\t\t\"res2\": reserved\n\
++\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
++or a string depending on value");
++
++PyDoc_STRVAR(pyrbac_getusernam__doc__, "Searches for a user_attr entry with a \
++given user name\n\
++\tArgument: \'username\'\n\
++\tReturns: a dict representation of a userattr_t struct:\n\
++\t\t\"name\": username\n\
++\t\t\"qualifier\": reserved\n\
++\t\t\"res1\": reserved\n\
++\t\t\"res2\": reserved\n\
++\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
++or a string depending on value");
++
++PyDoc_STRVAR(pyrbac_getuseruid__doc__, "Searches for a user_attr entry with a \
++given uid\n\
++\tArgument: uid\n\
++\tReturns: a dict representation of a userattr_t struct:\n\
++\t\t\"name\": username\n\
++\t\t\"qualifier\": reserved\n\
++\t\t\"res1\": reserved\n\
++\t\t\"res2\": reserved\n\
++\t\t\"attributes\": A Python dict keyed by attribute & valued as either a list \
++or a string depending on value");
++
++static PyMethodDef Userattr_methods[] = {
++ {"setuserattr", pyrbac_setuserattr, METH_NOARGS, pyrbac_setuserattr__doc__},
++ {"enduserattr", pyrbac_enduserattr, METH_NOARGS, pyrbac_enduserattr__doc__},
++ {"getuserattr", pyrbac_getuserattr, METH_NOARGS, pyrbac_getuserattr__doc__},
++ {"fgetuserattr", pyrbac_fgetuserattr, METH_VARARGS, pyrbac_fgetuserattr__doc__},
++ {"getusernam", pyrbac_getusernam, METH_VARARGS, pyrbac_getusernam__doc__},
++ {"getuseruid", pyrbac_getuseruid, METH_VARARGS, pyrbac_getuseruid__doc__},
++ {NULL}
++};
++
++PyTypeObject UserattrType = {
++ PyObject_HEAD_INIT(NULL)
++ 0, /*ob_size*/
++ "rbac.userattr", /*tp_name*/
++ sizeof(Userattr), /*tp_basicsize*/
++ 0, /*tp_itemsize*/
++ (destructor)Userattr_dealloc, /*tp_dealloc*/
++ 0, /*tp_print*/
++ 0, /*tp_getattr*/
++ 0, /*tp_setattr*/
++ 0, /*tp_compare*/
++ 0, /*tp_repr*/
++ 0, /*tp_as_number*/
++ 0, /*tp_as_sequence*/
++ 0, /*tp_as_mapping*/
++ 0, /*tp_hash */
++ 0, /*tp_call*/
++ 0, /*tp_str*/
++ 0, /*tp_getattro*/
++ 0, /*tp_setattro*/
++ 0, /*tp_as_buffer*/
++ Py_TPFLAGS_DEFAULT |
++ Py_TPFLAGS_BASETYPE |
++ Py_TPFLAGS_HAVE_ITER, /*tp_flags*/
++ pyrbac_userattr__doc__, /* tp_doc */
++ 0, /* tp_traverse */
++ 0, /* tp_clear */
++ 0, /* tp_richcompare */
++ 0, /* tp_weaklistoffset */
++ pyrbac_userattr__iter__, /* tp_iter */
++ pyrbac_userattr_next, /* tp_iternext */
++ Userattr_methods, /* tp_methods */
++ 0, /* tp_members */
++ 0, /* tp_getset */
++ 0, /* tp_base */
++ 0, /* tp_dict */
++ 0, /* tp_descr_get */
++ 0, /* tp_descr_set */
++ 0, /* tp_dictoffset */
++ (initproc)Userattr_init, /* tp_init */
++ 0, /* tp_alloc */
++ Userattr_new, /* tp_new */
++};
+diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
+--- Python-2.6.4/setup.py
++++ Python-2.6.4/setup.py
+@@ -1290,6 +1290,22 @@
+ exts.append( Extension('dlpi', ['dlpimodule.c'],
+ libraries = ['dlpi']) )
+
++ # privileges module (Solaris)
++ priv_inc = find_file('priv.h', [], inc_dirs)
++ if priv_inc is not None:
++ exts.append( Extension('privileges', ['privileges.c']))
++
++ # rbac module (Solaris)
++ secdb_inc = find_file('secdb.h', [], inc_dirs)
++ aa_inc = find_file('auth_attr.h', [], inc_dirs)
++ ea_inc = find_file('exec_attr.h', [], inc_dirs)
++ ua_inc = find_file('user_attr.h', [], inc_dirs)
++ if secdb_inc is not None and aa_inc is not None and \
++ ea_inc is not None and ua_inc is not None:
++ exts.append( Extension('rbac', ['pyrbac.c', 'authattr.c', \
++ 'execattr.c', 'userattr.c'],
++ libraries = ['nsl', 'socket', 'secdb']) )
++
+ # Thomas Heller's _ctypes module
+ self.detect_ctypes(inc_dirs, lib_dirs)
+
+diff --git Python-2.6.4/Lib/test/privrbac.py Python-2.6.4/Lib/test/privrbac.py
+new file mode 100644
+--- /dev/null 2011-02-12 03:13:57.000000000 -0600
++++ Python-2.6.4/Lib/test/privrbactest.py 2011-01-20 13:52:42.862305331 -0600
+@@ -0,0 +1,290 @@
++#!/usr/bin/python2.6
++#
++# CDDL HEADER START
++#
++# The contents of this file are subject to the terms of the
++# Common Development and Distribution License (the "License").
++# You may not use this file except in compliance with the License.
++#
++# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++# or http://www.opensolaris.org/os/licensing.
++# See the License for the specific language governing permissions
++# and limitations under the License.
++#
++# When distributing Covered Code, include this CDDL HEADER in each
++# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++# If applicable, add the following below this CDDL HEADER, with the
++# fields enclosed by brackets "[]" replaced with your own identifying
++# information: Portions Copyright [yyyy] [name of copyright owner]
++#
++# CDDL HEADER END
++#
++
++# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
++# Use is subject to license terms.
++
++import privileges
++import rbac
++import os
++import sys
++import tempfile
++
++# privileges tests
++
++def test_setppriv():
++ amchild = os.fork()
++ if amchild == 0:
++ if privileges.setppriv(privileges.PRIV_OFF, privileges.PRIV_EFFECTIVE,
++ ['proc_fork']):
++ try:
++ os.fork()
++ sys.exit(1)
++ except OSError, e:
++ sys.exit(0)
++
++ child = os.wait()
++ if child[1] is not 0:
++ print "setppriv. Bad exit status from pid %i\n" % child[0]
++ return False
++ return True
++
++def test_getppriv():
++ if 'proc_fork' in privileges.getppriv(privileges.PRIV_LIMIT):
++ return True
++ print "getppriv or PRIV_PROC_FORK not in PRIV_LIMIT.\n"
++ return False
++
++def test_priv_ineffect():
++ if privileges.priv_ineffect('proc_fork'):
++ return True
++ print "priv_ineffect or PRIV_PROC_FORK not in effect\n"
++ return False
++
++# authattr tests
++
++def test_chkauthattr():
++ try:
++ a = rbac.authattr()
++ except Exception, e:
++ print "Could not instantiate authattr object: %s\n" % e
++ return False
++ try:
++ res = a.chkauthattr('solaris.*', 'root')
++ except Exception, e:
++ print "chkauthattr failed: %s\n" % e
++ return False
++ if not res:
++ print "chkauthattr failed or \'root\' lacks \'solaris.*\'\n"
++ return False
++ return True
++
++def test_getauthattr():
++ try:
++ a = rbac.authattr()
++ except Exception, e:
++ print "Could not instantiate authattr object: %s\n" % e
++ return False
++ try:
++ res = a.getauthattr()
++ except Exception, e:
++ print "getauthattr failed: %s\n" % e
++ return False
++ if not 'name' in res.keys():
++ print "getauthattr failed\n"
++ return False
++ return True
++
++def test_getauthnam():
++ try:
++ a = rbac.authattr()
++ except Exception, e:
++ print "Could not instantiate authattr object: %s\n" % e
++ return False
++ try:
++ res = a.getauthnam('solaris.')
++ except Exception, e:
++ print "getauthnam failed: %s\n" % e
++ return False
++ if not res:
++ print "getauthnam failed or \'solaris.\' not in auth_attr(4)\n"
++ return False
++ return True
++
++def test_authattr_iter():
++ try:
++ a = rbac.authattr()
++ except Exception, e:
++ print "Could not instantiate authattr object: %s\n" % e
++ return False
++ res = a.next()
++ if not 'name' in res.keys() or type(a) != type(a.__iter__()):
++ print "authattr object is not an iterable\n"
++ return False
++ return True
++
++# execattr tests
++
++def test_getexecattr():
++ try:
++ a = rbac.execattr()
++ except Exception, e:
++ print "Could not instantiate execattr object: %s\n" % e
++ return False
++ try:
++ res = a.getexecattr()
++ except Exception, e:
++ print "getexecattr failed: %s\n" % e
++ return False
++ if not 'name' in res.keys():
++ print "getexecattr failed\n"
++ return False
++ return True
++
++def test_getexecuser():
++ try:
++ a = rbac.execattr()
++ except Exception, e:
++ print "Could not instantiate execattr object: %s\n" % e
++ return False
++ try:
++ res = a.getexecuser("root", "act", "*;*;*;*;*")
++ except Exception, e:
++ print "getexecuser failed: %s\n" % e
++ return False
++ if not res:
++ print "getexecuser failed or \'root\' not assigned to \'act\', " \
++ "\'*;*;*;*;*\' \n"
++ return False
++ return True
++
++
++def test_getexecprof():
++ try:
++ a = rbac.execattr()
++ except Exception, e:
++ print "Could not instantiate execattr object: %s\n" % e
++ return False
++ try:
++ res = a.getexecprof("All", "cmd", "*")
++ except Exception, e:
++ print "getexecprof failed: %s\n" % e
++ return False
++ if not res:
++ print "getexecprof failed or \'All\' not granted \'cmd\' : \'*\'\n"
++ return False
++ return True
++
++def test_execattr_iter():
++ try:
++ a = rbac.execattr()
++ except Exception, e:
++ print "Could not instantiate execattr object: %s\n" % e
++ return False
++ res = a.next()
++ if not 'name' in res.keys() or type(a) != type(a.__iter__()):
++ print "execattr object is not an iterable\n"
++ return False
++ return True
++
++# userattr tests
++
++def test_getuserattr():
++ try:
++ a = rbac.userattr()
++ except Exception, e:
++ print "Could not instantiate userattr object: %s\n" % e
++ return False
++ try:
++ res = a.getuserattr()
++ except Exception, e:
++ print "getuserattr failed: %s\n" % e
++ return False
++ if not 'name' in res.keys():
++ print "getuserattr failed\n"
++ return False
++ return True
++
++def test_fgetuserattr():
++ temp = tempfile.NamedTemporaryFile()
++ temp.write("user::::profiles=Software Installation;roles=foo;"\
++ "auths=solaris.foo.bar")
++ temp.seek(0)
++ try:
++ a = rbac.userattr()
++ except Exception, e:
++ print "Could not instantiate userattr object: %s\n" % e
++ return False
++ try:
++ res = a.fgetuserattr(temp.name)
++ temp.close()
++ except Exception, e:
++ print "fgetuserattr failed: %s\n" % e
++ temp.close()
++ return False
++ if not 'name' in res.keys():
++ print "fgetuserattr failed\n"
++ return False
++ return True
++
++def test_getuseruid():
++ try:
++ a = rbac.userattr()
++ except Exception, e:
++ print "Could not instantiate userattr object: %s\n" % e
++ return False
++ try:
++ res = a.getuseruid(0)
++ except Exception, e:
++ print "getusernam failed: %s\n" % e
++ return False
++ if not 'name' in res:
++ print "getusernam failed or no uid 0\n"
++ return False
++ return True
++
++def test_getusernam():
++ try:
++ a = rbac.userattr()
++ except Exception, e:
++ print "Could not instantiate userattr object: %s\n" % e
++ return False
++ try:
++ res = a.getusernam('root')
++ except Exception, e:
++ print "getusernam failed: %s\n" % e
++ return False
++ if not 'name' in res:
++ print "getusernam failed or no \'root\' user\n"
++ return False
++ return True
++
++def test_userattr_iter():
++ try:
++ a = rbac.userattr()
++ except Exception, e:
++ print "Could not instantiate userattr object: %s\n" % e
++ return False
++ res = a.next()
++ if not 'name' in res.keys() or type(a) != type(a.__iter__()):
++ print "userattr object is not an iterable\n"
++ return False
++ return True
++
++if not test_setppriv() or not test_getppriv() or not test_priv_ineffect():
++ print "*** Failures detected in privileges module\n"
++ sys.exit(1)
++
++if not test_getauthattr() or not test_chkauthattr() or not test_getauthnam() \
++ or not test_authattr_iter:
++ print "*** Failures detected in rbac.authattr\n"
++ sys.exit(1)
++
++if not test_getexecattr() or not test_getexecuser() or not test_getexecprof() \
++ or not test_execattr_iter():
++ print "*** Failures detected in rbac.execattr\n"
++ sys.exit(1)
++
++if not test_getuserattr() or not test_fgetuserattr() or not test_getusernam()\
++ or not test_getuseruid() or not test_userattr_iter():
++ print "*** Failures detected in rbac.userattr\n"
++ sys.exit(1)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-17-netpacket-packet-h.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,54 @@
+diff --git Python-2.6.4/Modules/socketmodule.c Python-2.6.4/Modules/socketmodule.c
+--- Python-2.6.4/Modules/socketmodule.c
++++ Python-2.6.4/Modules/socketmodule.c
+@@ -81,6 +81,14 @@
+
+ */
+
++#ifdef HAVE_NETPACKET_PACKET_H
++#ifdef sun
++#define USE_NETPACKET_PACKET_H 0
++#else
++#define USE_NETPACKET_PACKET_H 1
++#endif
++#endif
++
+ #ifdef __APPLE__
+ /*
+ * inet_aton is not available on OSX 10.3, yet we want to use a binary
+@@ -1092,7 +1100,7 @@
+ }
+ #endif
+
+-#ifdef HAVE_NETPACKET_PACKET_H
++#if USE_NETPACKET_PACKET_H
+ case AF_PACKET:
+ {
+ struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
+@@ -1382,7 +1390,7 @@
+ }
+ #endif
+
+-#ifdef HAVE_NETPACKET_PACKET_H
++#if USE_NETPACKET_PACKET_H
+ case AF_PACKET:
+ {
+ struct sockaddr_ll* addr;
+@@ -1559,7 +1567,7 @@
+ }
+ #endif
+
+-#ifdef HAVE_NETPACKET_PACKET_H
++#if USE_NETPACKET_PACKET_H
+ case AF_PACKET:
+ {
+ *len_ret = sizeof (struct sockaddr_ll);
+@@ -4578,7 +4586,7 @@
+ PyModule_AddStringConstant(m, "BDADDR_LOCAL", "00:00:00:FF:FF:FF");
+ #endif
+
+-#ifdef HAVE_NETPACKET_PACKET_H
++#if USE_NETPACKET_PACKET_H
+ PyModule_AddIntConstant(m, "AF_PACKET", AF_PACKET);
+ PyModule_AddIntConstant(m, "PF_PACKET", PF_PACKET);
+ PyModule_AddIntConstant(m, "PACKET_HOST", PACKET_HOST);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-18-readline.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,31 @@
+diff --git Python-2.6.4/setup.py Python-2.6.4/setup.py
+--- Python-2.6.4/setup.py
++++ Python-2.6.4/setup.py
+@@ -572,6 +572,14 @@
+ # This way a staticly linked custom readline gets picked up
+ # before the (broken) dynamic library in /usr/lib.
+ readline_extra_link_args = ('-Wl,-search_paths_first',)
++ elif sys.platform == 'sunos5':
++ if sys.maxint != 9223372036854775807L:
++ readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib,-R/usr/gnu/lib,-lreadline,-lncurses',)
++ else:
++ if os.path.exists('/usr/gnu/lib/sparcv9'):
++ readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib/sparcv9,-R/usr/gnu/lib/sparcv9,-lreadline,-lncurses',)
++ else:
++ readline_extra_link_args = ('-Wl,-zrecord,-L/usr/gnu/lib/amd64,-R/usr/gnu/lib/amd64,-lreadline,-lncurses',)
+ else:
+ readline_extra_link_args = ()
+
+@@ -588,6 +596,12 @@
+ ['/usr/lib/termcap'],
+ 'termcap'):
+ readline_libs.append('termcap')
++
++ if sys.platform == 'sunos5':
++ # ugly hack to make the build respect -zrecord set in
++ # readline_extra_link_args above
++ readline_libs = []
++
+ exts.append( Extension('readline', ['readline.c'],
+ library_dirs=['/usr/lib/termcap'],
+ extra_link_args=readline_extra_link_args,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-19-ext-stdio.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,34 @@
+diff --git Python-2.6.4/Modules/python.c Python-2.6.4/Modules/python.c
+--- Python-2.6.4/Modules/python.c
++++ Python-2.6.4/Modules/python.c
+@@ -6,6 +6,13 @@
+ #include <floatingpoint.h>
+ #endif
+
++#if defined(sun) && defined(__SVR4) && !defined(_LP64)
++#define USE_EXTENDED_FILE_STDIO 1
++#include <stdio.h>
++#include <stdio_ext.h>
++#include <signal.h>
++#endif
++
+ int
+ main(int argc, char **argv)
+ {
+@@ -20,5 +27,16 @@
+ m = fpgetmask();
+ fpsetmask(m & ~FP_X_OFL);
+ #endif
++#ifdef USE_EXTENDED_FILE_STDIO
++ /* enable extended FILE facility on Solaris so that Python
++ apps can keep more than 256 file descriptors open */
++ struct rlimit rlp;
++ (void) getrlimit(RLIMIT_NOFILE, &rlp);
++ rlp.rlim_cur = rlp.rlim_max;
++ if (setrlimit(RLIMIT_NOFILE, &rlp) != -1) {
++ enable_extended_FILE_stdio(-1, SIGABRT);
++ }
++#endif
++
+ return Py_Main(argc, argv);
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-20-py_db.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,1047 @@
+diff --git Python-2.6.4/Makefile.pre.in.orig Python-2.6.4/Makefile.pre.in
+--- Python-2.6.4/Makefile.pre.in.orig Sun Feb 13 19:37:16 2011
++++ Python-2.6.4/Makefile.pre.in Sun Feb 13 20:55:04 2011
+@@ -354,7 +354,7 @@
+
+ # Default target
+ all: build_all
+-build_all: $(BUILDPYTHON) oldsharedmods sharedmods
++build_all: $(BUILDPYTHON) oldsharedmods sharedmods build-py_db
+
+ # Compile a binary with gcc profile guided optimization.
+ profile-opt:
+@@ -677,6 +677,20 @@
+
+ $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
+
++SHLIB_FLAGS = -shared -fpic -M $(srcdir)/py_db/mapfile-vers
++
++libpython2.6_db.so.1.0: $(srcdir)/py_db/libpython26_db.c
++ $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(SHLIB_FLAGS) $<
++
++check_offset: $(srcdir)/py_db/check_offsets.c
++ $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $<
++
++build-py_db: libpython2.6_db.so.1.0 check_offset
++
++install-py_db: libpython2.6_db.so.1.0 check_offset
++ $(INSTALL_SHARED) libpython2.6_db.so.1.0 $(DESTDIR)$(LIBDIR)
++ $(INSTALL_PROGRAM) check_offset $(DESTDIR)$(BINDIR)
++
+ install-pycc: $(srcdir)/pycc
+ $(INSTALL_SCRIPT $< $(DESTDIR)$(BINLIBDEST)
+
+@@ -742,7 +755,7 @@
+ $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS)
+
+ # Install everything
+-install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@ install-pycc
++install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@ install-py_db install-pycc
+
+ # Install almost everything without disturbing previous versions
+ altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \
+
+diff --git Python-2.6.4/py_db/check_offsets.c Python-2.6.4/py_db/check_offsets.c
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/py_db/check_offsets.c
+@@ -0,0 +1,88 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++/*
++ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++#include <stdio.h>
++
++#include <Python.h>
++#include <frameobject.h>
++
++#include "libpython26_db_32.h"
++
++#if 0
++#define offsetof(s, m) ((size_t)(&(((s *)0)->m)))
++#endif
++
++int
++main(void)
++{
++/*
++ * PyCodeObject co_name
++ * PyCodeObject co_filename
++ * PyCodeObject co_lnotab
++ * PyFrameObject f_back
++ * PyFrameObject f_code
++ * PyFrameObject f_lasti
++ * PyInterpreterState next
++ * PyInterpreterState tstate_head
++ * PyStringObject ob_sval
++ * PyStringObject ob_size
++ * PyThreadState frame
++ * PyThreadState next
++ */
++
++ printf("struct member: native 32\n");
++ printf("PyCodeObject co_name: %d %d\n", offsetof(PyCodeObject, co_name),
++ offsetof(PyCodeObject32, co_name));
++ printf("PyCodeObject co_filename: %d %d\n", offsetof(PyCodeObject,
++ co_filename), offsetof(PyCodeObject32, co_filename));
++ printf("PyCodeObject co_lnotab: %d %d\n", offsetof(PyCodeObject,
++ co_lnotab), offsetof(PyCodeObject32, co_lnotab));
++ printf("PyFrameObject f_back: %d %d\n", offsetof(PyFrameObject, f_back),
++ offsetof(PyFrameObject32, f_back));
++ printf("PyFrameObject f_code: %d %d\n", offsetof(PyFrameObject, f_code),
++ offsetof(PyFrameObject32, f_code));
++ printf("PyFrameObject f_lasti: %d %d\n", offsetof(PyFrameObject,
++ f_lasti), offsetof(PyFrameObject32, f_lasti));
++ printf("PyInterpreterState next: %d %d\n", offsetof(PyInterpreterState,
++ next), offsetof(PyInterpreterState32, next));
++ printf("PyInterpreterState tstate_head: %d %d\n",
++ offsetof(PyInterpreterState, tstate_head),
++ offsetof(PyInterpreterState32, tstate_head));
++ printf("PyStringObject ob_sval: %d %d\n", offsetof(PyStringObject,
++ ob_sval), offsetof(PyStringObject32, ob_sval));
++ printf("PyStringObject ob_size: %d %d\n", offsetof(PyStringObject,
++ ob_size), offsetof(PyStringObject32, ob_size));
++ printf("PyThreadState frame: %d %d\n", offsetof(PyThreadState, frame),
++ offsetof(PyThreadState32, frame));
++ printf("PyThreadState next: %d %d\n", offsetof(PyThreadState, next),
++ offsetof(PyThreadState32, next));
++
++ printf("\nObject sizes\n");
++ printf("PyObject: %d %d\n", sizeof (PyObject), sizeof (PyObject32));
++ printf("PyVarObject: %d %d\n", sizeof (PyVarObject),
++ sizeof (PyVarObject32));
++
++ return (0);
++}
+diff --git Python-2.6.4/py_db/libpython26_db.c Python-2.6.4/py_db/libpython26_db.c
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/py_db/libpython26_db.c
+@@ -0,0 +1,655 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++/*
++ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <errno.h>
++#include <gelf.h>
++
++#include <Python.h>
++#include <frameobject.h>
++
++#include "libpython26_db.h"
++#if defined(_LP64)
++#include "libpython26_db_32.h"
++#endif /* _LP64 */
++
++/*
++ * Because MDB always runs the debugger in the same datamodel as the target,
++ * only functions that are used by the procfs part of this interface (or shared
++ * between the two) are written as 64->32 aware.
++ */
++typedef struct pydb_arch_ops {
++ ssize_t (*strobj_readdata)(pydb_agent_t *, uintptr_t, unsigned char *,
++ size_t);
++ int (*frameinfo)(pydb_agent_t *, uintptr_t, char *,
++ size_t, char *, size_t, int *);
++} pydb_arch_ops_t;
++
++struct pydb_agent {
++ struct ps_prochandle *pdb_ph;
++ int pdb_vers;
++ int pdb_is_64bit;
++ int pdb_datamodel;
++ const pydb_arch_ops_t *pdb_ops;
++};
++
++typedef uintptr_t (*pdi_next_cb_t)(pydb_iter_t *);
++
++struct pydb_iter {
++ struct ps_prochandle *pdi_ph;
++ uintptr_t pdi_current;
++ pdi_next_cb_t pdi_nextf;
++};
++
++#define LIBPYTHON "libpython2.6.so"
++
++#define MIN(x, y) (((x) < (y)) ? (x) : (y))
++
++/* Generic interface to helper functions */
++static ssize_t pydb_strobj_readdata(pydb_agent_t *py, uintptr_t addr,
++ unsigned char *buf, size_t buf_len);
++static int pydb_getlno(pydb_agent_t *py, uintptr_t lnotab_addr, int firstline,
++ int lastinst);
++static int pydb_frameinfo(pydb_agent_t *py, uintptr_t addr, char *funcnm,
++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno);
++
++/* datamodel specific implementation of helper functions */
++static ssize_t pydb_strobj_readdata_native(pydb_agent_t *py, uintptr_t addr,
++ unsigned char *buf, size_t buf_len);
++static int pydb_frameinfo_native(pydb_agent_t *py, uintptr_t addr, char *funcnm,
++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno);
++
++#if defined (_LP64)
++static ssize_t pydb_strobj_readdata_32(pydb_agent_t *py, uintptr_t addr,
++ unsigned char *buf, size_t buf_len);
++static int pydb_frameinfo_32(pydb_agent_t *py, uintptr_t addr, char *funcnm,
++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno);
++#endif /* _LP64 */
++
++static ssize_t pydb_strobj_readstr(pydb_agent_t *py, uintptr_t addr, char *buf,
++ size_t len);
++
++/* Iterator function next routines. Plugable, configured by iterator init */
++static uintptr_t pydb_frame_iter_next(pydb_iter_t *iter);
++static uintptr_t pydb_interp_iter_next(pydb_iter_t *iter);
++static uintptr_t pydb_thread_iter_next(pydb_iter_t *iter);
++
++static const char *strbasename(const char *s);
++
++static const pydb_arch_ops_t arch_ops_native = {
++ .frameinfo = pydb_frameinfo_native,
++ .strobj_readdata = pydb_strobj_readdata_native,
++};
++
++#if defined (_LP64)
++static const pydb_arch_ops_t arch_ops_32 = {
++ .frameinfo = pydb_frameinfo_32,
++ .strobj_readdata = pydb_strobj_readdata_32,
++};
++#endif /* _LP64 */
++
++static const char *
++strbasename(const char *s)
++{
++ const char *p = strrchr(s, '/');
++
++ if (p == NULL)
++ return (s);
++
++ return (++p);
++}
++
++/* Agent creation / destruction routines */
++
++pydb_agent_t *
++pydb_agent_create(struct ps_prochandle *P, int vers)
++{
++ pydb_agent_t *py;
++ int datamodel;
++
++ if (vers != PYDB_VERSION) {
++ errno = ENOTSUP;
++ return (NULL);
++ }
++
++ if (ps_pdmodel(P, &datamodel) != PS_OK) {
++ return (NULL);
++ }
++
++ py = (pydb_agent_t *)malloc(sizeof (pydb_agent_t));
++ if (py == NULL) {
++ return (NULL);
++ }
++
++ py->pdb_ph = P;
++ py->pdb_vers = vers;
++ py->pdb_datamodel = datamodel;
++ py->pdb_is_64bit = 0;
++ py->pdb_ops = &arch_ops_native;
++
++#if defined (_LP64)
++ py->pdb_is_64bit = (datamodel == PR_MODEL_LP64);
++ if (!py->pdb_is_64bit) {
++ py->pdb_ops = &arch_ops_32;
++ }
++#endif /* _LP64 */
++
++ return (py);
++}
++
++void
++pydb_agent_destroy(pydb_agent_t *py)
++{
++ if (py == NULL) {
++ return;
++ }
++
++ free(py);
++}
++
++/* Helper functions */
++static int
++pydb_getlno(pydb_agent_t *py, uintptr_t lnotab_addr, int firstline,
++ int lastinst)
++{
++ unsigned char lnotab[4096];
++ ssize_t lnotab_len;
++ int addr, line;
++ int i;
++
++ lnotab_len = pydb_strobj_readdata(py, lnotab_addr, lnotab,
++ sizeof (lnotab));
++ if (lnotab_len < 0) {
++ return (-1);
++ }
++
++ /*
++ * Python's line number algorithm is arcane. See here for details:
++ * http://svn.python.org/projects/python/trunk/Objects/lnotab_notes.txt
++ */
++
++ line = firstline;
++ for (addr = i = 0; i < lnotab_len; i += 2) {
++ if (addr + lnotab[i] > lastinst) {
++ break;
++ }
++ addr += lnotab[i];
++ line += lnotab[i + 1];
++ }
++
++ return (line);
++}
++
++static ssize_t
++pydb_strobj_readdata(pydb_agent_t *py, uintptr_t addr, unsigned char *buf,
++ size_t buf_len)
++{
++ return (py->pdb_ops->strobj_readdata(py, addr, buf, buf_len));
++}
++
++static ssize_t
++pydb_strobj_readdata_native(pydb_agent_t *py, uintptr_t addr,
++ unsigned char *buf, size_t buf_len)
++{
++ PyStringObject sobj;
++ ssize_t obj_sz;
++ ssize_t read_sz;
++ psaddr_t straddr;
++
++ /*
++ * PyStringObjects are variable size. The size of the PyStringObject
++ * struct is fixed, and known at compile time; however, the size of the
++ * associated buffer is variable. The char[1] element at the end of the
++ * structure contains the string, and the ob_size of the PyStringObject
++ * indicates how much extra space was allocated to contain the string
++ * buffer at the object's tail. Read in the fixed size portion of the
++ * object first, and then read the contents of the data buffer into the
++ * buffer passed by the caller.
++ */
++
++ if (ps_pread(py->pdb_ph, addr, &sobj, sizeof (PyStringObject))
++ != PS_OK) {
++ return (-1);
++ }
++
++ obj_sz = (ssize_t)PyString_GET_SIZE(&sobj);
++
++ read_sz = MIN(obj_sz, (ssize_t)buf_len);
++ straddr = (psaddr_t)(addr + offsetof(PyStringObject, ob_sval));
++
++ if (ps_pread(py->pdb_ph, straddr, buf, (size_t)read_sz) != PS_OK) {
++ return (-1);
++ }
++
++ return (read_sz);
++}
++
++#if defined(_LP64)
++static ssize_t
++pydb_strobj_readdata_32(pydb_agent_t *py, uintptr_t addr,
++ unsigned char *buf, size_t buf_len)
++{
++ PyStringObject32 sobj;
++ ssize_t obj_sz;
++ ssize_t read_sz;
++ psaddr_t straddr;
++
++ /*
++ * PyStringObjects are variable size. The size of the PyStringObject
++ * struct is fixed, and known at compile time; however, the size of the
++ * associated buffer is variable. The char[1] element at the end of the
++ * structure contains the string, and the ob_size of the PyStringObject
++ * indicates how much extra space was allocated to contain the string
++ * buffer at the object's tail. Read in the fixed size portion of the
++ * object first, and then read the contents of the data buffer into the
++ * buffer passed by the caller.
++ */
++
++ if (ps_pread(py->pdb_ph, addr, &sobj, sizeof (PyStringObject32))
++ != PS_OK) {
++ return (-1);
++ }
++
++ obj_sz = (ssize_t)PyString_GET_SIZE32(&sobj);
++
++ read_sz = MIN(obj_sz, (ssize_t)buf_len);
++ straddr = (psaddr_t)(addr + offsetof(PyStringObject32, ob_sval));
++
++ if (ps_pread(py->pdb_ph, straddr, buf, (size_t)read_sz) != PS_OK) {
++ return (-1);
++ }
++
++ return (read_sz);
++}
++#endif /* _LP64 */
++
++/*
++ * Most Python PyStringObjects contain strings, as one would expect. However,
++ * due to some sleazy hackery in parts of the Python code, some string objects
++ * are used as buffers for binary data. In the general case,
++ * pydb_strobj_readstr() should be used to read strings out of string objects.
++ * It wraps pydb_strobj_readdata(), which should be used by callers only when
++ * trying to retrieve binary data. (This routine does some string cleanup).
++ */
++static ssize_t
++pydb_strobj_readstr(pydb_agent_t *py, uintptr_t addr, char *buf,
++ size_t buf_len)
++{
++ ssize_t read_sz;
++
++ read_sz = pydb_strobj_readdata(py, addr, (unsigned char *)buf, buf_len);
++
++ if (read_sz >= 0) {
++ if (read_sz >= buf_len) {
++ read_sz = buf_len - 1;
++ }
++
++ buf[read_sz] = '\0';
++ }
++
++ return (read_sz);
++}
++
++
++static int
++pydb_frameinfo(pydb_agent_t *py, uintptr_t addr, char *funcnm,
++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno)
++{
++ return (py->pdb_ops->frameinfo(py, addr, funcnm, funcnm_sz,
++ filenm, filenm_sz, lineno));
++}
++
++static int
++pydb_frameinfo_native(pydb_agent_t *py, uintptr_t addr, char *funcnm,
++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno)
++{
++ PyFrameObject fo;
++ PyCodeObject co;
++ ssize_t rc;
++
++ if (ps_pread(py->pdb_ph, addr, &fo, sizeof (PyFrameObject))
++ != PS_OK) {
++ return (-1);
++ }
++
++ if (ps_pread(py->pdb_ph, (uintptr_t)fo.f_code, &co,
++ sizeof (PyCodeObject)) != PS_OK) {
++ return (-1);
++ }
++
++ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_name, funcnm, funcnm_sz);
++ if (rc < 0) {
++ return (-1);
++ }
++
++ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_filename, filenm,
++ filenm_sz);
++ if (rc < 0) {
++ return (-1);
++ }
++
++ *lineno = pydb_getlno(py, (uintptr_t)co.co_lnotab, co.co_firstlineno,
++ fo.f_lasti);
++ if (*lineno < 0) {
++ return (-1);
++ }
++
++ return (0);
++}
++
++#if defined (_LP64)
++static int
++pydb_frameinfo_32(pydb_agent_t *py, uintptr_t addr, char *funcnm,
++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno)
++{
++ PyFrameObject32 fo;
++ PyCodeObject32 co;
++ ssize_t rc;
++
++ if (ps_pread(py->pdb_ph, addr, &fo, sizeof (PyFrameObject32))
++ != PS_OK) {
++ return (-1);
++ }
++
++ if (ps_pread(py->pdb_ph, (uintptr_t)fo.f_code, &co,
++ sizeof (PyCodeObject32)) != PS_OK) {
++ return (-1);
++ }
++
++ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_name, funcnm, funcnm_sz);
++ if (rc < 0) {
++ return (-1);
++ }
++
++ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_filename, filenm,
++ filenm_sz);
++ if (rc < 0) {
++ return (-1);
++ }
++
++ *lineno = pydb_getlno(py, (uintptr_t)co.co_lnotab, co.co_firstlineno,
++ fo.f_lasti);
++ if (*lineno < 0) {
++ return (-1);
++ }
++
++ return (0);
++}
++
++#endif /* _LP64 */
++
++/* Functions that are part of the library's interface */
++
++/*
++ * Given the address of a PyFrameObject, and a buffer of a known size,
++ * fill the buffer with a description of the frame.
++ */
++int
++pydb_get_frameinfo(pydb_agent_t *py, uintptr_t frame_addr, char *fbuf,
++ size_t bufsz, int verbose)
++{
++ char funcname[1024];
++ char filename[1024];
++ char *fn;
++ int lineno;
++ int length = (py->pdb_is_64bit ? 16 : 8);
++ int rc;
++
++ rc = pydb_frameinfo(py, frame_addr, funcname, sizeof (funcname),
++ filename, sizeof (filename), &lineno);
++ if (rc < 0) {
++ return (-1);
++ }
++
++ if (!verbose) {
++ fn = (char *)strbasename(filename);
++ } else {
++ fn = filename;
++ }
++
++ (void) snprintf(fbuf, bufsz, "%0.*lx %s:%d %s()\n", length,
++ frame_addr, fn, lineno, funcname);
++
++ return (0);
++}
++
++/*
++ * Return a description about a PyFrameObject, if the object is
++ * actually a PyFrameObject. In this case, the pc argument is checked
++ * to make sure that it came from a function that takes a PyFrameObject
++ * as its first (argv[0]) argument.
++ */
++int
++pydb_pc_frameinfo(pydb_agent_t *py, uintptr_t pc, uintptr_t frame_addr,
++ char *fbuf, size_t bufsz)
++{
++ char funcname[1024];
++ char filename[1024];
++ int lineno;
++ int rc;
++ ps_sym_t psym;
++
++ /*
++ * If PC doesn't match PyEval_EvalFrameEx in either libpython
++ * or the executable, don't decode it.
++ */
++ if (ps_pglobal_sym(py->pdb_ph, LIBPYTHON, "PyEval_EvalFrameEx", &psym)
++ != PS_OK) {
++ return (-1);
++ }
++
++ /* If symbol found, ensure that PC falls within PyEval_EvalFrameEx. */
++ if (pc < psym.st_value || pc > psym.st_value + psym.st_size) {
++ return (-1);
++ }
++
++ rc = pydb_frameinfo(py, frame_addr, funcname, sizeof (funcname),
++ filename, sizeof (filename), &lineno);
++ if (rc < 0) {
++ return (-1);
++ }
++
++ (void) snprintf(fbuf, bufsz, "[ %s:%d (%s) ]\n", filename, lineno,
++ funcname);
++
++ return (0);
++}
++
++/*
++ * Walks the list of PyInterpreterState objects. If caller doesn't
++ * supply address of list, this method will look it up.
++ */
++pydb_iter_t *
++pydb_interp_iter_init(pydb_agent_t *py, uintptr_t addr)
++{
++ pydb_iter_t *itr;
++ uintptr_t i_addr;
++ int rc;
++
++ if (addr == 0) {
++ rc = ps_pglobal_lookup(py->pdb_ph, LIBPYTHON, "interp_head",
++ (psaddr_t *)&addr);
++ if (rc != PS_OK) {
++ return (NULL);
++ }
++ }
++
++ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &i_addr, sizeof (uintptr_t))
++ != PS_OK) {
++ return (NULL);
++ }
++
++ itr = malloc(sizeof (pydb_iter_t));
++ if (itr == NULL) {
++ return (NULL);
++ }
++
++ itr->pdi_ph = py->pdb_ph;
++ itr->pdi_current = i_addr;
++ itr->pdi_nextf = pydb_interp_iter_next;
++
++ return (itr);
++}
++
++static uintptr_t
++pydb_interp_iter_next(pydb_iter_t *iter)
++{
++ PyInterpreterState st;
++ uintptr_t cur;
++
++ cur = iter->pdi_current;
++
++ if (cur == 0) {
++ return (cur);
++ }
++
++ if (ps_pread(iter->pdi_ph, cur, &st, sizeof (PyInterpreterState))
++ != PS_OK) {
++ iter->pdi_current = 0;
++ return (0);
++ }
++
++ iter->pdi_current = (uintptr_t)st.next;
++
++ return (cur);
++}
++
++/*
++ * Walk a list of Python PyFrameObjects. The addr argument must be
++ * the address of a valid PyThreadState object.
++ */
++pydb_iter_t *
++pydb_frame_iter_init(pydb_agent_t *py, uintptr_t addr)
++{
++ pydb_iter_t *itr;
++ PyThreadState ts;
++
++ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &ts, sizeof (PyThreadState))
++ != PS_OK) {
++ return (NULL);
++ }
++
++ itr = malloc(sizeof (pydb_iter_t));
++ if (itr == NULL) {
++ return (NULL);
++ }
++
++ itr->pdi_ph = py->pdb_ph;
++ itr->pdi_current = (uintptr_t)ts.frame;
++ itr->pdi_nextf = pydb_frame_iter_next;
++
++ return (itr);
++}
++
++static uintptr_t
++pydb_frame_iter_next(pydb_iter_t *iter)
++{
++ PyFrameObject fo;
++ uintptr_t cur;
++
++ cur = iter->pdi_current;
++
++ if (cur == 0) {
++ return (cur);
++ }
++
++ if (ps_pread(iter->pdi_ph, cur, &fo, sizeof (PyFrameObject))
++ != PS_OK) {
++ iter->pdi_current = 0;
++ return (0);
++ }
++
++ iter->pdi_current = (uintptr_t)fo.f_back;
++
++ return (cur);
++}
++
++/*
++ * Walk a list of Python PyThreadState objects. The addr argument must be
++ * the address of a valid PyInterpreterState object.
++ */
++pydb_iter_t *
++pydb_thread_iter_init(pydb_agent_t *py, uintptr_t addr)
++{
++ pydb_iter_t *itr;
++ PyInterpreterState is;
++
++ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &is,
++ sizeof (PyInterpreterState)) != PS_OK) {
++ return (NULL);
++ }
++
++ itr = malloc(sizeof (pydb_iter_t));
++ if (itr == NULL) {
++ return (NULL);
++ }
++
++ itr->pdi_ph = py->pdb_ph;
++ itr->pdi_current = (uintptr_t)is.tstate_head;
++ itr->pdi_nextf = pydb_thread_iter_next;
++
++ return (itr);
++}
++
++static uintptr_t
++pydb_thread_iter_next(pydb_iter_t *iter)
++{
++ PyThreadState ts;
++ uintptr_t cur;
++
++ cur = iter->pdi_current;
++
++ if (cur == 0) {
++ return (cur);
++ }
++
++ if (ps_pread(iter->pdi_ph, cur, &ts, sizeof (PyThreadState)) != PS_OK) {
++ iter->pdi_current = 0;
++ return (0);
++ }
++
++ iter->pdi_current = (uintptr_t)ts.next;
++
++ return (cur);
++}
++
++
++uintptr_t
++pydb_iter_next(pydb_iter_t *iter)
++{
++ return (iter->pdi_nextf(iter));
++}
++
++void
++pydb_iter_fini(pydb_iter_t *iter)
++{
++ if (iter == NULL) {
++ return;
++ }
++
++ free(iter);
++}
+diff --git Python-2.6.4/py_db/libpython26_db.h Python-2.6.4/py_db/libpython26_db.h
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/py_db/libpython26_db.h
+@@ -0,0 +1,74 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++/*
++ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++#ifndef _LIBPYTHON26_DB_H
++#define _LIBPYTHON26_DB_H
++
++#include <proc_service.h>
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++/* Agent is opaque to library's consumers. */
++typedef struct pydb_agent pydb_agent_t;
++
++/*
++ * Library's debug version is 1. Changes to interface should increase this
++ * number.
++ */
++#define PYDB_VERSION 1
++
++/* Agent creation/destruction routines */
++extern pydb_agent_t *pydb_agent_create(struct ps_prochandle *P, int vers);
++extern void pydb_agent_destroy(pydb_agent_t *py);
++
++/* Used by callers that know they are looking at a PyFrameObject */
++extern int pydb_get_frameinfo(pydb_agent_t *py, uintptr_t frame_addr,
++ char *fbuf, size_t bufsz, int verbose);
++
++/*
++ * Used by callers that don't know if they're looking at PyFrameObject.
++ * Checks PC for traceable functions.
++ */
++extern int pydb_pc_frameinfo(pydb_agent_t *py, uintptr_t pc,
++ uintptr_t frame_addr, char *fbuf, size_t bufsz);
++
++/* Iterator functions */
++typedef struct pydb_iter pydb_iter_t;
++
++extern pydb_iter_t *pydb_frame_iter_init(pydb_agent_t *py, uintptr_t addr);
++extern pydb_iter_t *pydb_interp_iter_init(pydb_agent_t *py,
++ uintptr_t addr);
++extern pydb_iter_t *pydb_thread_iter_init(pydb_agent_t *py,
++ uintptr_t addr);
++extern void pydb_iter_fini(pydb_iter_t *iter);
++extern uintptr_t pydb_iter_next(pydb_iter_t *iter);
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _LIBPYTHON26_DB_H */
+diff --git Python-2.6.4/py_db/libpython26_db_32.h Python-2.6.4/py_db/libpython26_db_32.h
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/py_db/libpython26_db_32.h
+@@ -0,0 +1,122 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++/*
++ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
++ * Use is subject to license terms.
++ */
++
++#ifndef _LIBPYTHON26_DB_32_H
++#define _LIBPYTHON26_DB_32_H
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++#include <sys/types.h>
++
++/*
++ * Define 32-bit Python data structures for use by the 64-bit debugger. This
++ * is so that a 64-bit debugger may properly examine a 32-bit process.
++ *
++ * In many cases, the debug library is only concerned with a few fields in the
++ * Python structure. In that case, the other ancillary fields are elided.
++ */
++
++typedef uint32_t uintptr32_t;
++typedef int32_t Py_ssize32_t;
++
++typedef struct _is32 {
++ uintptr32_t next;
++ uintptr32_t tstate_head;
++} PyInterpreterState32;
++
++typedef struct _ts32 {
++ uintptr32_t next;
++ uintptr32_t interp;
++ uintptr32_t frame;
++} PyThreadState32;
++
++#define PyObject_HEAD32 \
++ Py_ssize32_t ob_refcnt; \
++ uintptr32_t ob_type;
++
++#define PyObject_VAR_HEAD32 \
++ PyObject_HEAD32 \
++ Py_ssize32_t ob_size;
++
++typedef struct {
++ PyObject_HEAD32
++} PyObject32;
++
++typedef struct {
++ PyObject_VAR_HEAD32
++} PyVarObject32;
++
++typedef struct {
++ PyObject_VAR_HEAD32
++ int32_t ob_shash;
++ int ob_sstate;
++ char ob_sval[1];
++} PyStringObject32;
++
++#define Py_SIZE32(ob) (((PyVarObject32*)(ob))->ob_size)
++#define PyString_GET_SIZE32(op) Py_SIZE32(op)
++#define PyString_AS_STRING32(op) (((PyStringObject32 *)(op))->ob_sval)
++
++typedef struct {
++ PyObject_VAR_HEAD32
++ uintptr32_t f_back;
++ uintptr32_t f_code;
++ uintptr32_t f_builtins;
++ uintptr32_t f_globals;
++ uintptr32_t f_locals;
++ uintptr32_t f_valuestack;
++ uintptr32_t f_stacktop;
++ uintptr32_t f_trace;
++ uintptr32_t f_exc_typpe, f_exc_value, f_exc_traceback;
++ uintptr32_t f_tstate;
++ int f_lasti;
++ int f_lineno;
++} PyFrameObject32;
++
++typedef struct {
++ PyObject_HEAD32
++ int co_argcount;
++ int co_nlocals;
++ int co_stacksize;
++ int co_flags;
++ uintptr32_t co_code;
++ uintptr32_t co_consts;
++ uintptr32_t co_names;
++ uintptr32_t co_varnames;
++ uintptr32_t co_freevars;
++ uintptr32_t co_cellvars;
++ uintptr32_t co_filename;
++ uintptr32_t co_name;
++ int co_firstlineno;
++ uintptr32_t co_lnotab;
++} PyCodeObject32;
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _LIBPYTHON26_DB_32_H */
+diff --git Python-2.6.4/py_db/mapfile-vers Python-2.6.4/py_db/mapfile-vers
+new file mode 100644
+--- /dev/null
++++ Python-2.6.4/py_db/mapfile-vers
+@@ -0,0 +1,40 @@
++#
++# CDDL HEADER START
++#
++# The contents of this file are subject to the terms of the
++# Common Development and Distribution License (the "License").
++# You may not use this file except in compliance with the License.
++#
++# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++# or http://www.opensolaris.org/os/licensing.
++# See the License for the specific language governing permissions
++# and limitations under the License.
++#
++# When distributing Covered Code, include this CDDL HEADER in each
++# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++# If applicable, add the following below this CDDL HEADER, with the
++# fields enclosed by brackets "[]" replaced with your own identifying
++# information: Portions Copyright [yyyy] [name of copyright owner]
++#
++# CDDL HEADER END
++#
++
++#
++# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
++# Use is subject to license terms.
++#
++
++SUNWprivate_1.1 {
++ global:
++ pydb_agent_create;
++ pydb_agent_destroy;
++ pydb_frame_iter_init;
++ pydb_get_frameinfo;
++ pydb_pc_frameinfo;
++ pydb_interp_iter_init;
++ pydb_thread_iter_init;
++ pydb_iter_fini;
++ pydb_iter_next;
++ local:
++ *;
++};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-21-getpass.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,31 @@
+diff --git Python-2.6.4/Lib/getpass.py Python-2.6.4/Lib/getpass.py
+--- Python-2.6.4/Lib/getpass.py
++++ Python-2.6.4/Lib/getpass.py
+@@ -62,12 +62,16 @@
+ try:
+ old = termios.tcgetattr(fd) # a copy to save
+ new = old[:]
+- new[3] &= ~termios.ECHO # 3 == 'lflags'
++ new[3] &= ~(termios.ECHO|termios.ISIG) # 3 == 'lflags'
++ tcsetattr_flags = termios.TCSAFLUSH
++ if hasattr(termios, 'TCSASOFT'):
++ tcsetattr_flags |= termios.TCSASOFT
+ try:
+- termios.tcsetattr(fd, termios.TCSADRAIN, new)
++ termios.tcsetattr(fd, tcsetattr_flags, new)
+ passwd = _raw_input(prompt, stream, input=input)
+ finally:
+- termios.tcsetattr(fd, termios.TCSADRAIN, old)
++ termios.tcsetattr(fd, tcsetattr_flags, old)
++ stream.flush() # issue7208
+ except termios.error, e:
+ if passwd is not None:
+ # _raw_input succeeded. The final tcsetattr failed. Reraise
+@@ -125,6 +129,7 @@
+ if prompt:
+ stream.write(prompt)
+ stream.flush()
++ # NOTE: The Python C API calls flockfile() (and unlock) during readline.
+ line = input.readline()
+ if not line:
+ raise EOFError
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python26/patches/Python26-22-bindir.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,11 @@
+--- Python-2.6.4/Makefile.pre.in.orig Fri Feb 11 11:35:54 2011
++++ Python-2.6.4/Makefile.pre.in Fri Feb 11 11:36:15 2011
+@@ -86,7 +86,7 @@
+ datarootdir= @datarootdir@
+
+ # Expanded directories
+-BINDIR= $(exec_prefix)/bin
++BINDIR= @bindir@
+ LIBDIR= @libdir@
+ MANDIR= @mandir@
+ INCLUDEDIR= @includedir@
--- a/components/screen/misc.c.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
---- screen-4.0.2/misc.c 2003-12-05 19:15:41.000000000 +0530
-+++ screen-4.0.2/misc.c 2006-04-03 16:46:19.150133000 +0530
-@@ -613,7 +613,7 @@
- */
- # endif /* NEEDSETENV */
- #else /* USESETENV */
--# if defined(linux) || defined(__convex__) || (BSD >= 199103)
-+# if defined(linux) || defined(__convex__) || (BSD >= 199103) || (__sun)
- setenv(var, value, 1);
- # else
- setenv(var, value);
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/screen/patches/misc.c.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,12 @@
+--- screen-4.0.2/misc.c 2003-12-05 19:15:41.000000000 +0530
++++ screen-4.0.2/misc.c 2006-04-03 16:46:19.150133000 +0530
+@@ -613,7 +613,7 @@
+ */
+ # endif /* NEEDSETENV */
+ #else /* USESETENV */
+-# if defined(linux) || defined(__convex__) || (BSD >= 199103)
++# if defined(linux) || defined(__convex__) || (BSD >= 199103) || (__sun)
+ setenv(var, value, 1);
+ # else
+ setenv(var, value);
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/screen/patches/terminfo.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,15 @@
+--- screen-4.0.3/Makefile.in.orig Thu Feb 10 05:16:01 2011
++++ screen-4.0.3/Makefile.in Thu Feb 10 05:18:17 2011
+@@ -84,9 +84,10 @@
+ ###############################################################################
+ install: installdirs install_bin
+ cd doc ; $(MAKE) install
+- -if [ -d /usr/lib/terminfo ]; then \
++ -if [ -d $(DESTDIR)/usr/share/lib/terminfo ]; then \
++ TERMINFO=$(DESTDIR)/usr/share/lib/terminfo \
+ PATH="$$PATH:/usr/5bin" tic ${srcdir}/terminfo/screeninfo.src; \
+- chmod 644 /usr/lib/terminfo/s/screen*; \
++ chmod 644 $(DESTDIR)/usr/share/lib/terminfo/s/screen*; \
+ fi
+ # Better do this by hand. E.g. under RCS...
+ # cat ${srcdir}/terminfo/screencap >> /etc/termcap
--- a/components/screen/terminfo.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
---- screen-4.0.3/Makefile.in.orig Thu Feb 10 05:16:01 2011
-+++ screen-4.0.3/Makefile.in Thu Feb 10 05:18:17 2011
-@@ -84,9 +84,10 @@
- ###############################################################################
- install: installdirs install_bin
- cd doc ; $(MAKE) install
-- -if [ -d /usr/lib/terminfo ]; then \
-+ -if [ -d $(DESTDIR)/usr/share/lib/terminfo ]; then \
-+ TERMINFO=$(DESTDIR)/usr/share/lib/terminfo \
- PATH="$$PATH:/usr/5bin" tic ${srcdir}/terminfo/screeninfo.src; \
-- chmod 644 /usr/lib/terminfo/s/screen*; \
-+ chmod 644 $(DESTDIR)/usr/share/lib/terminfo/s/screen*; \
- fi
- # Better do this by hand. E.g. under RCS...
- # cat ${srcdir}/terminfo/screencap >> /etc/termcap
--- a/components/tcsh/001.config_f.h.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-*** tcsh-6.17.00/config_f.h.orig Thu Aug 20 12:31:33 2009
---- tcsh-6.17.00/config_f.h Thu Aug 20 12:31:42 2009
-***************
-*** 131,137 ****
- * variable "mbytemap".
- * (use for multi-byte table check)
- */
-! #undef MBYTEDEBUG
-
- /*
- * NEWGRP Provide a newgrp builtin.
---- 131,137 ----
- * variable "mbytemap".
- * (use for multi-byte table check)
- */
-! #define MBYTEDEBUG
-
- /*
- * NEWGRP Provide a newgrp builtin.
--- a/components/tcsh/002.sol-8bit.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-diff -ru tcsh-6.17.00-orig/sh.c tcsh-6.17.00/sh.c
---- tcsh-6.17.00-orig/sh.c 2009-06-25 23:15:37.000000000 +0200
-+++ tcsh-6.17.00/sh.c 2009-09-10 15:38:50.703642142 +0200
-@@ -336,12 +336,14 @@
- fix_strcoll_bug();
- # endif /* STRCOLLBUG */
-
-- {
-+ if (MB_CUR_MAX == 1) {
- int k;
-
-- for (k = 0200; k <= 0377 && !Isprint(CTL_ESC(k)); k++)
-+ for (k = 0200; k <= 0377 && !isprint(CTL_ESC(k)); k++)
- continue;
-- AsciiOnly = MB_CUR_MAX == 1 && k > 0377;
-+ AsciiOnly = k > 0377;
-+ } else {
-+ AsciiOnly = 0;
- }
- #else
- AsciiOnly = getenv("LANG") == NULL && getenv("LC_CTYPE") == NULL;
--- a/components/tcsh/003.locale.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
---- tcsh-6.17.00/sh.c.orig Tue Sep 22 13:39:07 2009
-+++ tcsh-6.17.00/sh.c Wed Sep 23 00:46:27 2009
-@@ -160,6 +160,52 @@
-
- int main (int, char **);
-
-+#ifndef LOCALEDIR
-+#define LOCALEDIR "/usr/share/locale"
-+#endif
-+
-+static void
-+add_localedir_to_nslpath(char *path)
-+{
-+ char *old = getenv("NLSPATH");
-+ char *new;
-+ int len = 0;
-+
-+ if (path == NULL)
-+ return;
-+
-+ if (old != NULL)
-+ len += strlen(old);
-+
-+#if !defined(HAVE_SETENV)
-+ len += sizeof ("NLSPATH=");
-+#endif
-+
-+ len += (strlen(path) + sizeof ("/%L/LC_MESSAGES/%N.cat"));
-+
-+ if ((new = calloc(len, 1)) == NULL)
-+ return;
-+
-+#if !defined(HAVE_SETENV)
-+ strcpy(new, "NLSPATH=");
-+#endif
-+
-+ if (old != NULL) {
-+ strncat(new, old, len);
-+ strncat(new, ":", len);
-+ }
-+
-+ strncat(new, path, len);
-+ strncat(new, "/%L/LC_MESSAGES/%N.cat", len);
-+
-+#if defined(HAVE_SETENV)
-+ setenv("NLSPATH", new, 1);
-+ free(new);
-+#else
-+ putenv(new);
-+#endif
-+}
-+
- int
- main(int argc, char **argv)
- {
-@@ -192,6 +238,8 @@
- # endif /* LC_CTYPE */
- #endif /* NLS */
-
-+ add_localedir_to_nslpath(LOCALEDIR);
-+
- nlsinit();
-
- #ifdef MALLOC_TRACE
---- tcsh-6.17.00/nls/Makefile.in.orig Wed Oct 7 13:25:44 2009
-+++ tcsh-6.17.00/nls/Makefile.in Wed Oct 7 13:31:57 2009
-@@ -0,0 +1,24 @@
-+# $tcsh: Makefile,v 1.14 2006/03/02 18:46:45 christos Exp $
-+
-+LOCALES= C et finnish french german greek italian ja pl russian \
-+ spanish ukrainian
-+GENCAT= gencat
-+INSTALL= ginstall
-+
-+CATALOGS=$(LOCALES:%=%.cat)
-+INSTALLED=$(LOCALES:%=@localedir@/%/LC_MESSAGES/tcsh.cat)
-+
-+all: $(CATALOGS)
-+
-+install: $(INSTALLED)
-+
-+@localedir@/%/LC_MESSAGES/tcsh.cat: %.cat
-+ mkdir -p $(@D)
-+ $(INSTALL) $< $@
-+
-+%.cat:
-+ $(GENCAT) $@ $(@:%.cat=%)/*set*
-+
-+clean:
-+ $(RM) $(CATALOGS)
-+
-
---- tcsh-6.17.00/Makefile.in.orig Wed Jun 24 15:09:05 2009
-+++ tcsh-6.17.00/Makefile.in Wed Oct 7 14:19:01 2009
-@@ -12,6 +12,7 @@
- BUILD=tcsh$(EXEEXT)
- VPATH=@srcdir@
- srcdir=@srcdir@
-+localedir=@localedir@
-
- ################################################################
- ## CFLAGS. For various -D things, see config.h
-@@ -137,8 +138,10 @@
- #DFLAGS=-D_PATH_TCSHELL='"${DESTBIN}/tcsh"'
- ## The following is set by autoconf.
- DFLAGS = -D_PATH_TCSHELL='"${bindir}/tcsh"' @DFLAGS@ @CPPFLAGS@
-+DFLAGS += -DLOCALEDIR='"${localedir}"'
-
-
-+
- ################################################################
- ## LDFLAGS. Define something here if you need to
- ################################################################
-@@ -231,7 +234,7 @@
- #
-
- EXTRAFLAGS = @HESDEF@ $(AFSDEF)
--EXTRALIBS = @HESLIB@ $(AFSLIB) @LIBICONV@
-+EXTRALIBS = @HESLIB@ $(AFSLIB)
-
-
-
---- tcsh-6.17.00/configure.in Fri Jul 10 10:13:56 2009
-+++ tc/configure.in Wed Oct 7 14:21:21 2009
-@@ -281,7 +281,6 @@
- AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses)
- AC_SEARCH_LIBS(gethostbyname, nsl)
- AC_SEARCH_LIBS(connect, socket)
--AM_ICONV
-
- dnl Checks for header files
- AC_CHECK_HEADERS([auth.h crypt.h inttypes.h shadow.h stdint.h utmp.h utmpx.h])
-@@ -440,5 +440,5 @@
- AC_SUBST(HESDEF)
- AC_SUBST(HESLIB)
-
--AC_CONFIG_FILES([Makefile])
-+AC_CONFIG_FILES([Makefile nls/Makefile])
- AC_OUTPUT
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/tcsh/patches/001.config_f.h.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,19 @@
+*** tcsh-6.17.00/config_f.h.orig Thu Aug 20 12:31:33 2009
+--- tcsh-6.17.00/config_f.h Thu Aug 20 12:31:42 2009
+***************
+*** 131,137 ****
+ * variable "mbytemap".
+ * (use for multi-byte table check)
+ */
+! #undef MBYTEDEBUG
+
+ /*
+ * NEWGRP Provide a newgrp builtin.
+--- 131,137 ----
+ * variable "mbytemap".
+ * (use for multi-byte table check)
+ */
+! #define MBYTEDEBUG
+
+ /*
+ * NEWGRP Provide a newgrp builtin.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/tcsh/patches/002.sol-8bit.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,21 @@
+diff -ru tcsh-6.17.00-orig/sh.c tcsh-6.17.00/sh.c
+--- tcsh-6.17.00-orig/sh.c 2009-06-25 23:15:37.000000000 +0200
++++ tcsh-6.17.00/sh.c 2009-09-10 15:38:50.703642142 +0200
+@@ -336,12 +336,14 @@
+ fix_strcoll_bug();
+ # endif /* STRCOLLBUG */
+
+- {
++ if (MB_CUR_MAX == 1) {
+ int k;
+
+- for (k = 0200; k <= 0377 && !Isprint(CTL_ESC(k)); k++)
++ for (k = 0200; k <= 0377 && !isprint(CTL_ESC(k)); k++)
+ continue;
+- AsciiOnly = MB_CUR_MAX == 1 && k > 0377;
++ AsciiOnly = k > 0377;
++ } else {
++ AsciiOnly = 0;
+ }
+ #else
+ AsciiOnly = getenv("LANG") == NULL && getenv("LC_CTYPE") == NULL;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/tcsh/patches/003.locale.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,140 @@
+--- tcsh-6.17.00/sh.c.orig Tue Sep 22 13:39:07 2009
++++ tcsh-6.17.00/sh.c Wed Sep 23 00:46:27 2009
+@@ -160,6 +160,52 @@
+
+ int main (int, char **);
+
++#ifndef LOCALEDIR
++#define LOCALEDIR "/usr/share/locale"
++#endif
++
++static void
++add_localedir_to_nslpath(char *path)
++{
++ char *old = getenv("NLSPATH");
++ char *new;
++ int len = 0;
++
++ if (path == NULL)
++ return;
++
++ if (old != NULL)
++ len += strlen(old);
++
++#if !defined(HAVE_SETENV)
++ len += sizeof ("NLSPATH=");
++#endif
++
++ len += (strlen(path) + sizeof ("/%L/LC_MESSAGES/%N.cat"));
++
++ if ((new = calloc(len, 1)) == NULL)
++ return;
++
++#if !defined(HAVE_SETENV)
++ strcpy(new, "NLSPATH=");
++#endif
++
++ if (old != NULL) {
++ strncat(new, old, len);
++ strncat(new, ":", len);
++ }
++
++ strncat(new, path, len);
++ strncat(new, "/%L/LC_MESSAGES/%N.cat", len);
++
++#if defined(HAVE_SETENV)
++ setenv("NLSPATH", new, 1);
++ free(new);
++#else
++ putenv(new);
++#endif
++}
++
+ int
+ main(int argc, char **argv)
+ {
+@@ -192,6 +238,8 @@
+ # endif /* LC_CTYPE */
+ #endif /* NLS */
+
++ add_localedir_to_nslpath(LOCALEDIR);
++
+ nlsinit();
+
+ #ifdef MALLOC_TRACE
+--- tcsh-6.17.00/nls/Makefile.in.orig Wed Oct 7 13:25:44 2009
++++ tcsh-6.17.00/nls/Makefile.in Wed Oct 7 13:31:57 2009
+@@ -0,0 +1,24 @@
++# $tcsh: Makefile,v 1.14 2006/03/02 18:46:45 christos Exp $
++
++LOCALES= C et finnish french german greek italian ja pl russian \
++ spanish ukrainian
++GENCAT= gencat
++INSTALL= ginstall
++
++CATALOGS=$(LOCALES:%=%.cat)
++INSTALLED=$(LOCALES:%=@localedir@/%/LC_MESSAGES/tcsh.cat)
++
++all: $(CATALOGS)
++
++install: $(INSTALLED)
++
++@localedir@/%/LC_MESSAGES/tcsh.cat: %.cat
++ mkdir -p $(@D)
++ $(INSTALL) $< $@
++
++%.cat:
++ $(GENCAT) $@ $(@:%.cat=%)/*set*
++
++clean:
++ $(RM) $(CATALOGS)
++
+
+--- tcsh-6.17.00/Makefile.in.orig Wed Jun 24 15:09:05 2009
++++ tcsh-6.17.00/Makefile.in Wed Oct 7 14:19:01 2009
+@@ -12,6 +12,7 @@
+ BUILD=tcsh$(EXEEXT)
+ VPATH=@srcdir@
+ srcdir=@srcdir@
++localedir=@localedir@
+
+ ################################################################
+ ## CFLAGS. For various -D things, see config.h
+@@ -137,8 +138,10 @@
+ #DFLAGS=-D_PATH_TCSHELL='"${DESTBIN}/tcsh"'
+ ## The following is set by autoconf.
+ DFLAGS = -D_PATH_TCSHELL='"${bindir}/tcsh"' @DFLAGS@ @CPPFLAGS@
++DFLAGS += -DLOCALEDIR='"${localedir}"'
+
+
++
+ ################################################################
+ ## LDFLAGS. Define something here if you need to
+ ################################################################
+@@ -231,7 +234,7 @@
+ #
+
+ EXTRAFLAGS = @HESDEF@ $(AFSDEF)
+-EXTRALIBS = @HESLIB@ $(AFSLIB) @LIBICONV@
++EXTRALIBS = @HESLIB@ $(AFSLIB)
+
+
+
+--- tcsh-6.17.00/configure.in Fri Jul 10 10:13:56 2009
++++ tc/configure.in Wed Oct 7 14:21:21 2009
+@@ -281,7 +281,6 @@
+ AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses)
+ AC_SEARCH_LIBS(gethostbyname, nsl)
+ AC_SEARCH_LIBS(connect, socket)
+-AM_ICONV
+
+ dnl Checks for header files
+ AC_CHECK_HEADERS([auth.h crypt.h inttypes.h shadow.h stdint.h utmp.h utmpx.h])
+@@ -440,5 +440,5 @@
+ AC_SUBST(HESDEF)
+ AC_SUBST(HESLIB)
+
+-AC_CONFIG_FILES([Makefile])
++AC_CONFIG_FILES([Makefile nls/Makefile])
+ AC_OUTPUT
+
--- a/components/wget/CVE-2010-2252.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-diff -rcu wget-1.12.orig/doc/wget.texi wget-1.12/doc/wget.texi
---- wget-1.12.orig/doc/wget.texi Fri Sep 4 14:22:04 2009
-+++ wget-1.12/doc/wget.texi Tue Feb 15 03:26:00 2011
-@@ -1487,6 +1487,13 @@
- @code{Content-Disposition} headers to describe what the name of a
- downloaded file should be.
-
-+@cindex Trust server names
-+@item --trust-server-names
-+
-+If this is set to on, on a redirect the last component of the
-+redirection URL will be used as the local file name. By default it is
-+used the last component in the original URL.
-+
- @cindex authentication
- @item --auth-no-challenge
-
-@@ -2799,6 +2806,10 @@
- Turn on recognition of the (non-standard) @samp{Content-Disposition}
- HTTP header---if set to @samp{on}, the same as @samp{--content-disposition}.
-
-+@item trust_server_names = on/off
-+If set to on, use the last component of a redirection URL for the local
-+file name.
-+
- @item continue = on/off
- If set to on, force continuation of preexistent partially retrieved
- files. See @samp{-c} before setting it.
-diff -rcu wget-1.12.orig/src/http.c wget-1.12/src/http.c
---- wget-1.12.orig/src/http.c Mon Sep 21 20:02:18 2009
-+++ wget-1.12/src/http.c Tue Feb 15 03:26:00 2011
-@@ -2410,8 +2410,9 @@
- /* The genuine HTTP loop! This is the part where the retrieval is
- retried, and retried, and retried, and... */
- uerr_t
--http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
-- int *dt, struct url *proxy, struct iri *iri)
-+http_loop (struct url *u, struct url *original_url, char **newloc,
-+ char **local_file, const char *referer, int *dt, struct url *proxy,
-+ struct iri *iri)
- {
- int count;
- bool got_head = false; /* used for time-stamping and filename detection */
-@@ -2457,7 +2458,8 @@
- }
- else if (!opt.content_disposition)
- {
-- hstat.local_file = url_file_name (u);
-+ hstat.local_file =
-+ url_file_name (opt.trustservernames ? u : original_url);
- got_name = true;
- }
-
-@@ -2497,7 +2499,7 @@
-
- /* Send preliminary HEAD request if -N is given and we have an existing
- * destination file. */
-- file_name = url_file_name (u);
-+ file_name = url_file_name (opt.trustservernames ? u : original_url);
- if (opt.timestamping
- && !opt.content_disposition
- && file_exists_p (file_name))
-diff -rcu wget-1.12.orig/src/http.h wget-1.12/src/http.h
---- wget-1.12.orig/src/http.h Fri Sep 4 09:31:54 2009
-+++ wget-1.12/src/http.h Tue Feb 15 03:26:00 2011
-@@ -33,8 +33,8 @@
-
- struct url;
-
--uerr_t http_loop (struct url *, char **, char **, const char *, int *,
-- struct url *, struct iri *);
-+uerr_t http_loop (struct url *, struct url *, char **, char **, const char *,
-+ int *, struct url *, struct iri *);
- void save_cookies (void);
- void http_cleanup (void);
- time_t http_atotm (const char *);
-diff -rcu wget-1.12.orig/src/init.c wget-1.12/src/init.c
---- wget-1.12.orig/src/init.c Mon Sep 21 20:02:41 2009
-+++ wget-1.12/src/init.c Tue Feb 15 03:26:00 2011
-@@ -243,6 +243,7 @@
- { "timeout", NULL, cmd_spec_timeout },
- { "timestamping", &opt.timestamping, cmd_boolean },
- { "tries", &opt.ntry, cmd_number_inf },
-+ { "trustservernames", &opt.trustservernames, cmd_boolean },
- { "useproxy", &opt.use_proxy, cmd_boolean },
- { "user", &opt.user, cmd_string },
- { "useragent", NULL, cmd_spec_useragent },
-diff -rcu wget-1.12.orig/src/main.c wget-1.12/src/main.c
---- wget-1.12.orig/src/main.c Mon Sep 21 20:03:11 2009
-+++ wget-1.12/src/main.c Tue Feb 15 03:26:00 2011
-@@ -266,6 +266,7 @@
- { "timeout", 'T', OPT_VALUE, "timeout", -1 },
- { "timestamping", 'N', OPT_BOOLEAN, "timestamping", -1 },
- { "tries", 't', OPT_VALUE, "tries", -1 },
-+ { "trust-server-names", 0, OPT_BOOLEAN, "trustservernames", -1 },
- { "user", 0, OPT_VALUE, "user", -1 },
- { "user-agent", 'U', OPT_VALUE, "useragent", -1 },
- { "verbose", 'v', OPT_BOOLEAN, "verbose", -1 },
-@@ -675,6 +676,8 @@
- N_("\
- -I, --include-directories=LIST list of allowed directories.\n"),
- N_("\
-+ --trust-server-names use the name specified by the redirection url last component.\n"),
-+ N_("\
- -X, --exclude-directories=LIST list of excluded directories.\n"),
- N_("\
- -np, --no-parent don't ascend to the parent directory.\n"),
-diff -rcu wget-1.12.orig/src/options.h wget-1.12/src/options.h
---- wget-1.12.orig/src/options.h Mon Sep 21 20:03:47 2009
-+++ wget-1.12/src/options.h Tue Feb 15 03:26:00 2011
-@@ -242,6 +242,7 @@
- char *encoding_remote;
- char *locale;
-
-+ bool trustservernames;
- #ifdef __VMS
- int ftp_stmlf; /* Force Stream_LF format for binary FTP. */
- #endif /* def __VMS */
-diff -rcu wget-1.12.orig/src/retr.c wget-1.12/src/retr.c
---- wget-1.12.orig/src/retr.c Fri Sep 4 09:31:54 2009
-+++ wget-1.12/src/retr.c Tue Feb 15 03:26:00 2011
-@@ -689,7 +689,8 @@
- #endif
- || (proxy_url && proxy_url->scheme == SCHEME_HTTP))
- {
-- result = http_loop (u, &mynewloc, &local_file, refurl, dt, proxy_url, iri);
-+ result = http_loop (u, orig_parsed, &mynewloc, &local_file, refurl, dt,
-+ proxy_url, iri);
- }
- else if (u->scheme == SCHEME_FTP)
- {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/wget/patches/CVE-2010-2252.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,131 @@
+diff -rcu wget-1.12.orig/doc/wget.texi wget-1.12/doc/wget.texi
+--- wget-1.12.orig/doc/wget.texi Fri Sep 4 14:22:04 2009
++++ wget-1.12/doc/wget.texi Tue Feb 15 03:26:00 2011
+@@ -1487,6 +1487,13 @@
+ @code{Content-Disposition} headers to describe what the name of a
+ downloaded file should be.
+
++@cindex Trust server names
++@item --trust-server-names
++
++If this is set to on, on a redirect the last component of the
++redirection URL will be used as the local file name. By default it is
++used the last component in the original URL.
++
+ @cindex authentication
+ @item --auth-no-challenge
+
+@@ -2799,6 +2806,10 @@
+ Turn on recognition of the (non-standard) @samp{Content-Disposition}
+ HTTP header---if set to @samp{on}, the same as @samp{--content-disposition}.
+
++@item trust_server_names = on/off
++If set to on, use the last component of a redirection URL for the local
++file name.
++
+ @item continue = on/off
+ If set to on, force continuation of preexistent partially retrieved
+ files. See @samp{-c} before setting it.
+diff -rcu wget-1.12.orig/src/http.c wget-1.12/src/http.c
+--- wget-1.12.orig/src/http.c Mon Sep 21 20:02:18 2009
++++ wget-1.12/src/http.c Tue Feb 15 03:26:00 2011
+@@ -2410,8 +2410,9 @@
+ /* The genuine HTTP loop! This is the part where the retrieval is
+ retried, and retried, and retried, and... */
+ uerr_t
+-http_loop (struct url *u, char **newloc, char **local_file, const char *referer,
+- int *dt, struct url *proxy, struct iri *iri)
++http_loop (struct url *u, struct url *original_url, char **newloc,
++ char **local_file, const char *referer, int *dt, struct url *proxy,
++ struct iri *iri)
+ {
+ int count;
+ bool got_head = false; /* used for time-stamping and filename detection */
+@@ -2457,7 +2458,8 @@
+ }
+ else if (!opt.content_disposition)
+ {
+- hstat.local_file = url_file_name (u);
++ hstat.local_file =
++ url_file_name (opt.trustservernames ? u : original_url);
+ got_name = true;
+ }
+
+@@ -2497,7 +2499,7 @@
+
+ /* Send preliminary HEAD request if -N is given and we have an existing
+ * destination file. */
+- file_name = url_file_name (u);
++ file_name = url_file_name (opt.trustservernames ? u : original_url);
+ if (opt.timestamping
+ && !opt.content_disposition
+ && file_exists_p (file_name))
+diff -rcu wget-1.12.orig/src/http.h wget-1.12/src/http.h
+--- wget-1.12.orig/src/http.h Fri Sep 4 09:31:54 2009
++++ wget-1.12/src/http.h Tue Feb 15 03:26:00 2011
+@@ -33,8 +33,8 @@
+
+ struct url;
+
+-uerr_t http_loop (struct url *, char **, char **, const char *, int *,
+- struct url *, struct iri *);
++uerr_t http_loop (struct url *, struct url *, char **, char **, const char *,
++ int *, struct url *, struct iri *);
+ void save_cookies (void);
+ void http_cleanup (void);
+ time_t http_atotm (const char *);
+diff -rcu wget-1.12.orig/src/init.c wget-1.12/src/init.c
+--- wget-1.12.orig/src/init.c Mon Sep 21 20:02:41 2009
++++ wget-1.12/src/init.c Tue Feb 15 03:26:00 2011
+@@ -243,6 +243,7 @@
+ { "timeout", NULL, cmd_spec_timeout },
+ { "timestamping", &opt.timestamping, cmd_boolean },
+ { "tries", &opt.ntry, cmd_number_inf },
++ { "trustservernames", &opt.trustservernames, cmd_boolean },
+ { "useproxy", &opt.use_proxy, cmd_boolean },
+ { "user", &opt.user, cmd_string },
+ { "useragent", NULL, cmd_spec_useragent },
+diff -rcu wget-1.12.orig/src/main.c wget-1.12/src/main.c
+--- wget-1.12.orig/src/main.c Mon Sep 21 20:03:11 2009
++++ wget-1.12/src/main.c Tue Feb 15 03:26:00 2011
+@@ -266,6 +266,7 @@
+ { "timeout", 'T', OPT_VALUE, "timeout", -1 },
+ { "timestamping", 'N', OPT_BOOLEAN, "timestamping", -1 },
+ { "tries", 't', OPT_VALUE, "tries", -1 },
++ { "trust-server-names", 0, OPT_BOOLEAN, "trustservernames", -1 },
+ { "user", 0, OPT_VALUE, "user", -1 },
+ { "user-agent", 'U', OPT_VALUE, "useragent", -1 },
+ { "verbose", 'v', OPT_BOOLEAN, "verbose", -1 },
+@@ -675,6 +676,8 @@
+ N_("\
+ -I, --include-directories=LIST list of allowed directories.\n"),
+ N_("\
++ --trust-server-names use the name specified by the redirection url last component.\n"),
++ N_("\
+ -X, --exclude-directories=LIST list of excluded directories.\n"),
+ N_("\
+ -np, --no-parent don't ascend to the parent directory.\n"),
+diff -rcu wget-1.12.orig/src/options.h wget-1.12/src/options.h
+--- wget-1.12.orig/src/options.h Mon Sep 21 20:03:47 2009
++++ wget-1.12/src/options.h Tue Feb 15 03:26:00 2011
+@@ -242,6 +242,7 @@
+ char *encoding_remote;
+ char *locale;
+
++ bool trustservernames;
+ #ifdef __VMS
+ int ftp_stmlf; /* Force Stream_LF format for binary FTP. */
+ #endif /* def __VMS */
+diff -rcu wget-1.12.orig/src/retr.c wget-1.12/src/retr.c
+--- wget-1.12.orig/src/retr.c Fri Sep 4 09:31:54 2009
++++ wget-1.12/src/retr.c Tue Feb 15 03:26:00 2011
+@@ -689,7 +689,8 @@
+ #endif
+ || (proxy_url && proxy_url->scheme == SCHEME_HTTP))
+ {
+- result = http_loop (u, &mynewloc, &local_file, refurl, dt, proxy_url, iri);
++ result = http_loop (u, orig_parsed, &mynewloc, &local_file, refurl, dt,
++ proxy_url, iri);
+ }
+ else if (u->scheme == SCHEME_FTP)
+ {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/wget/patches/sysdep.h.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,16 @@
+--- wget-1.12/src/sysdep.h.orig Fri Sep 4 09:31:54 2009
++++ wget-1.12/src/sysdep.h Fri Oct 2 03:03:22 2009
+@@ -67,8 +67,13 @@
+
+ #ifdef NAMESPACE_TWEAKS
+
++#if __STDC_VERSION__ >= 199901L
++/* Single UNIX Specification, Version 3 */
++#define _XOPEN_SOURCE 600
++#else
+ /* Request the "Unix 98 compilation environment". */
+ #define _XOPEN_SOURCE 500
++#endif
+
+ /* For Solaris: request everything else that is available and doesn't
+ conflict with the above. */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/wget/patches/wgetrc.patch Tue Mar 01 14:19:15 2011 -0800
@@ -0,0 +1,37 @@
+--- wget-1.12/doc/sample.wgetrc.orig Mon Sep 21 19:53:58 2009
++++ wget-1.12/doc/sample.wgetrc Wed Sep 30 07:42:08 2009
+@@ -7,7 +7,7 @@
+ ## not contain a comprehensive list of commands -- look at the manual
+ ## to find out what you can put into this file.
+ ##
+-## Wget initialization file can reside in /usr/local/etc/wgetrc
++## Wget initialization file can reside in /etc/wgetrc
+ ## (global, for all users) or $HOME/.wgetrc (for a single user).
+ ##
+ ## To use the settings in this file, you will have to uncomment them,
+@@ -16,7 +16,7 @@
+
+
+ ##
+-## Global settings (useful for setting up in /usr/local/etc/wgetrc).
++## Global settings (useful for setting up in /etc/wgetrc).
+ ## Think well before you change them, since they may reduce wget's
+ ## functionality, and make it behave contrary to the documentation:
+ ##
+--- wget-1.12/doc/wget.texi.orig Fri Feb 4 07:28:46 2011
++++ wget-1.12/doc/wget.texi Fri Feb 4 07:31:24 2011
+@@ -190,12 +190,12 @@
+ Most of the features are fully configurable, either through command line
+ options, or via the initialization file @file{.wgetrc} (@pxref{Startup
+ File}). Wget allows you to define @dfn{global} startup files
+-(@file{/usr/local/etc/wgetrc} by default) for site settings.
++(@file{/etc/wgetrc} by default) for site settings.
+
+ @ignore
+ @c man begin FILES
+ @table @samp
+-@item /usr/local/etc/wgetrc
++@item /etc/wgetrc
+ Default location of the @dfn{global} startup file.
+
+ @item .wgetrc
--- a/components/wget/sysdep.h.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
---- wget-1.12/src/sysdep.h.orig Fri Sep 4 09:31:54 2009
-+++ wget-1.12/src/sysdep.h Fri Oct 2 03:03:22 2009
-@@ -67,8 +67,13 @@
-
- #ifdef NAMESPACE_TWEAKS
-
-+#if __STDC_VERSION__ >= 199901L
-+/* Single UNIX Specification, Version 3 */
-+#define _XOPEN_SOURCE 600
-+#else
- /* Request the "Unix 98 compilation environment". */
- #define _XOPEN_SOURCE 500
-+#endif
-
- /* For Solaris: request everything else that is available and doesn't
- conflict with the above. */
--- a/components/wget/wgetrc.patch Tue Mar 01 11:29:05 2011 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
---- wget-1.12/doc/sample.wgetrc.orig Mon Sep 21 19:53:58 2009
-+++ wget-1.12/doc/sample.wgetrc Wed Sep 30 07:42:08 2009
-@@ -7,7 +7,7 @@
- ## not contain a comprehensive list of commands -- look at the manual
- ## to find out what you can put into this file.
- ##
--## Wget initialization file can reside in /usr/local/etc/wgetrc
-+## Wget initialization file can reside in /etc/wgetrc
- ## (global, for all users) or $HOME/.wgetrc (for a single user).
- ##
- ## To use the settings in this file, you will have to uncomment them,
-@@ -16,7 +16,7 @@
-
-
- ##
--## Global settings (useful for setting up in /usr/local/etc/wgetrc).
-+## Global settings (useful for setting up in /etc/wgetrc).
- ## Think well before you change them, since they may reduce wget's
- ## functionality, and make it behave contrary to the documentation:
- ##
---- wget-1.12/doc/wget.texi.orig Fri Feb 4 07:28:46 2011
-+++ wget-1.12/doc/wget.texi Fri Feb 4 07:31:24 2011
-@@ -190,12 +190,12 @@
- Most of the features are fully configurable, either through command line
- options, or via the initialization file @file{.wgetrc} (@pxref{Startup
- File}). Wget allows you to define @dfn{global} startup files
--(@file{/usr/local/etc/wgetrc} by default) for site settings.
-+(@file{/etc/wgetrc} by default) for site settings.
-
- @ignore
- @c man begin FILES
- @table @samp
--@item /usr/local/etc/wgetrc
-+@item /etc/wgetrc
- Default location of the @dfn{global} startup file.
-
- @item .wgetrc
--- a/make-rules/prep.mk Tue Mar 01 11:29:05 2011 -0800
+++ b/make-rules/prep.mk Tue Mar 01 14:19:15 2011 -0800
@@ -28,11 +28,13 @@
CLEAN_PATHS += $(SOURCE_DIR)
CLOBBER_PATHS += $(COMPONENT_ARCHIVE)
-PATCHES = $(shell find . -type f -name '*.patch' | \
- sed -e 's;^\./;;' | grep -v $(SOURCE_DIR) | sort)
-STAMPS = $(PATCHES:%=$(SOURCE_DIR)/.%ed)
+PATCH_DIR = patches
+PATCH_PATTERN = *.patch
+PATCHES = $(shell find $(PATCH_DIR) -type f -name '$(PATCH_PATTERN)' \
+ 2>/dev/null | sort)
+STAMPS = $(PATCHES:$(PATCH_DIR)/%=$(SOURCE_DIR)/.%ed)
-$(SOURCE_DIR)/.%ed: %
+$(SOURCE_DIR)/.%ed: $(PATCH_DIR)/%
$(GPATCH) -d $(@D) $(GPATCH_FLAGS) < $<
$(TOUCH) $@