[SCM] Source extractor for astronomical images branch, debian, updated. 3b09efdff69721a800252408021b329cb70ecd6a

Ole Streicher github at liska.ath.cx
Fri Dec 9 09:33:18 UTC 2011


The following commit has been merged in the debian branch:
commit 496798061b38a58767040462c2930e5d96ecbbcb
Author: Ole Streicher <github at liska.ath.cx>
Date:   Fri Dec 9 10:09:33 2011 +0100

    Split up 2.4.4 patch into small pieces.

diff --git a/debian/patches/have_malloc.patch b/debian/patches/have_malloc.patch
new file mode 100644
index 0000000..4bf5889
--- /dev/null
+++ b/debian/patches/have_malloc.patch
@@ -0,0 +1,30 @@
+--- sextractor-2.4.4.orig/src/misc.c
++++ sextractor-2.4.4/src/misc.c
+@@ -18,6 +18,8 @@
+ #include        "config.h"
+ #endif
+ 
++#include <sys/types.h>
++
+ #include	"define.h"
+ #include	"globals.h"
+ 
+@@ -70,3 +72,18 @@
+   }
+ 
+ 
++#if !HAVE_MALLOC
++#undef malloc
++
++// Allocate an N-byte block of memory from the heap.  If N is zero,
++// allocate a 1-byte block.
++void *rpl_malloc(size_t n)
++{
++	void *malloc();
++	if (0==n) {
++		n = 1;
++	}
++
++	return malloc(n);
++}
++#endif
diff --git a/debian/patches/have_mmap.patch b/debian/patches/have_mmap.patch
new file mode 100644
index 0000000..ba1ec30
--- /dev/null
+++ b/debian/patches/have_mmap.patch
@@ -0,0 +1,53 @@
+--- sextractor-2.4.4.orig/src/fits/fitsbody.c
++++ sextractor-2.4.4/src/fits/fitsbody.c
+@@ -52,9 +52,12 @@
+  ***/
+ PIXTYPE	*alloc_body(tabstruct *tab, void (*func)(PIXTYPE *ptr, int npix))
+   {
++#ifdef	HAVE_MMAP
+    FILE		*file;
+    PIXTYPE	*buffer;
+-   size_t	npix, size, sizeleft, spoonful;
++   size_t	sizeleft, spoonful;
++#endif
++   size_t	npix, size;
+ 
+   if (!body_ramflag)
+     {
+@@ -75,7 +78,9 @@
+ /* Decide if the data will go in physical memory or on swap-space */
+   npix = tab->tabsize/tab->bytepix;
+   size = npix*sizeof(PIXTYPE);
++#if !HAVE_MMAP
+   if (size < body_ramleft)
++#endif
+     {
+ /*-- There should be enough RAM left: try to do a malloc() */
+     if ((tab->bodybuf = malloc(size)))
+@@ -93,6 +98,7 @@
+       tab->bodybuf = NULL;
+     }
+ 
++#if HAVE_MMAP
+   if (size < body_vramleft)
+     {
+ /*-- Convert and copy the data to a swap file, and mmap() it */
+@@ -132,6 +138,7 @@
+       return NULL;
+     return (PIXTYPE *)tab->bodybuf;
+     }
++#endif
+ 
+ /* If no memory left at all: forget it! */
+   return NULL;
+@@ -158,8 +165,10 @@
+     size = (tab->tabsize/tab->bytepix)*sizeof(PIXTYPE);
+     if (tab->swapflag)
+       {
++#if HAVE_MMAP
+       if (munmap(tab->bodybuf, size))
+         warning("Can't unmap ", tab->cat->filename);
++#endif
+       tab->swapflag = 0;
+       tab->bodybuf = NULL;
+       body_vramleft += size;
diff --git a/debian/patches/rename_sex.patch b/debian/patches/rename_sex.patch
new file mode 100644
index 0000000..ba69a15
--- /dev/null
+++ b/debian/patches/rename_sex.patch
@@ -0,0 +1,73 @@
+--- sextractor-2.4.4.orig/man/sex.1.in
++++ sextractor-2.4.4/man/sex.1.in
+@@ -1,24 +1,26 @@
+-.TH SEXTRACTOR "1" "@DATE3@" "SWarp @PACKAGE_VERSION@" "User Commands"
++.TH SEXTRACTOR "1" "@DATE3@" "SExtractor @PACKAGE_VERSION@" "User Commands"
+ .SH NAME
+-sex \- extract a source catalog from an astronomical FITS image
++sextractor \- extract a source catalog from an astronomical FITS image
+ .SH SYNOPSIS
+-.B sex \fIimage\fR [\fI-c configuration-file\fR]
++.B sextractor \fIimage\fR [\fI-c configuration-file\fR]
+ .RS
+ [\fI-parameter1 value1 -parameter2 value2 ...\fR]
+ .RE
+ .TP
+-.B sex \fIimage\_detect\fR \fIimage_measure\fR [\fI-c configuration-file\fR]
++.B sextractor \fIimage\_detect\fR \fIimage_measure\fR [\fI-c configuration-file\fR]
+ .RS
+ [\fI-parameter1 value1 -parameter2 value2 ...\fR]
+ .RE
+ .TP
+-.B sex \fI-d\fR
++.B sextractor \fI-d\fR
+ .SH DESCRIPTION
+ SExtractor is a program that builds a catalogue of objects from an astronomical
+ image. Although it is particularly oriented towards reduction of large scale
+ galaxy-survey data, it performs rather well on moderately crowded star fields.
+ .RE
+-See http://terapix.iap.fr/soft/sextractor for more details.
++On Debian systems, sample SExtractor parameter files are installed to
++/usr/share/sextractor.
++.RE
+ .SS "Operation modes:"
+ .TP
+ \fB\-h\fR, \fB\-\-help\fR
+@@ -29,6 +31,13 @@
+ .TP
+ \fB\-d\fR, \fB\-\-dump\fR
+ dump a default configuration file
++
++.SH EXAMPLE
++For a minimal sextractor run, without customizing any of the
++parameters, use
++
++\fBsextractor file.fits -c /usr/share/sextractor/default.sex -PARAMETERS_NAME /usr/share/sextractor/default.param -FILTER N
++
+ .SH AUTHOR
+ Written by Emmanuel Bertin (Institut d'Astrophysique de Paris and Observatoire de Paris).
+ .PP
+@@ -38,10 +47,10 @@
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ .SH "REPORTING BUGS"
+ Report bugs to <sextractor at iap.fr>.
+-.SH "SEE ALSO"
+-.BR swarp (1)
+ .PP
+ The full documentation for
+ .B SExtractor
+ is maintained as a Postscript manual available at
+ .B http://terapix.iap.fr/soft/sextractor
++; on Debian systems, it is also installed to
++/usr/share/doc/sextractor/.
+--- sextractor-2.4.4.orig/src/define.h
++++ sextractor-2.4.4/src/define.h
+@@ -23,7 +23,7 @@
+ /*------------------------ what, who, when and where ------------------------*/
+ 
+ #define		BANNER		"SExtractor"
+-#define         EXECUTABLE      "sex"
++#define         EXECUTABLE      "sextractor"
+ #define		MYVERSION	VERSION
+ #define		COPYRIGHT	"Emmanuel BERTIN (bertin at iap.fr)"
+ #define		WEBSITE		"http://terapix.iap.fr/soft/sextractor"
diff --git a/debian/patches/sigbus.patch b/debian/patches/sigbus.patch
new file mode 100644
index 0000000..216be8b
--- /dev/null
+++ b/debian/patches/sigbus.patch
@@ -0,0 +1,24 @@
+--- sextractor-2.4.4.orig/src/fits/fitscleanup.c
++++ sextractor-2.4.4/src/fits/fitscleanup.c
+@@ -156,7 +156,9 @@
+ /* Catch CTRL-Cs */
+   signal(SIGINT, signal_function);
+ /* Catch bus errors */
++#ifdef	SIGBUS // TODO: what if it is an enum?
+   signal(SIGBUS, signal_function);
++#endif
+ /* Catch segmentation faults */
+   signal(SIGSEGV, signal_function);
+ /* Catch floating exceptions */
+@@ -187,9 +189,11 @@
+     case SIGINT:
+       fprintf(stderr, "^C\n");
+       exit(-1);
++#ifdef	SIGBUS
+     case SIGBUS:
+       fprintf(stderr, "bus error\n");
+       exit(-1);
++#endif
+     case SIGSEGV:
+       fprintf(stderr, "segmentation fault\n");
+       exit(-1);
diff --git a/debian/patches/win32.patch b/debian/patches/win32.patch
new file mode 100644
index 0000000..fcfdbb0
--- /dev/null
+++ b/debian/patches/win32.patch
@@ -0,0 +1,38 @@
+--- sextractor-2.4.4.orig/src/wcs/wcs.c
++++ sextractor-2.4.4/src/wcs/wcs.c
+@@ -378,6 +378,10 @@
+ *   $Id: wcs.c,v 1.1.1.1 2002/03/15 16:33:26 bertin Exp $
+ *===========================================================================*/
+ 
++#ifdef	_WIN32
++#define	_NO_OLDNAMES	1
++#endif
++
+ #ifdef HAVE_CONFIG_H
+ #include	"config.h"
+ #endif
+--- sextractor-2.4.4.orig/src/readimage.c
++++ sextractor-2.4.4/src/readimage.c
+@@ -14,6 +14,10 @@
+ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ */
+ 
++#ifdef	_WIN32
++#define	_NO_OLDNAMES	1
++#endif
++
+ #ifdef HAVE_CONFIG_H
+ #include        "config.h"
+ #endif
+--- sextractor-2.4.4.orig/src/astrom.c
++++ sextractor-2.4.4/src/astrom.c
+@@ -13,6 +13,9 @@
+ *
+ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ */
++#ifdef	_WIN32
++#define	_NO_OLDNAMES	1
++#endif
+ 
+ #ifdef HAVE_CONFIG_H
+ #include        "config.h"
diff --git a/debian/sextractor-2.4.4-1-nodebian.diff b/debian/sextractor-2.4.4-1-nodebian.diff
deleted file mode 100644
index cc0c7e9..0000000
--- a/debian/sextractor-2.4.4-1-nodebian.diff
+++ /dev/null
@@ -1,218 +0,0 @@
---- sextractor-2.4.4.orig/man/sex.1.in
-+++ sextractor-2.4.4/man/sex.1.in
-@@ -1,24 +1,26 @@
--.TH SEXTRACTOR "1" "@DATE3@" "SWarp @PACKAGE_VERSION@" "User Commands"
-+.TH SEXTRACTOR "1" "@DATE3@" "SExtractor @PACKAGE_VERSION@" "User Commands"
- .SH NAME
--sex \- extract a source catalog from an astronomical FITS image
-+sextractor \- extract a source catalog from an astronomical FITS image
- .SH SYNOPSIS
--.B sex \fIimage\fR [\fI-c configuration-file\fR]
-+.B sextractor \fIimage\fR [\fI-c configuration-file\fR]
- .RS
- [\fI-parameter1 value1 -parameter2 value2 ...\fR]
- .RE
- .TP
--.B sex \fIimage\_detect\fR \fIimage_measure\fR [\fI-c configuration-file\fR]
-+.B sextractor \fIimage\_detect\fR \fIimage_measure\fR [\fI-c configuration-file\fR]
- .RS
- [\fI-parameter1 value1 -parameter2 value2 ...\fR]
- .RE
- .TP
--.B sex \fI-d\fR
-+.B sextractor \fI-d\fR
- .SH DESCRIPTION
- SExtractor is a program that builds a catalogue of objects from an astronomical
- image. Although it is particularly oriented towards reduction of large scale
- galaxy-survey data, it performs rather well on moderately crowded star fields.
- .RE
--See http://terapix.iap.fr/soft/sextractor for more details.
-+On Debian systems, sample SExtractor parameter files are installed to
-+/usr/share/sextractor.
-+.RE
- .SS "Operation modes:"
- .TP
- \fB\-h\fR, \fB\-\-help\fR
-@@ -29,6 +31,13 @@
- .TP
- \fB\-d\fR, \fB\-\-dump\fR
- dump a default configuration file
-+
-+.SH EXAMPLE
-+For a minimal sextractor run, without customizing any of the
-+parameters, use
-+
-+\fBsextractor file.fits -c /usr/share/sextractor/default.sex -PARAMETERS_NAME /usr/share/sextractor/default.param -FILTER N
-+
- .SH AUTHOR
- Written by Emmanuel Bertin (Institut d'Astrophysique de Paris and Observatoire de Paris).
- .PP
-@@ -38,10 +47,10 @@
- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- .SH "REPORTING BUGS"
- Report bugs to <sextractor at iap.fr>.
--.SH "SEE ALSO"
--.BR swarp (1)
- .PP
- The full documentation for
- .B SExtractor
- is maintained as a Postscript manual available at
- .B http://terapix.iap.fr/soft/sextractor
-+; on Debian systems, it is also installed to
-+/usr/share/doc/sextractor/.
---- sextractor-2.4.4.orig/src/fits/fitsbody.c
-+++ sextractor-2.4.4/src/fits/fitsbody.c
-@@ -52,9 +52,12 @@
-  ***/
- PIXTYPE	*alloc_body(tabstruct *tab, void (*func)(PIXTYPE *ptr, int npix))
-   {
-+#ifdef	HAVE_MMAP
-    FILE		*file;
-    PIXTYPE	*buffer;
--   size_t	npix, size, sizeleft, spoonful;
-+   size_t	sizeleft, spoonful;
-+#endif
-+   size_t	npix, size;
- 
-   if (!body_ramflag)
-     {
-@@ -75,7 +78,9 @@
- /* Decide if the data will go in physical memory or on swap-space */
-   npix = tab->tabsize/tab->bytepix;
-   size = npix*sizeof(PIXTYPE);
-+#if !HAVE_MMAP
-   if (size < body_ramleft)
-+#endif
-     {
- /*-- There should be enough RAM left: try to do a malloc() */
-     if ((tab->bodybuf = malloc(size)))
-@@ -93,6 +98,7 @@
-       tab->bodybuf = NULL;
-     }
- 
-+#if HAVE_MMAP
-   if (size < body_vramleft)
-     {
- /*-- Convert and copy the data to a swap file, and mmap() it */
-@@ -132,6 +138,7 @@
-       return NULL;
-     return (PIXTYPE *)tab->bodybuf;
-     }
-+#endif
- 
- /* If no memory left at all: forget it! */
-   return NULL;
-@@ -158,8 +165,10 @@
-     size = (tab->tabsize/tab->bytepix)*sizeof(PIXTYPE);
-     if (tab->swapflag)
-       {
-+#if HAVE_MMAP
-       if (munmap(tab->bodybuf, size))
-         warning("Can't unmap ", tab->cat->filename);
-+#endif
-       tab->swapflag = 0;
-       tab->bodybuf = NULL;
-       body_vramleft += size;
---- sextractor-2.4.4.orig/src/fits/fitscleanup.c
-+++ sextractor-2.4.4/src/fits/fitscleanup.c
-@@ -156,7 +156,9 @@
- /* Catch CTRL-Cs */
-   signal(SIGINT, signal_function);
- /* Catch bus errors */
-+#ifdef	SIGBUS // TODO: what if it is an enum?
-   signal(SIGBUS, signal_function);
-+#endif
- /* Catch segmentation faults */
-   signal(SIGSEGV, signal_function);
- /* Catch floating exceptions */
-@@ -187,9 +189,11 @@
-     case SIGINT:
-       fprintf(stderr, "^C\n");
-       exit(-1);
-+#ifdef	SIGBUS
-     case SIGBUS:
-       fprintf(stderr, "bus error\n");
-       exit(-1);
-+#endif
-     case SIGSEGV:
-       fprintf(stderr, "segmentation fault\n");
-       exit(-1);
---- sextractor-2.4.4.orig/src/wcs/wcs.c
-+++ sextractor-2.4.4/src/wcs/wcs.c
-@@ -378,6 +378,10 @@
- *   $Id: wcs.c,v 1.1.1.1 2002/03/15 16:33:26 bertin Exp $
- *===========================================================================*/
- 
-+#ifdef	_WIN32
-+#define	_NO_OLDNAMES	1
-+#endif
-+
- #ifdef HAVE_CONFIG_H
- #include	"config.h"
- #endif
---- sextractor-2.4.4.orig/src/misc.c
-+++ sextractor-2.4.4/src/misc.c
-@@ -18,6 +18,8 @@
- #include        "config.h"
- #endif
- 
-+#include <sys/types.h>
-+
- #include	"define.h"
- #include	"globals.h"
- 
-@@ -70,3 +72,18 @@
-   }
- 
- 
-+#if !HAVE_MALLOC
-+#undef malloc
-+
-+// Allocate an N-byte block of memory from the heap.  If N is zero,
-+// allocate a 1-byte block.
-+void *rpl_malloc(size_t n)
-+{
-+	void *malloc();
-+	if (0==n) {
-+		n = 1;
-+	}
-+
-+	return malloc(n);
-+}
-+#endif
---- sextractor-2.4.4.orig/src/readimage.c
-+++ sextractor-2.4.4/src/readimage.c
-@@ -14,6 +14,10 @@
- *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
- 
-+#ifdef	_WIN32
-+#define	_NO_OLDNAMES	1
-+#endif
-+
- #ifdef HAVE_CONFIG_H
- #include        "config.h"
- #endif
---- sextractor-2.4.4.orig/src/define.h
-+++ sextractor-2.4.4/src/define.h
-@@ -23,7 +23,7 @@
- /*------------------------ what, who, when and where ------------------------*/
- 
- #define		BANNER		"SExtractor"
--#define         EXECUTABLE      "sex"
-+#define         EXECUTABLE      "sextractor"
- #define		MYVERSION	VERSION
- #define		COPYRIGHT	"Emmanuel BERTIN (bertin at iap.fr)"
- #define		WEBSITE		"http://terapix.iap.fr/soft/sextractor"
---- sextractor-2.4.4.orig/src/astrom.c
-+++ sextractor-2.4.4/src/astrom.c
-@@ -13,6 +13,9 @@
- *
- *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-+#ifdef	_WIN32
-+#define	_NO_OLDNAMES	1
-+#endif
- 
- #ifdef HAVE_CONFIG_H
- #include        "config.h"

-- 
Source extractor for astronomical images



More information about the debian-science-commits mailing list