[med-svn] r12346 - in trunk/packages/ffindex/trunk/debian: . patches
Laszlo Kajan
lkajan-guest at alioth.debian.org
Mon Oct 8 19:23:22 UTC 2012
Author: lkajan-guest
Date: 2012-10-08 19:23:21 +0000 (Mon, 08 Oct 2012)
New Revision: 12346
Added:
trunk/packages/ffindex/trunk/debian/libffindex0.symbols
trunk/packages/ffindex/trunk/debian/patches/basename
Removed:
trunk/packages/ffindex/trunk/debian/patches/40000000_bug
trunk/packages/ffindex/trunk/debian/patches/hardening
trunk/packages/ffindex/trunk/debian/patches/num_max_entries_bug
Modified:
trunk/packages/ffindex/trunk/debian/changelog
trunk/packages/ffindex/trunk/debian/ffindex.manpages
trunk/packages/ffindex/trunk/debian/patches/Makefile
trunk/packages/ffindex/trunk/debian/patches/series
trunk/packages/ffindex/trunk/debian/rules
Log:
Included patches from Elso Andras <elso.andras at gmail.com>; added symbols control file; upstream incorporated some of our patches, so those are removed from here
Modified: trunk/packages/ffindex/trunk/debian/changelog
===================================================================
--- trunk/packages/ffindex/trunk/debian/changelog 2012-10-08 16:51:29 UTC (rev 12345)
+++ trunk/packages/ffindex/trunk/debian/changelog 2012-10-08 19:23:21 UTC (rev 12346)
@@ -1,3 +1,10 @@
+ffindex (0.9.8-1) unstable; urgency=low
+
+ * New upstream release.
+ * Added symbols control file.
+
+ -- Laszlo Kajan <lkajan at rostlab.org> Wed, 27 Jun 2012 15:27:47 +0200
+
ffindex (0.9.6.1-1) unstable; urgency=low
* New upstream release.
Modified: trunk/packages/ffindex/trunk/debian/ffindex.manpages
===================================================================
--- trunk/packages/ffindex/trunk/debian/ffindex.manpages 2012-10-08 16:51:29 UTC (rev 12345)
+++ trunk/packages/ffindex/trunk/debian/ffindex.manpages 2012-10-08 19:23:21 UTC (rev 12346)
@@ -3,3 +3,4 @@
ffindex_from_fasta.1
ffindex_get.1
ffindex_modify.1
+ffindex_unpack.1
Added: trunk/packages/ffindex/trunk/debian/libffindex0.symbols
===================================================================
--- trunk/packages/ffindex/trunk/debian/libffindex0.symbols (rev 0)
+++ trunk/packages/ffindex/trunk/debian/libffindex0.symbols 2012-10-08 19:23:21 UTC (rev 12346)
@@ -0,0 +1,29 @@
+libffindex.so.0 libffindex0 #MINVER#
+ fferror_print at Base 0.9.8
+ ffindex_bsearch_get_entry at Base 0.9.8
+ ffindex_copyright at Base 0.9.8
+ ffindex_copyright_text at Base 0.9.8
+ ffindex_fopen_by_entry at Base 0.9.8
+ ffindex_fopen_by_name at Base 0.9.8
+ ffindex_get_data_by_entry at Base 0.9.8
+ ffindex_get_data_by_index at Base 0.9.8
+ ffindex_get_data_by_name at Base 0.9.8
+ ffindex_get_data_by_offset at Base 0.9.8
+ ffindex_get_entry_by_index at Base 0.9.8
+ ffindex_index_as_tree at Base 0.9.8
+ ffindex_index_parse at Base 0.9.8
+ ffindex_insert_dir at Base 0.9.8
+ ffindex_insert_file at Base 0.9.8
+ ffindex_insert_filestream at Base 0.9.8
+ ffindex_insert_list_file at Base 0.9.8
+ ffindex_insert_memory at Base 0.9.8
+ ffindex_mmap_data at Base 0.9.8
+ ffindex_restore at Base 0.9.8
+ ffindex_sort_index_file at Base 0.9.8
+ ffindex_tree_get_entry at Base 0.9.8
+ ffindex_tree_unlink at Base 0.9.8
+ ffindex_tree_write at Base 0.9.8
+ ffindex_unlink at Base 0.9.8
+ ffindex_unlink_entries at Base 0.9.8
+ ffindex_write at Base 0.9.8
+ ffnchomp at Base 0.9.8
Deleted: trunk/packages/ffindex/trunk/debian/patches/40000000_bug
===================================================================
--- trunk/packages/ffindex/trunk/debian/patches/40000000_bug 2012-10-08 16:51:29 UTC (rev 12345)
+++ trunk/packages/ffindex/trunk/debian/patches/40000000_bug 2012-10-08 19:23:21 UTC (rev 12346)
@@ -1,104 +0,0 @@
-From: Laszlo Kajan <lkajan at rostlab.org>
-Subject: 40000000 bug
- The default value 40000000 for FFINDEX_MAX_INDEX_ENTRIES_DEFAULT is too high for a machine with 2G (or less) RAM.
- Bug fixed by introducing an environment variable FFINDEX_MAX_INDEX_ENTRIES to control the value.
-Forwarded: yes
-
---- a/src/ffindex.c
-+++ b/src/ffindex.c
-@@ -220,7 +220,7 @@
- ffindex_index_t* ffindex_index_parse(FILE *index_file, size_t num_max_entries)
- {
- if(num_max_entries == 0)
-- num_max_entries = FFINDEX_MAX_INDEX_ENTRIES_DEFAULT;
-+ num_max_entries = ffindex_max_index_entries();
- size_t nbytes = sizeof(ffindex_index_t) + (sizeof(ffindex_entry_t) * num_max_entries);
- ffindex_index_t *index = (ffindex_index_t *)malloc(nbytes);
- if(index == NULL)
---- a/src/ffindex.h
-+++ b/src/ffindex.h
-@@ -18,6 +18,8 @@
- #include <stdio.h>
-
- #define FFINDEX_VERSION 0.961
-+// lkajan: with ~72 bytes per entry, the below makes a default allocation over 2G. malloc in ffindex.c:225 fails on a machine with 'only' 2G of RAM.
-+// lkajan: let the default remain 40000000, and let the actual value be controlled by the env var FFINDEX_MAX_INDEX_ENTRIES wherever FFINDEX_MAX_INDEX_ENTRIES_DEFAULT is used.
- #define FFINDEX_MAX_INDEX_ENTRIES_DEFAULT 40000000
- #define FFINDEX_MAX_ENTRY_NAME_LENTH 56
-
-@@ -41,6 +43,8 @@
- ffindex_entry_t entries[]; /* This array is as big as the excess memory allocated for this struct. */
- } ffindex_index_t;
-
-+inline size_t ffindex_max_index_entries(){ char *FMIE = getenv("FFINDEX_MAX_INDEX_ENTRIES"); if( FMIE ) { return atol( FMIE ); } else { return FFINDEX_MAX_INDEX_ENTRIES_DEFAULT; } }
-+
- int ffindex_insert_memory(FILE *data_file, FILE *index_file, size_t *offset, char *from_start, size_t from_length, char *name);
-
- int ffindex_insert_file(FILE *data_file, FILE *index_file, size_t *offset, const char *path, char *name);
-Binary files a/src/ffindex_apply and b/src/ffindex_apply differ
---- a/src/ffindex_apply.c
-+++ b/src/ffindex_apply.c
-@@ -34,7 +34,9 @@
- if(argn < 4)
- {
- fprintf(stderr, "USAGE: ffindex_apply DATA_FILENAME INDEX_FILENAME PROGRAM [PROGRAM_ARGS]*\n"
-- "\nDesigned and implemented by Andy Hauser <hauser at genzentrum.lmu.de>.\n",
-+ "ENVIRONMENT\n"
-+ "\tFFINDEX_MAX_INDEX_ENTRIES - allocate memory for this number of entries\n"
-+ "\nDesigned and implemented by Andy Hauser <hauser at genzentrum.lmu.de>.\n"
- );
- return -1;
- }
---- a/src/ffindex_build.c
-+++ b/src/ffindex_build.c
-@@ -39,6 +39,8 @@
- "\t\t-f can be specified up to %d times\n"
- "\t-s\tsort index file\n"
- "\t-v\tprint version and other info then exit\n"
-+ "ENVIRONMENT\n"
-+ "\tFFINDEX_MAX_INDEX_ENTRIES - allocate memory for this number of entries\n"
- "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n", MAX_FILENAME_LIST_FILES);
- }
-
---- a/src/ffindex_from_fasta.c
-+++ b/src/ffindex_from_fasta.c
-@@ -33,6 +33,8 @@
- {
- fprintf(stderr, "USAGE: ffindex_from_fasta -v | [-s] data_filename index_filename fasta_filename\n"
- "\t-s\tsort index file\n"
-+ "ENVIRONMENT\n"
-+ "\tFFINDEX_MAX_INDEX_ENTRIES - allocate memory for this number of entries\n"
- "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n");
- }
-
---- a/src/ffindex_get.c
-+++ b/src/ffindex_get.c
-@@ -27,6 +27,8 @@
- if(argn < 3)
- {
- fprintf(stderr, "USAGE: ffindex_get data_filename index_filename filename(s)\n"
-+ "ENVIRONMENT\n"
-+ "\tFFINDEX_MAX_INDEX_ENTRIES - allocate memory for this number of entries\n"
- "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n");
- return -1;
- }
---- a/src/ffindex_modify.c
-+++ b/src/ffindex_modify.c
-@@ -37,6 +37,8 @@
- "\t-t\tuse tree (default, will be removed soon)\n"
- "\t-u\tunlink entry (remove from index only)\n"
- "\t-v\tprint version and other info then exit\n"
-+ "ENVIRONMENT\n"
-+ "\tFFINDEX_MAX_INDEX_ENTRIES - allocate memory for this number of entries\n"
- "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n",
- MAX_FILENAME_LIST_FILES);
- }
-@@ -125,7 +127,7 @@
- }
- else
- {
-- char** sorted_names_to_unlink = malloc(FFINDEX_MAX_INDEX_ENTRIES_DEFAULT * sizeof(char *));
-+ char** sorted_names_to_unlink = malloc(ffindex_max_index_entries() * sizeof(char *));
- if(sorted_names_to_unlink == NULL)
- fferror_print(__FILE__, __LINE__, __func__, "malloc failed");
- /* For each list_file unlink all entries */
Modified: trunk/packages/ffindex/trunk/debian/patches/Makefile
===================================================================
--- trunk/packages/ffindex/trunk/debian/patches/Makefile 2012-10-08 16:51:29 UTC (rev 12345)
+++ trunk/packages/ffindex/trunk/debian/patches/Makefile 2012-10-08 19:23:21 UTC (rev 12346)
@@ -7,27 +7,6 @@
Upstream is aware but not interested in DESTDIR.
Forwarded: yes
---- a/Makefile
-+++ b/Makefile
-@@ -6,15 +6,8 @@
- MFILE=Makefile
- endif
-
--.PHONY: clean install deinstall clean
- all:
-- $(MAKE) -C src -f $(MFILE)
-+ $(MAKE) -C src -f $(MFILE) $@
-
--install:
-- $(MAKE) -C src install
--
--deinstall:
-- $(MAKE) -C src deinstall
--
--clean:
-- $(MAKE) -C src clean
-+%:
-+ $(MAKE) -C src -f $(MFILE) $@
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,15 +1,16 @@
@@ -53,36 +32,14 @@
endif
#-Wl,--version-script=libffindex.map
-@@ -25,33 +26,34 @@
- ffindex_apply: $(FFINDEX_OBJECTS) ffindex_apply.o ffindex.h
+@@ -47,16 +48,17 @@
+ ffindex_unpack: $(FFINDEX_OBJECTS) ffindex_unpack.o ffindex.h
+ $(CC) -o $@ ffindex_unpack.o $(LDFLAGS) -L. -lffindex
- ffindex_apply_mpi: $(FFINDEX_OBJECTS) ffindex_apply_mpi.o ffindex.h
-- mpicc $(CFLAGS) -I $(MPI_INCLUDE) -o $@ ffindex_apply_mpi.o $(LDFLAGS)
-+ mpicc $(CFLAGS) -I $(MPI_INCLUDE) -o $@ ffindex_apply_mpi.o $(LDFLAGS) -L. -lffindex
-
- ffindex_apply_mpi.o: ffindex_apply_mpi.c ffindex.h
- mpicc $(CFLAGS) -I $(MPI_INCLUDE) -c ffindex_apply_mpi.c -o $@
-
- ffindex_from_fasta: $(FFINDEX_OBJECTS) ffindex_from_fasta.o ffindex.h
-- $(CC) -o $@ ffindex_from_fasta.o $(LDFLAGS) -L. -lffindex
-+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ ffindex_from_fasta.o $(LDFLAGS) -L. -lffindex
-
- ffindex_get: $(FFINDEX_OBJECTS) ffindex_get.o ffindex.h
-- $(CC) -o $@ ffindex_get.o $(LDFLAGS) -L. -lffindex
-+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ ffindex_get.o $(LDFLAGS) -L. -lffindex
-
- ffindex_build: $(FFINDEX_OBJECTS) ffindex_build.o ffindex.h
-- $(CC) -o $@ ffindex_build.o $(LDFLAGS) -L. -lffindex
-+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ ffindex_build.o $(LDFLAGS) -L. -lffindex
-
- ffindex_modify: $(FFINDEX_OBJECTS) ffindex_modify.o ffindex.h
-- $(CC) -o $@ ffindex_modify.o $(LDFLAGS) -L. -lffindex
-+ $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ ffindex_modify.o $(LDFLAGS) -L. -lffindex
-
-libffindex.so.0.1: ffindex.o ffutil.o
- $(CC) -Wl,-z,defs -shared -Wl,-soname,libffindex.so.0.1 -o libffindex.so.0.1 ffindex.o ffutil.o -lc
+libffindex.so.$(SOVERSION): ffindex.o ffutil.o
-+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wl,-z,defstack -shared -Wl,-soname,libffindex.so.$(SOCURRENT) -o libffindex.so.$(SOVERSION) ffindex.o ffutil.o -lc
++ $(CC) $(LDFLAGS) -Wl,-z,defstack -shared -Wl,-soname,libffindex.so.$(SOCURRENT) -o libffindex.so.$(SOVERSION) ffindex.o ffutil.o -lc
-libffindex.so: libffindex.so.0.1
- ln -sf libffindex.so.0.1 libffindex.so
@@ -98,23 +55,24 @@
rm -f /tmp/test.data /tmp/test.ffindex
LD_LIBRARY_PATH=".:$(LD_LIBRARY_PATH)" ./ffindex_build -s /tmp/test.data /tmp/test.ffindex ../test/data ../test/data2
LD_LIBRARY_PATH=".:$(LD_LIBRARY_PATH)" ./ffindex_get /tmp/test.data /tmp/test.ffindex a b foo | tee /tmp/test.out
-@@ -71,9 +73,11 @@
+@@ -76,8 +78,11 @@
LD_LIBRARY_PATH=".:$(LD_LIBRARY_PATH)" zsh -c "time ./ffindex_get ../test_big/nr20_11Jan10_a3m_db ../test_big/nr20_11Jan10_a3m_db.ffindex BABBAMIBA.a3m KARDUZEBA.a3m HARPAQIBA.a3m WOQQATEBA.a3m BEBRAQIBA.a3m GIRSAKEBA.a3m NAQTIFIBA.a3m BIWCIQABA.a3m > /dev/null"
clean:
- rm -f ffindex.o ffutil.o ffindex_build ffindex_build.o ffindex_get ffindex_get.o libffindex.so libffindex.so.0.1 ffindex_modify ffindex_modify.o \
+- libffindex.a ffindex_from_fasta.o ffindex_from_fasta ffindex_apply_mpi.o ffindex_apply.o
+ rm -f ffindex.o ffutil.o ffindex_build ffindex_build.o ffindex_get ffindex_get.o libffindex.so libffindex.so.$(SOCURRENT) libffindex.so.$(SOVERSION) ffindex_modify ffindex_modify.o \
- libffindex.a ffindex_from_fasta.o ffindex_from_fasta ffindex_apply_mpi.o ffindex_apply.o
-
-+distclean: clean
++ libffindex.a ffindex_from_fasta.o ffindex_from_fasta ffindex_apply_mpi.o ffindex_apply.o \
++ $(OBJECTS) $(OBJECTS:%=%.o)
+
++distclean: clean
+
install:
mkdir -p $(INSTALL_DIR)/bin
- mkdir -p $(INSTALL_DIR)/$(libdir)
-@@ -83,9 +87,10 @@
- install ffindex_modify $(INSTALL_DIR)/bin/ffindex_modify
+@@ -89,9 +94,10 @@
install ffindex_from_fasta $(INSTALL_DIR)/bin/ffindex_from_fasta
install ffindex_apply $(INSTALL_DIR)/bin/ffindex_apply
+ install ffindex_unpack $(INSTALL_DIR)/bin/ffindex_unpack
- install libffindex.so.0.1 $(INSTALL_DIR)/$(libdir)/libffindex.so.0.1
+ install libffindex.so.$(SOVERSION) $(INSTALL_DIR)/$(libdir)/libffindex.so.$(SOVERSION)
install libffindex.a $(INSTALL_DIR)/$(libdir)/libffindex.a
@@ -124,101 +82,3 @@
install ffindex.h $(INSTALL_DIR)/include/ffindex.h
install ffutil.h $(INSTALL_DIR)/include/ffutil.h
ifdef HAVE_MPI
---- a/src/ffindex_build.c
-+++ b/src/ffindex_build.c
-@@ -31,7 +31,7 @@
-
- void usage(char *program_name)
- {
-- fprintf(stderr, "USAGE: %s [-a|-v] [-s] [-f file]* data_filename index_filename [dir_to_index|file]*\n"
-+ fprintf(stderr, "USAGE: ffindex_build [-a|-v] [-s] [-f file]* data_filename index_filename [dir_to_index|file]*\n"
- "\t-a\tappend\n"
- "\t-d a second ffindex data file for inserting/appending\n"
- "\t-i a second ffindex index file for insterting/appending\n"
-@@ -39,7 +39,7 @@
- "\t\t-f can be specified up to %d times\n"
- "\t-s\tsort index file\n"
- "\t-v\tprint version and other info then exit\n"
-- "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n", program_name, MAX_FILENAME_LIST_FILES);
-+ "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n", MAX_FILENAME_LIST_FILES);
- }
-
- int main(int argn, char **argv)
---- a/src/ffindex_modify.c
-+++ b/src/ffindex_modify.c
-@@ -30,7 +30,7 @@
-
- void usage(char *program_name)
- {
-- fprintf(stderr, "USAGE: %s [-s|-u|-v] [-t] [-f file]* index_filename [filename]*\n"
-+ fprintf(stderr, "USAGE: ffindex_modify [-s|-u|-v] [-t] [-f file]* index_filename [filename]*\n"
- "\t-f file\tfile each line containing a filename\n"
- "\t\t-f can be specified up to %d times\n"
- "\t-s\tsort index file\n"
-@@ -38,7 +38,7 @@
- "\t-u\tunlink entry (remove from index only)\n"
- "\t-v\tprint version and other info then exit\n"
- "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n",
-- program_name, MAX_FILENAME_LIST_FILES);
-+ MAX_FILENAME_LIST_FILES);
- }
-
- int main(int argn, char **argv)
-@@ -149,14 +149,9 @@
- sorted_names_to_unlink[y] = argv[i];
- ffindex_unlink_entries(index, sorted_names_to_unlink, y);
-
-- /* Sort the index entries and write back */
-+ /* Sort the index entries */
- if(sort)
-- {
- ffindex_sort_index_file(index);
-- index_file = fopen(index_filename, "w");
-- if(index_file == NULL) { perror(index_filename); return EXIT_FAILURE; }
-- err += ffindex_write(index, index_file);
-- }
- }
- }
-
---- a/src/ffindex_get.c
-+++ b/src/ffindex_get.c
-@@ -26,9 +26,8 @@
- {
- if(argn < 3)
- {
-- fprintf(stderr, "USAGE: %s data_filename index_filename filename(s)\n"
-- "\nDesigned and implemented by Andy Hauser <hauser at genzentrum.lmu.de>.\n",
-- argv[0]);
-+ fprintf(stderr, "USAGE: ffindex_get data_filename index_filename filename(s)\n"
-+ "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n");
- return -1;
- }
- char *data_filename = argv[1];
---- a/src/ffindex_apply.c
-+++ b/src/ffindex_apply.c
-@@ -33,9 +33,9 @@
- {
- if(argn < 4)
- {
-- fprintf(stderr, "USAGE: %s DATA_FILENAME INDEX_FILENAME PROGRAM [PROGRAM_ARGS]*\n"
-+ fprintf(stderr, "USAGE: ffindex_apply DATA_FILENAME INDEX_FILENAME PROGRAM [PROGRAM_ARGS]*\n"
- "\nDesigned and implemented by Andy Hauser <hauser at genzentrum.lmu.de>.\n",
-- argv[0]);
-+ );
- return -1;
- }
- char *data_filename = argv[1];
---- a/src/ffindex_from_fasta.c
-+++ b/src/ffindex_from_fasta.c
-@@ -31,9 +31,9 @@
-
- void usage(char *program_name)
- {
-- fprintf(stderr, "USAGE: %s -v | [-s] data_filename index_filename fasta_filename\n"
-+ fprintf(stderr, "USAGE: ffindex_from_fasta -v | [-s] data_filename index_filename fasta_filename\n"
- "\t-s\tsort index file\n"
-- "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n", program_name);
-+ "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n");
- }
-
- int main(int argn, char **argv)
Added: trunk/packages/ffindex/trunk/debian/patches/basename
===================================================================
--- trunk/packages/ffindex/trunk/debian/patches/basename (rev 0)
+++ trunk/packages/ffindex/trunk/debian/patches/basename 2012-10-08 19:23:21 UTC (rev 12346)
@@ -0,0 +1,130 @@
+Author: Laszlo Kajan <lkajan at rostlab.org>
+Author: Elso Andras <elso.andras at gmail.com>
+Subject: 40000000 bug and basename
+ [Laszlo Kajan]
+ The default value 40000000 for FFINDEX_MAX_INDEX_ENTRIES_DEFAULT is too high for a machine with 2G (or less) RAM.
+ Bug fixed by introducing an environment variable FFINDEX_MAX_INDEX_ENTRIES to control the value.
+ [Elso Andras]
+ using basename for usage print, this helps help2man if a packager is using it
+Forwarded: yes
+
+--- a/src/ffindex_apply.c
++++ b/src/ffindex_apply.c
+@@ -34,8 +34,10 @@
+ if(argn < 4)
+ {
+ fprintf(stderr, "USAGE: %s DATA_FILENAME INDEX_FILENAME PROGRAM [PROGRAM_ARGS]*\n"
++ "ENVIRONMENT\n"
++ "\tFFINDEX_MAX_INDEX_ENTRIES - allocate memory for this number of entries\n"
+ "\nDesigned and implemented by Andy Hauser <hauser at genzentrum.lmu.de>.\n",
+- argv[0]);
++ basename(argv[0]));
+ return -1;
+ }
+ char *data_filename = argv[1];
+--- a/src/ffindex_apply_mpi.c
++++ b/src/ffindex_apply_mpi.c
+@@ -186,7 +186,7 @@
+ fprintf(stderr, "Not enough arguments %d.\n", optind - argn);
+ fprintf(stderr, "USAGE: %s -d DATA_FILENAME_OUT -i INDEX_FILENAME_OUT DATA_FILENAME INDEX_FILENAME -- PROGRAM [PROGRAM_ARGS]*\n"
+ "\nDesigned and implemented by Andy Hauser <hauser at genzentrum.lmu.de>.\n",
+- argv[0]);
++ basename(argv[0]));
+ return -1;
+ }
+ read_buffer = malloc(400 * 1024 * 1024);
+--- a/src/ffindex_build.c
++++ b/src/ffindex_build.c
+@@ -40,6 +40,8 @@
+ "\t-s\t\tsort index file, so that the index can queried.\n"
+ "\t\t\tAnother append operations can be done without sorting.\n"
+ "\t-v\t\tprint version and other info then exit\n"
++ "ENVIRONMENT\n"
++ "\tFFINDEX_MAX_INDEX_ENTRIES - allocate memory for this number of entries\n"
+ "\nEXAMPLES:\n"
+ "\tCreate a new ffindex containing all files from the \"bar/\" directory containing\n"
+ "\tsay myfile1.txt, myfile2.txt and sort (-s) it so that e.g. ffindex_get can use it.\n"
+@@ -52,7 +54,7 @@
+ "\tMaximum key/filename length is %d and maximum entries are by default %d\n"
+ "\tThis can be changed in the sources.\n"
+ "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n",
+- program_name, MAX_FILENAME_LIST_FILES, FFINDEX_MAX_ENTRY_NAME_LENTH, FFINDEX_MAX_INDEX_ENTRIES_DEFAULT);
++ basename(program_name), MAX_FILENAME_LIST_FILES, FFINDEX_MAX_ENTRY_NAME_LENTH, FFINDEX_MAX_INDEX_ENTRIES_DEFAULT);
+ }
+
+ int main(int argn, char **argv)
+--- a/src/ffindex_from_fasta.c
++++ b/src/ffindex_from_fasta.c
+@@ -33,7 +33,9 @@
+ {
+ fprintf(stderr, "USAGE: %s -v | [-s] data_filename index_filename fasta_filename\n"
+ "\t-s\tsort index file\n"
+- "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n", program_name);
++ "ENVIRONMENT\n"
++ "\tFFINDEX_MAX_INDEX_ENTRIES - allocate memory for this number of entries\n"
++ "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n", basename(program_name));
+ }
+
+ int main(int argn, char **argv)
+@@ -127,4 +129,4 @@
+ return err;
+ }
+
+-/* vim: ts=2 sw=2 et: */
++// vim: ts=2 sw=2 et:
+--- a/src/ffindex_get.c
++++ b/src/ffindex_get.c
+@@ -26,8 +26,10 @@
+ {
+ fprintf(stderr, "USAGE: %s data_filename index_filename entry name(s)\n"
+ "-n\tuse index of entry instead of entry name\n"
++ "ENVIRONMENT\n"
++ "\tFFINDEX_MAX_INDEX_ENTRIES - allocate memory for this number of entries\n"
+ "\nDesigned and implemented by Andy Hauser <hauser at genzentrum.lmu.de>.\n",
+- program_name);
++ basename(program_name));
+ }
+
+ int main(int argn, char **argv)
+--- a/src/ffindex_modify.c
++++ b/src/ffindex_modify.c
+@@ -37,7 +37,7 @@
+ "\t-u\tunlink entry (remove from index only)\n"
+ "\t-v\tprint version and other info then exit\n"
+ "\nDesigned and implemented by Andreas W. Hauser <hauser at genzentrum.lmu.de>.\n",
+- program_name, MAX_FILENAME_LIST_FILES);
++ basename(program_name), MAX_FILENAME_LIST_FILES);
+ }
+
+ int main(int argn, char **argv)
+@@ -124,7 +124,7 @@
+ }
+ else
+ {
+- char** sorted_names_to_unlink = malloc(FFINDEX_MAX_INDEX_ENTRIES_DEFAULT * sizeof(char *));
++ char** sorted_names_to_unlink = malloc(ffindex_max_index_entries() * sizeof(char *));
+ if(sorted_names_to_unlink == NULL)
+ fferror_print(__FILE__, __LINE__, __func__, "malloc failed");
+ /* For each list_file unlink all entries */
+--- a/src/ffindex_unpack.c
++++ b/src/ffindex_unpack.c
+@@ -35,7 +35,7 @@
+ {
+ fprintf(stderr, "USAGE: %s DATA_FILENAME INDEX_FILENAME OUT_DIR\n"
+ "\nDesigned and implemented by Andy Hauser <hauser at genzentrum.lmu.de>.\n",
+- argv[0]);
++ basename(argv[0]));
+ return -1;
+ }
+ char *data_filename = argv[1];
+--- a/src/ffindex.c
++++ b/src/ffindex.c
+@@ -223,7 +223,7 @@
+ ffindex_index_t* ffindex_index_parse(FILE *index_file, size_t num_max_entries)
+ {
+ if(num_max_entries == 0)
+- num_max_entries = FFINDEX_MAX_INDEX_ENTRIES_DEFAULT;
++ num_max_entries = ffindex_max_index_entries();
+ size_t nbytes = sizeof(ffindex_index_t) + (sizeof(ffindex_entry_t) * num_max_entries);
+ ffindex_index_t *index = (ffindex_index_t *)malloc(nbytes);
+ if(index == NULL)
Deleted: trunk/packages/ffindex/trunk/debian/patches/hardening
===================================================================
--- trunk/packages/ffindex/trunk/debian/patches/hardening 2012-10-08 16:51:29 UTC (rev 12345)
+++ trunk/packages/ffindex/trunk/debian/patches/hardening 2012-10-08 19:23:21 UTC (rev 12346)
@@ -1,18 +0,0 @@
-From: Laszlo Kajan <lkajan at rostlab.org>
-Subject: hardening flags
-Forwarded: yes
-
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -15,6 +15,11 @@
-
- #-Wl,--version-script=libffindex.map
-
-+# hardening flags
-+CFLAGS+=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security
-+CPPFLAGS+=-D_FORTIFY_SOURCE=2
-+LDFLAGS+=-Wl,-z,relro
-+
- ifdef HAVE_MPI
- all: ffindex_apply_mpi ffindex_apply ffindex_from_fasta ffindex_get ffindex_build ffindex_modify libffindex.a libffindex.so
- else
Deleted: trunk/packages/ffindex/trunk/debian/patches/num_max_entries_bug
===================================================================
--- trunk/packages/ffindex/trunk/debian/patches/num_max_entries_bug 2012-10-08 16:51:29 UTC (rev 12345)
+++ trunk/packages/ffindex/trunk/debian/patches/num_max_entries_bug 2012-10-08 19:23:21 UTC (rev 12346)
@@ -1,23 +0,0 @@
-From: Laszlo Kajan <lkajan at rostlab.org>
-Subject: index pointer used before checking for NULL
-Forwarded: yes
-
---- a/src/ffindex.c
-+++ b/src/ffindex.c
-@@ -223,13 +223,14 @@
- num_max_entries = FFINDEX_MAX_INDEX_ENTRIES_DEFAULT;
- size_t nbytes = sizeof(ffindex_index_t) + (sizeof(ffindex_entry_t) * num_max_entries);
- ffindex_index_t *index = (ffindex_index_t *)malloc(nbytes);
-- index->num_max_entries = num_max_entries;
- if(index == NULL)
- {
-- fferror_print(__FILE__, __LINE__, __func__, "malloc failed");
-+ char buf[2048]; snprintf( buf, 2048, "malloc failed to allocate %ld bytes", nbytes );
-+ fferror_print(__FILE__, __LINE__, __func__, buf );
- return NULL;
- }
-
-+ index->num_max_entries = num_max_entries;
- index->file = index_file;
- index->index_data = ffindex_mmap_data(index_file, &(index->index_data_size));
- if(index->index_data_size == 0)
Modified: trunk/packages/ffindex/trunk/debian/patches/series
===================================================================
--- trunk/packages/ffindex/trunk/debian/patches/series 2012-10-08 16:51:29 UTC (rev 12345)
+++ trunk/packages/ffindex/trunk/debian/patches/series 2012-10-08 19:23:21 UTC (rev 12346)
@@ -1,4 +1,2 @@
Makefile
-hardening
-num_max_entries_bug
-40000000_bug
+basename
Modified: trunk/packages/ffindex/trunk/debian/rules
===================================================================
--- trunk/packages/ffindex/trunk/debian/rules 2012-10-08 16:51:29 UTC (rev 12345)
+++ trunk/packages/ffindex/trunk/debian/rules 2012-10-08 19:23:21 UTC (rev 12346)
@@ -3,10 +3,15 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
+export CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
+export CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+export CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
+export LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+
%:
dh $@ --parallel
-FFMANPAGES = ffindex_apply.1 ffindex_build.1 ffindex_from_fasta.1 ffindex_get.1 ffindex_modify.1
+FFMANPAGES = ffindex_apply.1 ffindex_build.1 ffindex_from_fasta.1 ffindex_get.1 ffindex_modify.1 ffindex_unpack.1
.PHONY: ffmanpages
ffmanpages: $(FFMANPAGES)
BINNAMES = \
@@ -15,6 +20,7 @@
ffindex_from_fasta="populate index from FASTA file";\
ffindex_get="retrieve entries from file index";\
ffindex_modify="modify file index entries";\
+ ffindex_unpack="unpack file index entries";
.PHONY: override_dh_installman
override_dh_installman: $(FFMANPAGES)
More information about the debian-med-commit
mailing list