Merge lp:~noskcaj/ubuntu/trusty/sra-sdk/ftbfs into lp:ubuntu/trusty/sra-sdk

Proposed by Jackson Doak
Status: Merged
Merge reported by: Martin Pitt
Merged at revision: not available
Proposed branch: lp:~noskcaj/ubuntu/trusty/sra-sdk/ftbfs
Merge into: lp:ubuntu/trusty/sra-sdk
Diff against target: 311195 lines (+253319/-27106)
1118 files modified
.pc/.quilt_patches (+1/-0)
.pc/.quilt_series (+1/-0)
.pc/10_portability.patch/build/Makefile.gcc (+14/-4)
.pc/10_portability.patch/build/Makefile.shell (+81/-37)
.pc/applied-patches (+4/-0)
.pc/build-with-system-libbz2-libz.patch/libs/ncbi-vdb/Makefile (+154/-0)
.pc/do_not_build_external_libs.patch/libs/Makefile (+74/-0)
.pc/hardening-format-security.patch/libs/kdb/database.c (+706/-0)
.pc/hardening-format-security.patch/libs/kdb/index.c (+1006/-0)
.pc/hardening-format-security.patch/libs/kdb/table.c (+706/-0)
.pc/hardening.patch/Makefile (+110/-0)
.pc/hardening.patch/build/Makefile.env (+343/-0)
CHANGES (+0/-30)
Makefile (+20/-42)
README (+2/-20)
README-WINDOWS.txt (+15/-0)
README-build (+0/-237)
README-build.txt (+259/-0)
README-config.txt (+58/-0)
USAGE (+0/-162)
build/BUILD.linux (+1/-1)
build/BUILD.mac (+1/-1)
build/BUILD.win (+1/-1)
build/LNKG.linux (+1/-0)
build/LNKG.mac (+1/-0)
build/LNKG.win (+1/-0)
build/Makefile.clang (+80/-0)
build/Makefile.env (+122/-56)
build/Makefile.gcc (+14/-4)
build/Makefile.linux (+7/-0)
build/Makefile.mac (+7/-0)
build/Makefile.rules (+0/-5)
build/Makefile.shell (+76/-39)
build/Makefile.targets (+114/-0)
build/Makefile.vc++ (+12/-10)
build/Makefile.win (+7/-0)
build/ld.linux.cmn.sh (+6/-1)
build/ld.linux.dlib.sh (+17/-1)
build/ld.linux.exe.sh (+18/-1)
build/ld.linux.ln.sh (+12/-1)
build/ld.linux.slib.sh (+5/-5)
build/ld.mac.cmn.sh (+11/-2)
build/ld.mac.dlib.sh (+159/-18)
build/ld.mac.exe.sh (+125/-13)
build/ld.mac.ln.sh (+2/-0)
build/ld.mac.slib.sh (+6/-6)
build/ld.sh (+247/-67)
build/ld.unix.slib.sh (+3/-3)
build/ld.win.cmn.sh (+64/-1)
build/ld.win.dlib.sh (+31/-31)
build/ld.win.exe.sh (+4/-4)
build/ld.win.slib.sh (+23/-28)
build/mac.arch.sh (+8/-1)
build/sra-dflt-schema.sh (+61/-14)
build/win-cc.sh (+123/-14)
configuration-assistant.perl (+888/-452)
debian/changelog (+43/-0)
debian/compat (+1/-1)
debian/control (+18/-14)
debian/copyright (+5/-2)
debian/docs (+0/-1)
debian/patches/10_portability.patch (+40/-25)
debian/patches/build-with-system-libbz2-libz.patch (+36/-0)
debian/patches/do_not_build_external_libs.patch (+14/-0)
debian/patches/hardening-format-security.patch (+43/-0)
debian/patches/hardening.patch (+39/-0)
debian/patches/series (+4/-0)
debian/rules (+15/-10)
debian/sra-toolkit-libs0.lintian-overrides (+1/-0)
debian/sra-toolkit-libs0.symbols (+6085/-3142)
debian/sra-toolkit.install (+0/-2)
debian/upstream (+12/-0)
debian/watch (+2/-1)
doc/help/html/bam-load-help.html (+29/-0)
doc/help/html/bam-loader-help.html (+0/-31)
doc/help/html/crc32sum-help.html (+1/-1)
interfaces/align/align-access.h (+8/-3)
interfaces/align/align.vschema (+537/-178)
interfaces/align/alignarc.h (+0/-63)
interfaces/align/bam.h (+70/-49)
interfaces/align/dna-reverse-cmpl.h (+43/-0)
interfaces/align/iterator.h (+610/-0)
interfaces/align/manager.h (+69/-0)
interfaces/align/qstat.vschema (+87/-0)
interfaces/align/quality-quantizer.h (+49/-0)
interfaces/align/reader-refseq.h (+3/-3)
interfaces/align/reference.h (+150/-0)
interfaces/align/refseq-mgr.h (+9/-7)
interfaces/align/refseq.vschema (+100/-0)
interfaces/align/seq.vschema (+300/-0)
interfaces/align/writer-alignment.h (+53/-24)
interfaces/align/writer-reference.h (+46/-13)
interfaces/align/writer-refseq.h (+7/-2)
interfaces/align/writer-sequence.h (+12/-5)
interfaces/cc/gcc/i386/atomic.h (+1/-0)
interfaces/cc/gcc/i386/fmtdef.h (+0/-42)
interfaces/cc/gcc/noarch/bitstr.h (+15/-14)
interfaces/cc/gcc/v128.h (+1088/-0)
interfaces/cc/gcc/x86_64/fmtdef.h (+0/-58)
interfaces/cc/vc++/compiler.h (+1/-1)
interfaces/cc/vc++/i386/arch-impl.h (+0/-194)
interfaces/cc/vc++/i386/fmtdef.h (+0/-42)
interfaces/cc/vc++/noarch/arch-impl.h (+194/-0)
interfaces/cc/vc++/noarch/bitstr.h (+4/-4)
interfaces/cc/vc++/stdint.h (+43/-2)
interfaces/cc/vc++/x86_64/arch-impl.h (+0/-133)
interfaces/cc/vc++/x86_64/fmtdef.h (+0/-41)
interfaces/ext/libxml/DOCBparser.h (+96/-0)
interfaces/ext/libxml/HTMLparser.h (+303/-0)
interfaces/ext/libxml/HTMLtree.h (+147/-0)
interfaces/ext/libxml/SAX.h (+173/-0)
interfaces/ext/libxml/SAX2.h (+176/-0)
interfaces/ext/libxml/c14n.h (+115/-0)
interfaces/ext/libxml/catalog.h (+182/-0)
interfaces/ext/libxml/chvalid.h (+230/-0)
interfaces/ext/libxml/debugXML.h (+217/-0)
interfaces/ext/libxml/dict.h (+69/-0)
interfaces/ext/libxml/encoding.h (+226/-0)
interfaces/ext/libxml/entities.h (+150/-0)
interfaces/ext/libxml/globals.h (+491/-0)
interfaces/ext/libxml/hash.h (+233/-0)
interfaces/ext/libxml/list.h (+137/-0)
interfaces/ext/libxml/nanoftp.h (+143/-0)
interfaces/ext/libxml/nanohttp.h (+81/-0)
interfaces/ext/libxml/parser.h (+1226/-0)
interfaces/ext/libxml/parserInternals.h (+611/-0)
interfaces/ext/libxml/pattern.h (+100/-0)
interfaces/ext/libxml/relaxng.h (+213/-0)
interfaces/ext/libxml/schemasInternals.h (+958/-0)
interfaces/ext/libxml/schematron.h (+142/-0)
interfaces/ext/libxml/threads.h (+84/-0)
interfaces/ext/libxml/tree.h (+1252/-0)
interfaces/ext/libxml/uri.h (+94/-0)
interfaces/ext/libxml/valid.h (+458/-0)
interfaces/ext/libxml/xinclude.h (+125/-0)
interfaces/ext/libxml/xlink.h (+189/-0)
interfaces/ext/libxml/xmlIO.h (+360/-0)
interfaces/ext/libxml/xmlautomata.h (+146/-0)
interfaces/ext/libxml/xmlerror.h (+944/-0)
interfaces/ext/libxml/xmlexports.h (+157/-0)
interfaces/ext/libxml/xmlmemory.h (+224/-0)
interfaces/ext/libxml/xmlmodule.h (+57/-0)
interfaces/ext/libxml/xmlreader.h (+424/-0)
interfaces/ext/libxml/xmlregexp.h (+222/-0)
interfaces/ext/libxml/xmlsave.h (+87/-0)
interfaces/ext/libxml/xmlschemas.h (+218/-0)
interfaces/ext/libxml/xmlschemastypes.h (+151/-0)
interfaces/ext/libxml/xmlstring.h (+140/-0)
interfaces/ext/libxml/xmlunicode.h (+202/-0)
interfaces/ext/libxml/xmlversion.h (+458/-0)
interfaces/ext/libxml/xmlwriter.h (+485/-0)
interfaces/ext/libxml/xpath.h (+546/-0)
interfaces/ext/libxml/xpathInternals.h (+630/-0)
interfaces/ext/libxml/xpointer.h (+114/-0)
interfaces/insdc/insdc.h (+35/-0)
interfaces/insdc/sra.h (+14/-13)
interfaces/insdc/sra.vschema (+1/-0)
interfaces/kapp/args.h (+53/-1)
interfaces/kapp/loader-file.h (+15/-2)
interfaces/kapp/loader-meta.h (+1/-1)
interfaces/kapp/log-xml.h (+8/-2)
interfaces/kapp/queue-file.h (+149/-0)
interfaces/kdb/btree.h (+91/-4)
interfaces/kdb/consistency-check.h (+15/-6)
interfaces/kdb/database.h (+16/-2)
interfaces/kdb/kdb-priv.h (+24/-1)
interfaces/kdb/manager.h (+26/-14)
interfaces/kdb/namelist.h (+2/-1)
interfaces/kdb/table.h (+14/-0)
interfaces/kfg/config.h (+168/-7)
interfaces/kfg/kart.h (+87/-0)
interfaces/kfg/keystore-priv.h (+92/-0)
interfaces/kfg/keystore.h (+155/-0)
interfaces/kfg/kfg-priv.h (+4/-0)
interfaces/kfg/repository.h (+290/-0)
interfaces/kfs/arc.h (+14/-0)
interfaces/kfs/arrayfile.h (+18/-0)
interfaces/kfs/buffile.h (+10/-0)
interfaces/kfs/cacheteefile.h (+147/-0)
interfaces/kfs/directory.h (+64/-9)
interfaces/kfs/file.h (+29/-0)
interfaces/kfs/impl.h (+15/-1)
interfaces/kfs/kfs-priv.h (+20/-26)
interfaces/kfs/lockfile.h (+116/-0)
interfaces/kfs/path-priv.h (+0/-101)
interfaces/kfs/path.h (+0/-237)
interfaces/kfs/quickmount.h (+61/-0)
interfaces/kfs/ramfile.h (+75/-0)
interfaces/kfs/readheadfile.h (+86/-0)
interfaces/kfs/sra.h (+16/-4)
interfaces/kfs/tar.h (+5/-0)
interfaces/klib/checksum.h (+1/-1)
interfaces/klib/data-buffer.h (+20/-0)
interfaces/klib/debug.h (+25/-8)
interfaces/klib/defs.h (+35/-5)
interfaces/klib/extern.h (+5/-1)
interfaces/klib/klib-priv.h (+106/-0)
interfaces/klib/ksort-macro.h (+257/-0)
interfaces/klib/log.h (+14/-14)
interfaces/klib/namelist.h (+19/-3)
interfaces/klib/out.h (+5/-1)
interfaces/klib/printf.h (+256/-19)
interfaces/klib/ptrie.h (+1/-1)
interfaces/klib/rc.h (+56/-83)
interfaces/klib/refcount.h (+2/-6)
interfaces/klib/report.h (+98/-0)
interfaces/klib/sort.h (+60/-0)
interfaces/klib/status.h (+1/-1)
interfaces/klib/text.h (+1/-1)
interfaces/klib/vector.h (+155/-0)
interfaces/klib/writer.h (+2/-2)
interfaces/klib/xml.h (+0/-355)
interfaces/klib/xml.hpp (+0/-198)
interfaces/kns/KCurlRequest.h (+65/-0)
interfaces/kns/adapt.h (+89/-0)
interfaces/kns/ascp.h (+87/-0)
interfaces/kns/curl-file.h (+49/-0)
interfaces/kns/endpoint.h (+117/-0)
interfaces/kns/entrez-fetcher.h (+88/-0)
interfaces/kns/extern.h (+41/-0)
interfaces/kns/http.h (+278/-0)
interfaces/kns/impl.h (+104/-0)
interfaces/kns/manager.h (+85/-0)
interfaces/kns/socket.h (+98/-0)
interfaces/kns/stream.h (+126/-0)
interfaces/kns/url-fetcher.h (+66/-0)
interfaces/kproc/impl.h (+104/-0)
interfaces/kproc/procmgr.h (+115/-0)
interfaces/kproc/q-extern.h (+2/-2)
interfaces/kproc/queue.h (+1/-1)
interfaces/kproc/sem.h (+8/-0)
interfaces/kproc/task.h (+83/-0)
interfaces/kproc/timeout.h (+64/-0)
interfaces/krypto/cipher-impl.h (+1/-0)
interfaces/krypto/cipher-priv.h (+1/-0)
interfaces/krypto/cipher-test.h (+49/-0)
interfaces/krypto/cipher.h (+208/-0)
interfaces/krypto/ciphermgr-priv.h (+38/-0)
interfaces/krypto/ciphermgr.h (+98/-0)
interfaces/krypto/encfile-priv.h (+250/-0)
interfaces/krypto/encfile.h (+134/-0)
interfaces/krypto/extern.h (+66/-0)
interfaces/krypto/key.h (+103/-0)
interfaces/krypto/manager-priv.h (+26/-0)
interfaces/krypto/manager.h (+33/-0)
interfaces/krypto/reencfile.h (+91/-0)
interfaces/krypto/rng-impl.h (+86/-0)
interfaces/krypto/rng.h (+68/-0)
interfaces/krypto/testciphermgr.h (+58/-0)
interfaces/krypto/wgaencrypt.h (+128/-0)
interfaces/ktst/test_tools.hpp (+2/-91)
interfaces/ktst/unit_test.hpp (+238/-59)
interfaces/ktst/unit_test_suite.hpp (+304/-240)
interfaces/kxml/xml.h (+382/-0)
interfaces/loader/alignment-writer.h (+109/-0)
interfaces/loader/common-reader-priv.h (+300/-0)
interfaces/loader/common-reader.h (+486/-0)
interfaces/loader/common-writer.h (+192/-0)
interfaces/loader/mmarray.h (+50/-0)
interfaces/loader/reference-writer.h (+78/-0)
interfaces/loader/sequence-writer.h (+91/-0)
interfaces/ncbi/seq.vschema (+13/-14)
interfaces/ncbi/wgs-contig.h (+176/-0)
interfaces/ncbi/wgs-contig.vschema (+660/-0)
interfaces/os/mac/os-native.h (+4/-2)
interfaces/os/unix/unix-native.h (+0/-13)
interfaces/os/win/atomic64.h (+17/-17)
interfaces/os/win/os-native.h (+44/-15)
interfaces/sra/impl.h (+20/-0)
interfaces/sra/pevents.vschema (+1/-1)
interfaces/sra/sradb-priv.h (+164/-29)
interfaces/sra/srapath.h (+5/-4)
interfaces/vdb/blob.h (+147/-0)
interfaces/vdb/built-in.vschema (+19/-7)
interfaces/vdb/cursor.h (+37/-0)
interfaces/vdb/database.h (+17/-1)
interfaces/vdb/dependencies.h (+231/-0)
interfaces/vdb/manager.h (+23/-0)
interfaces/vdb/manager.hpp (+4/-4)
interfaces/vdb/report.h (+92/-0)
interfaces/vdb/vdb-priv.h (+80/-5)
interfaces/vdb/vdb.vschema (+52/-11)
interfaces/vdb/xform.h (+2/-2)
interfaces/vfs/extern.h (+47/-0)
interfaces/vfs/manager-priv.h (+131/-0)
interfaces/vfs/manager.h (+316/-0)
interfaces/vfs/path-priv.h (+266/-0)
interfaces/vfs/path.h (+242/-0)
interfaces/vfs/resolver.h (+267/-0)
libs/Makefile (+14/-55)
libs/align/Makefile (+25/-34)
libs/align/al_iterator.c (+562/-0)
libs/align/align-access.c (+13/-13)
libs/align/align_mgr.c (+108/-0)
libs/align/bam.c (+1936/-1073)
libs/align/debug.h (+35/-1)
libs/align/dna-reverse-cmpl.c (+80/-0)
libs/align/libalign-access.vers (+1/-1)
libs/align/libalign-reader.vers (+1/-1)
libs/align/libalign-writer.vers (+0/-1)
libs/align/pl_iterator.c (+686/-0)
libs/align/quality-quantizer.c (+105/-0)
libs/align/reader-cmn.c (+251/-65)
libs/align/reader-cmn.h (+28/-3)
libs/align/reader-refseq.c (+52/-55)
libs/align/ref_iterator.c (+866/-0)
libs/align/reference-cmn.c (+43/-0)
libs/align/reference-cmn.h (+38/-0)
libs/align/reference.c (+1943/-0)
libs/align/refseq-mgr.c (+449/-187)
libs/align/writer-alignment.c (+157/-60)
libs/align/writer-cmn.c (+104/-13)
libs/align/writer-priv.h (+13/-2)
libs/align/writer-ref.c (+145/-54)
libs/align/writer-ref.h (+13/-9)
libs/align/writer-reference.c (+2277/-892)
libs/align/writer-refseq.c (+16/-6)
libs/align/writer-sequence.c (+228/-22)
libs/ascp/Makefile (+80/-0)
libs/ascp/ascp-priv.h (+74/-0)
libs/ascp/ascp.c (+692/-0)
libs/ascp/linux/ascp-path.c (+61/-0)
libs/ascp/mac/ascp-path.c (+65/-0)
libs/ascp/unix/connect.c (+555/-0)
libs/ascp/win/ascp-path.c (+26/-0)
libs/ascp/win/connect.c (+520/-0)
libs/axf/Makefile (+19/-33)
libs/axf/align-local_ref_id.c (+30/-44)
libs/axf/align-local_ref_start.c (+25/-38)
libs/axf/align-ref-name.c (+22/-30)
libs/axf/align-ref-pos.c (+75/-86)
libs/axf/align-ref-seq-id.c (+30/-30)
libs/axf/align-restore-read.c (+22/-6)
libs/axf/cigar.c (+923/-192)
libs/axf/get-sam-flags.c (+53/-27)
libs/axf/get_mate_align_ids.c (+271/-0)
libs/axf/libaxf.vers (+1/-1)
libs/axf/libaxf.vers.h (+0/-1)
libs/axf/libwaxf.vers (+1/-1)
libs/axf/libwaxf.vers.h (+0/-1)
libs/axf/make-cmp-read_desc.c (+156/-0)
libs/axf/not-my-row.c (+1/-1)
libs/axf/project_read_from_sequence.c (+63/-56)
libs/axf/ref-preserve_qual.c (+2/-0)
libs/axf/ref-restore-read.c (+3/-3)
libs/axf/ref-tbl-sub-select.c (+340/-218)
libs/axf/ref-tbl.c (+85/-0)
libs/axf/ref-tbl.h (+32/-0)
libs/axf/refseq-stats.c (+1/-1)
libs/axf/seq-construct-read.c (+125/-0)
libs/axf/seq-restore-read.c (+43/-49)
libs/axf/template-len.c (+74/-44)
libs/ext/Makefile (+4/-50)
libs/ext/bzip2/Makefile (+48/-71)
libs/ext/curl/Makefile (+103/-0)
libs/ext/zlib/Makefile (+48/-73)
libs/kapp/Makefile (+15/-27)
libs/kapp/args.c (+581/-206)
libs/kapp/args_debug.h (+47/-0)
libs/kapp/libload.vers (+1/-1)
libs/kapp/loader-file.c (+77/-40)
libs/kapp/log-xml.c (+15/-13)
libs/kapp/main.c (+35/-3)
libs/kapp/queue-file.c (+925/-0)
libs/kapp/tokenizer.c (+525/-0)
libs/kapp/unix/sysmain.c (+13/-0)
libs/kapp/win/sysmain.c (+18/-0)
libs/kdb/Makefile (+15/-39)
libs/kdb/btree.c (+48/-23)
libs/kdb/coldata.c (+1/-1)
libs/kdb/colidx0.c (+2/-2)
libs/kdb/colidx1.c (+4/-4)
libs/kdb/colidx2-priv.h (+14/-15)
libs/kdb/colidx2.c (+74/-40)
libs/kdb/column-cc.c (+61/-12)
libs/kdb/column.c (+21/-16)
libs/kdb/database-cc.c (+155/-87)
libs/kdb/database-cmn.c (+4/-5)
libs/kdb/database.c (+182/-20)
libs/kdb/dbcc-cmn.c (+1/-1)
libs/kdb/dbmgr-cmn.c (+69/-38)
libs/kdb/dbmgr-priv.h (+6/-2)
libs/kdb/dbmgr.c (+265/-13)
libs/kdb/idxblk.c (+5/-4)
libs/kdb/index-cmn.h (+4/-3)
libs/kdb/index.c (+12/-8)
libs/kdb/kdb-priv.h (+30/-15)
libs/kdb/kdb.c (+527/-171)
libs/kdb/libkdb.vers (+1/-1)
libs/kdb/libkdb.vers.h (+27/-1)
libs/kdb/libwkdb.vers (+1/-1)
libs/kdb/libwkdb.vers.h (+27/-1)
libs/kdb/meta.c (+60/-26)
libs/kdb/ptrieval-v2.c (+76/-47)
libs/kdb/table-cc.c (+190/-47)
libs/kdb/table.c (+123/-18)
libs/kdb/trieidx-v2.c (+14/-7)
libs/kdb/trieval-v2.c (+2/-2)
libs/kdb/wcolidx0.c (+2/-2)
libs/kdb/wcolidx1.c (+5/-5)
libs/kdb/wcolidx2.c (+3/-3)
libs/kdb/wcolumn.c (+47/-42)
libs/kdb/wdatabase.c (+196/-47)
libs/kdb/wdbmgr.c (+9/-8)
libs/kdb/windex.c (+10/-6)
libs/kdb/wkdb-priv.h (+35/-27)
libs/kdb/wkdb.c (+516/-185)
libs/kdb/wmeta.c (+74/-33)
libs/kdb/wtable.c (+146/-45)
libs/kdb/wtrieidx-v1.c (+1/-1)
libs/kdb/wtrieidx-v2.c (+7/-7)
libs/kfg/Makefile (+29/-27)
libs/kfg/config-grammar.c (+1725/-0)
libs/kfg/config-lex.c (+2511/-0)
libs/kfg/config-tokens.h (+75/-0)
libs/kfg/config.c (+1997/-397)
libs/kfg/config.linux.kfg (+0/-29)
libs/kfg/config.mac.kfg (+0/-29)
libs/kfg/config.win.kfg (+0/-29)
libs/kfg/default.kfg (+45/-0)
libs/kfg/kart.c (+608/-0)
libs/kfg/keystore.c (+836/-0)
libs/kfg/kfg-parse.h (+81/-0)
libs/kfg/libkfg.vers (+1/-1)
libs/kfg/report-kfg.c (+505/-0)
libs/kfg/repository.c (+1186/-0)
libs/kfs/Makefile (+28/-44)
libs/kfs/arc.c (+192/-111)
libs/kfs/arrayfile.c (+41/-0)
libs/kfs/buffile-read.c (+265/-0)
libs/kfs/buffile-write.c (+2/-2)
libs/kfs/buffile.c (+1/-1)
libs/kfs/bzip.c (+25/-9)
libs/kfs/cacheteefile.c (+1689/-0)
libs/kfs/countfile.c (+11/-0)
libs/kfs/crc32.c (+11/-8)
libs/kfs/directory.c (+175/-10)
libs/kfs/ffext.c (+7/-5)
libs/kfs/ffmagic.c (+113/-9)
libs/kfs/file.c (+145/-15)
libs/kfs/fileformat-priv.h (+1/-1)
libs/kfs/gzip.c (+2/-3)
libs/kfs/libkfs.vers (+1/-1)
libs/kfs/lockfile.c (+350/-0)
libs/kfs/md5.c (+28/-14)
libs/kfs/mmap.c (+9/-5)
libs/kfs/nullfile.c (+1/-0)
libs/kfs/pagefile.c (+68/-55)
libs/kfs/path-priv.h (+0/-114)
libs/kfs/path.c (+0/-1669)
libs/kfs/pmem.c (+5/-0)
libs/kfs/quickmount.c (+967/-0)
libs/kfs/ramfile.c (+424/-0)
libs/kfs/readheadfile.c (+294/-0)
libs/kfs/report.c (+169/-0)
libs/kfs/sra.c (+65/-17)
libs/kfs/subfile.c (+9/-9)
libs/kfs/tar.c (+57/-37)
libs/kfs/teefile.c (+1/-0)
libs/kfs/toc.c (+11/-3)
libs/kfs/tocdir.c (+14/-4)
libs/kfs/tocentry.c (+22/-21)
libs/kfs/tocfile.c (+1/-1)
libs/kfs/unix/sysdir-priv.h (+0/-9)
libs/kfs/unix/sysdir.c (+68/-26)
libs/kfs/unix/sysdll.c (+101/-31)
libs/kfs/unix/sysfile-priv.h (+1/-1)
libs/kfs/unix/sysfile.c (+12/-12)
libs/kfs/unix/syslockfile.c (+215/-0)
libs/kfs/unix/syspath.c (+0/-126)
libs/kfs/win/lnk_tools.c (+7/-2)
libs/kfs/win/sysdir-priv.h (+2/-2)
libs/kfs/win/sysdir.c (+336/-94)
libs/kfs/win/sysdll.c (+118/-16)
libs/kfs/win/sysfile-priv.h (+4/-1)
libs/kfs/win/sysfile.c (+320/-29)
libs/kfs/win/syslockfile.c (+67/-0)
libs/kfs/win/sysmmap.c (+2/-0)
libs/kfs/win/syspath.c (+0/-287)
libs/klib/Judy.h (+629/-0)
libs/klib/Makefile (+22/-34)
libs/klib/SHA-32bit.c (+4/-4)
libs/klib/SHA-64bit.c (+4/-4)
libs/klib/data-buffer.c (+150/-94)
libs/klib/judy-vector.c (+892/-0)
libs/klib/judy/Judy1.h (+549/-0)
libs/klib/judy/JudyByCount.c (+952/-0)
libs/klib/judy/JudyByCountWithDefs.c (+4/-0)
libs/klib/judy/JudyCascade.c (+1940/-0)
libs/klib/judy/JudyCount.c (+1193/-0)
libs/klib/judy/JudyCreateBranch.c (+312/-0)
libs/klib/judy/JudyDecascade.c (+1204/-0)
libs/klib/judy/JudyDel.c (+2144/-0)
libs/klib/judy/JudyFirst.c (+211/-0)
libs/klib/judy/JudyFreeArray.c (+361/-0)
libs/klib/judy/JudyGet.c (+1092/-0)
libs/klib/judy/JudyHS.c (+770/-0)
libs/klib/judy/JudyHS.h (+35/-0)
libs/klib/judy/JudyIns.c (+1871/-0)
libs/klib/judy/JudyInsArray.c (+1176/-0)
libs/klib/judy/JudyInsertBranch.c (+133/-0)
libs/klib/judy/JudyL.h (+503/-0)
libs/klib/judy/JudyMalloc.c (+86/-0)
libs/klib/judy/JudyMallocIF.c (+780/-0)
libs/klib/judy/JudyMemActive.c (+257/-0)
libs/klib/judy/JudyMemUsed.c (+59/-0)
libs/klib/judy/JudyNext.c (+2/-0)
libs/klib/judy/JudyNextEmpty.c (+2/-0)
libs/klib/judy/JudyPrev.c (+2/-0)
libs/klib/judy/JudyPrevEmpty.c (+2/-0)
libs/klib/judy/JudyPrevNext.c (+1888/-0)
libs/klib/judy/JudyPrevNextEmpty.c (+1388/-0)
libs/klib/judy/JudyPrintJP.c (+399/-0)
libs/klib/judy/JudyPrivate.h (+1610/-0)
libs/klib/judy/JudyPrivate1L.h (+483/-0)
libs/klib/judy/JudyPrivateBranch.h (+777/-0)
libs/klib/judy/JudySL.c (+1125/-0)
libs/klib/judy/JudyTablesGen.c (+294/-0)
libs/klib/judy/Makefile (+190/-0)
libs/klib/judy/j__udyGet.c (+2/-0)
libs/klib/ksort.c (+97/-0)
libs/klib/libklib.vers (+1/-1)
libs/klib/libklib.vers.h (+0/-1)
libs/klib/log.c (+24/-18)
libs/klib/pbstree-impl.c (+114/-114)
libs/klib/printf.c (+2396/-37)
libs/klib/qsort.c (+33/-1)
libs/klib/refcount.c (+0/-1)
libs/klib/report.c (+816/-0)
libs/klib/status-rc.c (+2/-2)
libs/klib/status.c (+3/-3)
libs/klib/symtab.c (+1/-1)
libs/klib/text.c (+4/-4)
libs/klib/token.c (+4/-5)
libs/klib/unix/systime.c (+3/-1)
libs/klib/unix/syswriter.c (+1/-0)
libs/klib/unpack.c (+175/-1)
libs/klib/vector_namelist.c (+101/-14)
libs/klib/vlen-encode.c (+2/-1)
libs/klib/win/syserrcode.c (+1/-1)
libs/klib/win/syswriter.c (+16/-1)
libs/klib/writer.c (+5/-5)
libs/kns/KCurlFile.c (+716/-0)
libs/kns/KCurlRequest.c (+438/-0)
libs/kns/Makefile (+127/-0)
libs/kns/curlhdr/curl.h (+1600/-0)
libs/kns/curlhdr/curlver.h (+56/-0)
libs/kns/curlhdr/easy.h (+81/-0)
libs/kns/curlhdr/multi.h (+344/-0)
libs/kns/curlhdr/types.h (+1/-0)
libs/kns/endpoint.c (+109/-0)
libs/kns/entrez-fetcher.c (+221/-0)
libs/kns/http-priv.h (+97/-0)
libs/kns/http-test.c (+368/-0)
libs/kns/http.c (+3002/-0)
libs/kns/kns_manager.c (+311/-0)
libs/kns/kns_mgr_priv.h (+67/-0)
libs/kns/libkns.vers (+1/-0)
libs/kns/libkurl.vers (+1/-0)
libs/kns/stream-from-files.c (+168/-0)
libs/kns/stream-from-streams.c (+150/-0)
libs/kns/stream-priv.h (+36/-0)
libs/kns/stream.c (+336/-0)
libs/kns/unix/sysendpoint.c (+169/-0)
libs/kns/unix/sysmgr.c (+35/-0)
libs/kns/unix/syssock.c (+552/-0)
libs/kns/unix/sysstream.c (+251/-0)
libs/kns/url-fetcher-curl.c (+255/-0)
libs/kns/url-fetcher-impl.h (+109/-0)
libs/kns/url-fetcher.c (+129/-0)
libs/kns/win/sysendpoint.c (+185/-0)
libs/kns/win/sysmgr.c (+57/-0)
libs/kns/win/syssock.c (+663/-0)
libs/kns/win/sysstream.c (+232/-0)
libs/kproc/Makefile (+49/-57)
libs/kproc/bsd/syslock.c (+1/-0)
libs/kproc/libkproc.vers (+1/-1)
libs/kproc/libkq.vers (+1/-1)
libs/kproc/libksproc.vers (+1/-1)
libs/kproc/linux/syslock.c (+1/-0)
libs/kproc/procmgr.c (+412/-0)
libs/kproc/queue.c (+90/-3)
libs/kproc/sem.c (+61/-18)
libs/kproc/sttimeout.c (+1/-0)
libs/kproc/task.c (+156/-0)
libs/kproc/unix/syscond.c (+45/-1)
libs/kproc/unix/systimeout.c (+1/-0)
libs/kproc/win/syscond-priv.h (+3/-7)
libs/kproc/win/syscond.c (+243/-19)
libs/kproc/win/syslock.c (+5/-1)
libs/krypto/Makefile (+307/-0)
libs/krypto/aes-byte.c (+236/-0)
libs/krypto/aes-ncbi-priv.h (+227/-0)
libs/krypto/aes-ncbi.c (+2644/-0)
libs/krypto/aes-priv.h (+94/-0)
libs/krypto/aes.c (+1/-0)
libs/krypto/aes_core.c (+1181/-0)
libs/krypto/blockcipher-impl.h (+187/-0)
libs/krypto/blockcipher-priv.h (+90/-0)
libs/krypto/blockcipher.c (+3/-0)
libs/krypto/cipher-byte.c (+522/-0)
libs/krypto/cipher-impl.h (+174/-0)
libs/krypto/cipher-no-vec.c (+41/-0)
libs/krypto/cipher-priv.h (+79/-0)
libs/krypto/cipher-vec.c (+808/-0)
libs/krypto/cipher.c (+538/-0)
libs/krypto/ciphermgr.c (+295/-0)
libs/krypto/compile-test.c (+50/-0)
libs/krypto/csprng.c (+163/-0)
libs/krypto/encfile-priv.h (+163/-0)
libs/krypto/encfile.c (+2122/-0)
libs/krypto/encfilev2.c (+2589/-0)
libs/krypto/key.c (+126/-0)
libs/krypto/libkrypto.vers (+1/-0)
libs/krypto/libkryptotest.vers (+1/-0)
libs/krypto/manager.c (+11/-0)
libs/krypto/ncbi-priv.h (+122/-0)
libs/krypto/no-null-ncbi.c (+59/-0)
libs/krypto/null-ncbi-priv.h (+56/-0)
libs/krypto/null-ncbi.c (+251/-0)
libs/krypto/reencfile.c (+1255/-0)
libs/krypto/rng-impl.h (+91/-0)
libs/krypto/rng.c (+120/-0)
libs/krypto/testcipher.c (+76/-0)
libs/krypto/wgaencrypt.c (+1254/-0)
libs/ktst/Makefile (+81/-0)
libs/ktst/testcase.cpp (+95/-0)
libs/ktst/testenv.cpp (+505/-0)
libs/ktst/testrunner.cpp (+77/-0)
libs/ktst/unix/runprocesstestcase.cpp (+125/-0)
libs/ktst/win/runprocesstestcase.cpp (+152/-0)
libs/kxml/Makefile (+10/-51)
libs/kxml/libkxfs.vers (+1/-1)
libs/kxml/libkxml.vers (+1/-1)
libs/kxml/xml.c (+27/-17)
libs/kxml/xtoc-parsexml.c (+23/-13)
libs/kxml/xtoc.c (+316/-149)
libs/loader/Makefile (+87/-0)
libs/loader/alignment-writer.c (+262/-0)
libs/loader/common-reader.c (+614/-0)
libs/loader/common-writer.c (+2051/-0)
libs/loader/mmarray.c (+131/-0)
libs/loader/reference-writer.c (+462/-0)
libs/loader/sequence-writer.c (+361/-0)
libs/ncbi-vdb/Makefile (+152/-0)
libs/ncbi-vdb/libncbi-vdb.vers (+1/-0)
libs/ncbi-vdb/libncbi-wvdb.vers (+1/-0)
libs/search/Makefile (+8/-31)
libs/search/agrep-myersunltd.c (+3/-3)
libs/search/fgrep-dumb.c (+1/-1)
libs/search/libksrch.vers (+1/-1)
libs/search/libksrch.vers.h (+0/-1)
libs/sra/Makefile (+65/-106)
libs/sra/libsradb.vers (+1/-1)
libs/sra/libsradb.vers.h (+27/-1)
libs/sra/libsrareader.vers (+1/-1)
libs/sra/libsrareader.vers.h (+0/-1)
libs/sra/libsraschema.vers.h (+0/-1)
libs/sra/libwsradb.vers (+1/-1)
libs/sra/libwsradb.vers.h (+0/-1)
libs/sra/libwsraschema.vers.h (+0/-1)
libs/sra/reader-abi.c (+18/-7)
libs/sra/reader-cmn.c (+13/-11)
libs/sra/reader-fastq.c (+11/-5)
libs/sra/reader-illumina.c (+81/-15)
libs/sra/reader-sff.c (+73/-48)
libs/sra/sra-dflt-schema.c (+0/-1)
libs/sra/sra-priv.h (+18/-3)
libs/sra/sra-schema.c (+4083/-0)
libs/sra/sracache.c (+559/-0)
libs/sra/sramgr-cmn.c (+230/-103)
libs/sra/srapath-stub.c (+0/-408)
libs/sra/sraschema-stub.c (+0/-67)
libs/sra/sraschema.c (+0/-1)
libs/sra/sratbl-cmn.c (+349/-81)
libs/sra/wsramgr.c (+1/-0)
libs/sra/wsraschema-stub.c (+0/-67)
libs/sra/wsratbl.c (+13/-6)
libs/sraxf/Makefile (+10/-43)
libs/sraxf/fix_read_seg_impl.h (+169/-0)
libs/sraxf/format-spot-name.c (+9/-2)
libs/sraxf/index_lookup.c (+21/-2)
libs/sraxf/libsraxf.vers (+1/-1)
libs/sraxf/libsraxf.vers.h (+0/-1)
libs/sraxf/libwsraxf.vers (+1/-1)
libs/sraxf/libwsraxf.vers.h (+0/-1)
libs/sraxf/prefix-tree-to-name.c (+0/-2)
libs/sraxf/read-desc.c (+7/-2)
libs/sraxf/read-seg-from-readn.c (+9/-34)
libs/sraxf/stats.c (+130/-65)
libs/sraxf/stats_quality.c (+1/-1)
libs/sraxf/tokenize-spot_name-ion-torrent.c (+48/-23)
libs/sraxf/v0-decompress-local.h (+1/-1)
libs/vdb/Makefile (+18/-41)
libs/vdb/blob-priv.h (+55/-12)
libs/vdb/blob.c (+820/-100)
libs/vdb/blob.h (+0/-7)
libs/vdb/column-cmn.c (+27/-9)
libs/vdb/column-priv.h (+35/-27)
libs/vdb/cursor-cmn.c (+527/-236)
libs/vdb/cursor-priv.h (+32/-4)
libs/vdb/cursor.c (+2/-1)
libs/vdb/database-cmn.c (+27/-2)
libs/vdb/database-depend.c (+1802/-0)
libs/vdb/dbmgr-cmn.c (+249/-107)
libs/vdb/dbmgr-priv.h (+0/-42)
libs/vdb/dbmgr.c (+9/-6)
libs/vdb/delta_average.c (+297/-0)
libs/vdb/libvdb.vers (+1/-1)
libs/vdb/libvdb.vers.h (+27/-1)
libs/vdb/libwvdb.vers (+1/-1)
libs/vdb/libwvdb.vers.h (+27/-1)
libs/vdb/linker-cmn.c (+33/-3)
libs/vdb/linker-int.c (+398/-5)
libs/vdb/linker-priv.h (+10/-0)
libs/vdb/meta-attr-write.c (+12/-9)
libs/vdb/page-map.c (+1028/-383)
libs/vdb/page-map.h (+258/-47)
libs/vdb/phys-cmn.c (+52/-6)
libs/vdb/phys-priv.h (+5/-0)
libs/vdb/prod-cmn.c (+241/-108)
libs/vdb/prod-expr.c (+6/-6)
libs/vdb/prod-func.c (+3/-3)
libs/vdb/prod-priv.h (+47/-8)
libs/vdb/prod.c (+13/-0)
libs/vdb/redimension.c (+1/-0)
libs/vdb/report-vdb.c (+856/-0)
libs/vdb/schema-dump.c (+22/-15)
libs/vdb/schema-expr.c (+9/-2)
libs/vdb/schema-int.c (+1/-0)
libs/vdb/schema-parse.c (+8/-0)
libs/vdb/schema-parse.h (+5/-0)
libs/vdb/schema-priv.h (+3/-0)
libs/vdb/schema-tbl.c (+52/-2)
libs/vdb/schema-type.c (+15/-3)
libs/vdb/schema.c (+19/-11)
libs/vdb/table-cmn.c (+123/-4)
libs/vdb/table-priv.h (+1/-1)
libs/vdb/wcolumn.c (+641/-674)
libs/vdb/wcursor.c (+228/-52)
libs/vdb/wdbmgr.c (+0/-7)
libs/vdb/wlinker.c (+40/-1)
libs/vdb/wphys.c (+68/-33)
libs/vdb/wprod.c (+21/-7)
libs/vdb/wtable.c (+106/-7)
libs/vdb/xform-priv.h (+8/-35)
libs/vfs/Makefile (+101/-0)
libs/vfs/keyring-priv.h (+46/-0)
libs/vfs/keyring.c (+133/-0)
libs/vfs/keyring.h (+110/-0)
libs/vfs/libsrapath.vers (+1/-0)
libs/vfs/libvfs.vers (+1/-0)
libs/vfs/manager.c (+2948/-0)
libs/vfs/path-priv.h (+147/-0)
libs/vfs/path.c (+3349/-0)
libs/vfs/resolver-priv.h (+144/-0)
libs/vfs/resolver.c (+3992/-0)
libs/vfs/srapath-stub.c (+372/-0)
libs/vfs/srapath.c (+1424/-0)
libs/vfs/unix/syskeyring.c (+174/-0)
libs/vfs/unix/syspath.c (+149/-0)
libs/vfs/win/syskeyring.c (+56/-0)
libs/vfs/win/syspath.c (+342/-0)
libs/vxf/Makefile (+19/-44)
libs/vxf/checksum.c (+2/-0)
libs/vxf/integral.c (+5/-1)
libs/vxf/integral_0.c (+115/-0)
libs/vxf/irzip.c (+5/-1)
libs/vxf/irzip.impl.h (+118/-56)
libs/vxf/iunzip.c (+6/-1)
libs/vxf/izip-common.h (+2/-2)
libs/vxf/libvxf.vers (+1/-1)
libs/vxf/libvxf.vers.h (+0/-1)
libs/vxf/libwvxf.vers (+1/-1)
libs/vxf/lower-case-tech-reads.c (+111/-0)
libs/vxf/math-funcs-impl.h (+1/-1)
libs/vxf/rand_4na_2na.c (+1/-2)
libs/vxf/simple-sub-select.c (+57/-22)
libs/vxf/sprintf.c (+1233/-109)
libs/vxf/unzip.c (+16/-10)
libs/vxf/vec-sum.c (+144/-86)
libs/vxf/wgs-tokenize-accession.c (+212/-0)
libs/wgsxf/Makefile (+124/-0)
libs/wgsxf/build_read_type.c (+113/-0)
libs/wgsxf/build_scaffold.c (+435/-0)
libs/wgsxf/libwgsxf.vers (+1/-0)
libs/wgsxf/libwwgsxf.vers (+1/-0)
tools/Makefile (+15/-43)
tools/align-info/Makefile (+13/-31)
tools/align-info/align-info.c (+119/-439)
tools/align-info/align-info.vers (+1/-1)
tools/align-info/align-info.vers.h (+0/-1)
tools/bam-loader/Globals.h (+90/-0)
tools/bam-loader/KFileHelper.c (+142/-0)
tools/bam-loader/KFileHelper.h (+48/-0)
tools/bam-loader/KVPFile.c (+355/-0)
tools/bam-loader/KVPFile.h (+164/-0)
tools/bam-loader/Makefile (+101/-0)
tools/bam-loader/alignment-writer.c (+176/-0)
tools/bam-loader/alignment-writer.h (+95/-0)
tools/bam-loader/analysis.c (+157/-0)
tools/bam-loader/analysis.h (+49/-0)
tools/bam-loader/bam-load.vers (+1/-0)
tools/bam-loader/bam-loader.c (+987/-0)
tools/bam-loader/hashtable.c (+878/-0)
tools/bam-loader/hashtable.h (+55/-0)
tools/bam-loader/loader-imp.c (+2102/-0)
tools/bam-loader/loader-imp.h (+29/-0)
tools/bam-loader/reference-writer.c (+449/-0)
tools/bam-loader/reference-writer.h (+69/-0)
tools/bam-loader/sequence-writer.c (+345/-0)
tools/bam-loader/sequence-writer.h (+84/-0)
tools/cache-mgr/Makefile (+120/-0)
tools/cache-mgr/cache-mgr.c (+1332/-0)
tools/cache-mgr/cache-mgr.vers (+1/-0)
tools/cg-load/Makefile (+106/-0)
tools/cg-load/cg-load.c (+1120/-0)
tools/cg-load/cg-load.vers (+1/-0)
tools/cg-load/debug.h (+34/-0)
tools/cg-load/defs.h (+136/-0)
tools/cg-load/f1_3.c (+76/-0)
tools/cg-load/f1_5.c (+76/-0)
tools/cg-load/f2_0.c (+79/-0)
tools/cg-load/f2_2.c (+95/-0)
tools/cg-load/factory-cmn.h (+61/-0)
tools/cg-load/factory-evidence-dnbs.c (+351/-0)
tools/cg-load/factory-evidence-dnbs.h (+43/-0)
tools/cg-load/factory-evidence-intervals.c (+306/-0)
tools/cg-load/factory-evidence-intervals.h (+43/-0)
tools/cg-load/factory-file.h (+43/-0)
tools/cg-load/factory-mappings.c (+338/-0)
tools/cg-load/factory-mappings.h (+43/-0)
tools/cg-load/factory-reads.c (+261/-0)
tools/cg-load/factory-reads.h (+43/-0)
tools/cg-load/file-version-factory.c (+157/-0)
tools/cg-load/file.c (+403/-0)
tools/cg-load/file.h (+330/-0)
tools/cg-load/writer-algn.c (+775/-0)
tools/cg-load/writer-algn.h (+62/-0)
tools/cg-load/writer-evidence-dnbs.c (+227/-0)
tools/cg-load/writer-evidence-dnbs.h (+88/-0)
tools/cg-load/writer-evidence-intervals.c (+255/-0)
tools/cg-load/writer-evidence-intervals.h (+68/-0)
tools/cg-load/writer-seq.c (+135/-0)
tools/cg-load/writer-seq.h (+58/-0)
tools/fastq-loader/Makefile (+156/-0)
tools/fastq-loader/fastq-grammar.c (+2129/-0)
tools/fastq-loader/fastq-grammar.y (+294/-0)
tools/fastq-loader/fastq-lex.c (+2419/-0)
tools/fastq-loader/fastq-lex.l (+294/-0)
tools/fastq-loader/fastq-loader.c (+543/-0)
tools/fastq-loader/fastq-parse.h (+141/-0)
tools/fastq-loader/fastq-reader.c (+706/-0)
tools/fastq-loader/fastq-reader.h (+50/-0)
tools/fastq-loader/fastq-tokens.h (+64/-0)
tools/fastq-loader/latf-load.vers (+1/-0)
tools/fastq-loader/loader-imp.c (+246/-0)
tools/kar/Makefile (+19/-19)
tools/kar/kar.c (+109/-11)
tools/kar/kar.vers (+1/-1)
tools/kar/kar.vers.h (+0/-1)
tools/kar/sra-kar.c (+36/-1)
tools/kar/sra-kar.vers (+1/-1)
tools/kar/sra-kar.vers.h (+0/-1)
tools/nenctool/Makefile (+123/-0)
tools/nenctool/nenctest.c (+502/-0)
tools/nenctool/nenctest.vers (+1/-0)
tools/nenctool/nenctool.c (+446/-0)
tools/nenctool/nenctool.vers (+1/-0)
tools/nencvalid/Makefile (+111/-0)
tools/nencvalid/nencvalid.c (+607/-0)
tools/nencvalid/nencvalid.vers (+1/-0)
tools/prefetch/Makefile (+100/-0)
tools/prefetch/prefetch.c (+1965/-0)
tools/prefetch/prefetch.vers (+1/-0)
tools/refseq-load/Makefile (+0/-127)
tools/refseq-load/context.c (+0/-284)
tools/refseq-load/context.h (+0/-93)
tools/refseq-load/definitions.h (+0/-59)
tools/refseq-load/refseq-load-includes.h (+0/-115)
tools/refseq-load/refseq-load.c (+0/-623)
tools/refseq-load/refseq-load.vers (+0/-1)
tools/refseq-load/refseq-load.vers.h (+0/-1)
tools/sam-dump/Makefile (+16/-24)
tools/sam-dump/sam-dump.c (+4650/-1331)
tools/sam-dump/sam-dump.vers (+1/-1)
tools/sam-dump/sam-dump.vers.h (+0/-1)
tools/sra-dbcc/Makefile (+20/-22)
tools/sra-dbcc/sra-dbcc.c (+1365/-221)
tools/sra-dbcc/sra-dbcc.vers (+1/-1)
tools/sra-dbcc/sra-dbcc.vers.h (+0/-1)
tools/sra-dump/Makefile (+13/-59)
tools/sra-dump/abi-dump.vers (+1/-1)
tools/sra-dump/abi-dump.vers.h (+0/-1)
tools/sra-dump/abi.c (+69/-49)
tools/sra-dump/core.c (+1224/-536)
tools/sra-dump/core.h (+1/-1)
tools/sra-dump/factory.c (+131/-77)
tools/sra-dump/factory.h (+25/-4)
tools/sra-dump/fasta_dump.c (+752/-0)
tools/sra-dump/fasta_dump.h (+36/-0)
tools/sra-dump/fastq-dump.vers (+1/-1)
tools/sra-dump/fastq-dump.vers.h (+0/-1)
tools/sra-dump/fastq.c (+2731/-1473)
tools/sra-dump/illumina-dump.vers (+1/-1)
tools/sra-dump/illumina-dump.vers.h (+0/-1)
tools/sra-dump/illumina.c (+73/-53)
tools/sra-dump/sff-dump.vers (+1/-1)
tools/sra-dump/sff-dump.vers.h (+0/-1)
tools/sra-dump/sff.c (+14/-9)
tools/sra-dump/sra-dump.c (+30/-30)
tools/sra-dump/sra-dump.vers (+1/-1)
tools/sra-dump/sra-dump.vers.h (+0/-1)
tools/sra-load/Makefile (+12/-25)
tools/sra-load/abi-load.vers (+1/-1)
tools/sra-load/abi-load.vers.h (+0/-1)
tools/sra-load/absolid-fmt.c (+0/-6)
tools/sra-load/common-xml.c (+14/-65)
tools/sra-load/common-xml.h (+1/-29)
tools/sra-load/experiment-xml.c (+30/-140)
tools/sra-load/experiment-xml.h (+0/-1)
tools/sra-load/fastq-fmt.c (+10/-23)
tools/sra-load/fastq-load.vers (+1/-1)
tools/sra-load/fastq-load.vers.h (+0/-1)
tools/sra-load/helicos-fmt.c (+0/-5)
tools/sra-load/helicos-load.vers (+1/-1)
tools/sra-load/helicos-load.vers.h (+0/-1)
tools/sra-load/illumina-fmt.c (+0/-5)
tools/sra-load/illumina-load.vers (+1/-1)
tools/sra-load/illumina-load.vers.h (+0/-1)
tools/sra-load/loader-file.c (+7/-2)
tools/sra-load/loader-file.h (+3/-1)
tools/sra-load/loader-fmt.h (+1/-0)
tools/sra-load/loader.c (+38/-28)
tools/sra-load/run-xml.c (+3/-2)
tools/sra-load/run-xml.h (+2/-1)
tools/sra-load/sff-fmt.c (+0/-5)
tools/sra-load/sff-load.vers (+1/-1)
tools/sra-load/sff-load.vers.h (+0/-1)
tools/sra-load/srf-fmt.c (+0/-5)
tools/sra-load/srf-load.vers (+1/-1)
tools/sra-load/srf-load.vers.h (+0/-1)
tools/sra-load/writer-absolid.c (+8/-2)
tools/sra-load/writer-absolid.h (+4/-1)
tools/sra-pileup/Makefile (+130/-0)
tools/sra-pileup/cg_tools.c (+984/-0)
tools/sra-pileup/cg_tools.h (+124/-0)
tools/sra-pileup/cmdline_cmn.c (+1058/-0)
tools/sra-pileup/cmdline_cmn.h (+134/-0)
tools/sra-pileup/debug.h (+34/-0)
tools/sra-pileup/inputfiles.c (+376/-0)
tools/sra-pileup/inputfiles.h (+99/-0)
tools/sra-pileup/matecache.c (+439/-0)
tools/sra-pileup/matecache.h (+119/-0)
tools/sra-pileup/out_redir.c (+120/-0)
tools/sra-pileup/out_redir.h (+64/-0)
tools/sra-pileup/read_fkt.c (+718/-0)
tools/sra-pileup/read_fkt.h (+82/-0)
tools/sra-pileup/reref.c (+501/-0)
tools/sra-pileup/reref.h (+48/-0)
tools/sra-pileup/sam-aligned.c (+2046/-0)
tools/sra-pileup/sam-aligned.h (+45/-0)
tools/sra-pileup/sam-dump-opts.c (+1502/-0)
tools/sra-pileup/sam-dump-opts.h (+282/-0)
tools/sra-pileup/sam-dump.c (+4896/-0)
tools/sra-pileup/sam-dump.vers (+1/-0)
tools/sra-pileup/sam-dump3.c (+532/-0)
tools/sra-pileup/sam-hdr.c (+425/-0)
tools/sra-pileup/sam-hdr.h (+41/-0)
tools/sra-pileup/sam-unaligned.c (+1482/-0)
tools/sra-pileup/sam-unaligned.h (+43/-0)
tools/sra-pileup/sra-pileup.c (+2611/-0)
tools/sra-pileup/sra-pileup.vers (+1/-0)
tools/sra-sort/Makefile (+130/-0)
tools/sra-sort/Makefile.cc (+24/-0)
tools/sra-sort/Makefile.clang (+27/-0)
tools/sra-sort/Makefile.gcc (+27/-0)
tools/sra-sort/Makefile.vc++ (+24/-0)
tools/sra-sort/buff-writer.c (+785/-0)
tools/sra-sort/buff-writer.h (+64/-0)
tools/sra-sort/caps.c (+125/-0)
tools/sra-sort/caps.h (+70/-0)
tools/sra-sort/capture-first-half-aligned.c (+192/-0)
tools/sra-sort/col-pair.c (+816/-0)
tools/sra-sort/col-pair.h (+323/-0)
tools/sra-sort/csra-pair.c (+216/-0)
tools/sra-sort/csra-pair.h (+84/-0)
tools/sra-sort/csra-tbl.c (+783/-0)
tools/sra-sort/csra-tbl.h (+83/-0)
tools/sra-sort/ctx.h (+109/-0)
tools/sra-sort/db-pair.c (+883/-0)
tools/sra-sort/db-pair.h (+208/-0)
tools/sra-sort/dir-pair.c (+504/-0)
tools/sra-sort/dir-pair.h (+124/-0)
tools/sra-sort/dump-blob-boundaries.c (+203/-0)
tools/sra-sort/except.c (+231/-0)
tools/sra-sort/except.h (+160/-0)
tools/sra-sort/gcc-ped.sh (+39/-0)
tools/sra-sort/glob-poslen.c (+349/-0)
tools/sra-sort/glob-poslen.h (+95/-0)
tools/sra-sort/id-mapper-col.c (+260/-0)
tools/sra-sort/id-mapper-col.h (+55/-0)
tools/sra-sort/idx-mapping.c (+92/-0)
tools/sra-sort/idx-mapping.h (+59/-0)
tools/sra-sort/map-file.c (+1192/-0)
tools/sra-sort/map-file.h (+172/-0)
tools/sra-sort/mapping-row-set.c (+496/-0)
tools/sra-sort/mem.c (+68/-0)
tools/sra-sort/mem.h (+128/-0)
tools/sra-sort/membank-priv.h (+44/-0)
tools/sra-sort/membank.c (+296/-0)
tools/sra-sort/meta-pair.c (+458/-0)
tools/sra-sort/meta-pair.h (+109/-0)
tools/sra-sort/paged-membank.c (+244/-0)
tools/sra-sort/paged-mmapbank.c (+399/-0)
tools/sra-sort/poslen-col-pair.c (+559/-0)
tools/sra-sort/poslen-col-pair.h (+63/-0)
tools/sra-sort/ref-alignid-col.c (+705/-0)
tools/sra-sort/ref-alignid-col.h (+53/-0)
tools/sra-sort/row-set-priv.h (+44/-0)
tools/sra-sort/row-set.c (+208/-0)
tools/sra-sort/row-set.h (+215/-0)
tools/sra-sort/run.c (+388/-0)
tools/sra-sort/simple-row-set.c (+212/-0)
tools/sra-sort/sort-defs.h (+82/-0)
tools/sra-sort/sorting-row-set.c (+405/-0)
tools/sra-sort/sra-sort.c (+754/-0)
tools/sra-sort/sra-sort.h (+171/-0)
tools/sra-sort/sra-sort.vers (+1/-0)
tools/sra-sort/status.h (+48/-0)
tools/sra-sort/tbl-pair.c (+1055/-0)
tools/sra-sort/tbl-pair.h (+209/-0)
tools/sra-sort/xcheck-ref-align.c (+404/-0)
tools/sra-sort/xcheck.h (+49/-0)
tools/sra-stat/Makefile (+14/-35)
tools/sra-stat/sra-stat.c (+2141/-284)
tools/sra-stat/sra-stat.vers (+1/-1)
tools/sra-stat/sra-stat.vers.h (+0/-1)
tools/srapath/Makefile (+96/-0)
tools/srapath/srapath.c (+261/-0)
tools/srapath/srapath.vers (+1/-0)
tools/util/Makefile (+77/-63)
tools/util/kdbmeta.c (+454/-128)
tools/util/kdbmeta.vers (+1/-1)
tools/util/kdbmeta.vers.h (+0/-1)
tools/util/mac/syspass.c (+48/-0)
tools/util/rcexplain.vers (+1/-1)
tools/util/rcexplain.vers.h (+0/-1)
tools/util/rowwritetest.c (+4/-10)
tools/util/rowwritetest.vers (+1/-1)
tools/util/syspass-priv.h (+44/-0)
tools/util/test-sra.c (+1595/-0)
tools/util/test-sra.vers (+1/-0)
tools/util/testld.vers (+1/-1)
tools/util/txt2kdb.vers (+1/-1)
tools/util/unix/syspass.c (+62/-0)
tools/util/vdb-lock.c (+3/-1)
tools/util/vdb-lock.vers (+1/-1)
tools/util/vdb-lock.vers.h (+0/-1)
tools/util/vdb-passwd.c (+276/-0)
tools/util/vdb-passwd.vers (+1/-0)
tools/util/vdb-unlock.c (+3/-1)
tools/util/vdb-unlock.vers (+1/-1)
tools/util/vdb-unlock.vers.h (+0/-1)
tools/util/win/syspass.c (+53/-0)
tools/vdb-config/Makefile (+14/-15)
tools/vdb-config/vdb-config.c (+331/-165)
tools/vdb-config/vdb-config.vers (+1/-1)
tools/vdb-config/vdb-config.vers.h (+0/-1)
tools/vdb-copy/Makefile (+13/-30)
tools/vdb-copy/coldefs.c (+35/-8)
tools/vdb-copy/coldefs.h (+1/-1)
tools/vdb-copy/context.c (+4/-0)
tools/vdb-copy/context.h (+8/-0)
tools/vdb-copy/copy_meta.c (+127/-46)
tools/vdb-copy/definitions.h (+2/-0)
tools/vdb-copy/helper.c (+7/-11)
tools/vdb-copy/helper.h (+1/-2)
tools/vdb-copy/namelist_tools.c (+1/-1)
tools/vdb-copy/num-gen.c (+8/-6)
tools/vdb-copy/progressbar.c (+9/-9)
tools/vdb-copy/redactval.c (+0/-1)
tools/vdb-copy/type_matcher.c (+12/-12)
tools/vdb-copy/vdb-copy-includes.h (+2/-0)
tools/vdb-copy/vdb-copy.c (+70/-57)
tools/vdb-copy/vdb-copy.vers (+1/-1)
tools/vdb-copy/vdb-copy.vers.h (+0/-1)
tools/vdb-decrypt/Makefile (+130/-0)
tools/vdb-decrypt/shared.c (+1270/-0)
tools/vdb-decrypt/shared.h (+93/-0)
tools/vdb-decrypt/vdb-decrypt.c (+283/-0)
tools/vdb-decrypt/vdb-decrypt.vers (+1/-0)
tools/vdb-decrypt/vdb-encrypt.c (+231/-0)
tools/vdb-decrypt/vdb-encrypt.vers (+1/-0)
tools/vdb-dump/Makefile (+12/-30)
tools/vdb-dump/vdb-dump-coldefs.c (+194/-80)
tools/vdb-dump/vdb-dump-coldefs.h (+7/-1)
tools/vdb-dump/vdb-dump-context.c (+16/-65)
tools/vdb-dump/vdb-dump-context.h (+22/-1)
tools/vdb-dump/vdb-dump-filter.c (+2/-2)
tools/vdb-dump/vdb-dump-filter.h (+4/-0)
tools/vdb-dump/vdb-dump-formats.c (+35/-24)
tools/vdb-dump/vdb-dump-formats.h (+4/-0)
tools/vdb-dump/vdb-dump-helper.c (+43/-39)
tools/vdb-dump/vdb-dump-helper.h (+5/-1)
tools/vdb-dump/vdb-dump-num-gen.c (+2/-2)
tools/vdb-dump/vdb-dump-num-gen.h (+6/-1)
tools/vdb-dump/vdb-dump-row-context.h (+6/-0)
tools/vdb-dump/vdb-dump-str.c (+20/-12)
tools/vdb-dump/vdb-dump-str.h (+4/-0)
tools/vdb-dump/vdb-dump-tools.c (+1/-1)
tools/vdb-dump/vdb-dump-tools.h (+4/-0)
tools/vdb-dump/vdb-dump.c (+596/-259)
tools/vdb-dump/vdb-dump.vers (+1/-1)
tools/vdb-dump/vdb-dump.vers.h (+0/-1)
tools/vdb-validate/Makefile (+103/-0)
tools/vdb-validate/vdb-validate.c (+2198/-0)
tools/vdb-validate/vdb-validate.vers (+1/-0)
To merge this branch: bzr merge lp:~noskcaj/ubuntu/trusty/sra-sdk/ftbfs
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+214647@code.launchpad.net

Description of the change

New upstream bugfix release (fixes ftbfs)

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

This was already uploaded as https://launchpad.net/ubuntu/+source/sra-sdk/2.3.3-4~dfsg-1ubuntu1. Note that it still FTBFS on i386.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file '.pc/.quilt_patches'
--- .pc/.quilt_patches 1970-01-01 00:00:00 +0000
+++ .pc/.quilt_patches 2014-04-08 01:47:44 +0000
@@ -0,0 +1,1 @@
1debian/patches
02
=== added file '.pc/.quilt_series'
--- .pc/.quilt_series 1970-01-01 00:00:00 +0000
+++ .pc/.quilt_series 2014-04-08 01:47:44 +0000
@@ -0,0 +1,1 @@
1series
02
=== modified file '.pc/10_portability.patch/build/Makefile.gcc'
--- .pc/10_portability.patch/build/Makefile.gcc 2012-01-10 09:06:14 +0000
+++ .pc/10_portability.patch/build/Makefile.gcc 2014-04-08 01:47:44 +0000
@@ -44,7 +44,14 @@
44 -MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)44 -MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
4545
46# tool options46# tool options
47WARN = -Wall # -Wconversion47WARN = -Wall -Wno-long-long
48ifneq (sun,$(OS))
49 WARN += -Wno-variadic-macros
50endif
51
52ifeq (linux,$(OS))
53 NO_ARRAY_BOUNDS_WARNING = -Wno-array-bounds
54endif
4855
49ifeq (64,$(BITS))56ifeq (64,$(BITS))
50 CARCH = -m6457 CARCH = -m64
@@ -60,12 +67,15 @@
60 DBG = -g67 DBG = -g
61 OPT = $(WARN)68 OPT = $(WARN)
62 NOPT = $(WARN)69 NOPT = $(WARN)
63 PED = -std=c99 -ansi -pedantic70 # GCC seems unable to use c99 without ansi, which
71 # basically clobbers features back to c89. the options
72 # must be specified in the order shown.
73 PED = -std=c99 -ansi -pedantic # -fdiagnostics-show-option
64else74else
6575
66ifeq (x86_64, $(ARCH))76ifeq (x86_64, $(ARCH))
67 OPT = -O3 -fno-strict-aliasing77 OPT = -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing
68else78else
69 OPT = -O3 -fno-strict-aliasing79 OPT = -O3 -Wno-variadic-macros -fno-strict-aliasing
70endif80endif
71endif81endif
7282
=== modified file '.pc/10_portability.patch/build/Makefile.shell'
--- .pc/10_portability.patch/build/Makefile.shell 2012-01-10 09:06:14 +0000
+++ .pc/10_portability.patch/build/Makefile.shell 2014-04-08 01:47:44 +0000
@@ -27,80 +27,124 @@
27UNAME = $(shell uname -s)27UNAME = $(shell uname -s)
2828
29ifeq (Darwin, $(UNAME))29ifeq (Darwin, $(UNAME))
30 OS = mac30 HOST_OS = mac
31endif31endif
32ifeq (Linux, $(UNAME))32ifeq (Linux, $(UNAME))
33 OS = linux33 HOST_OS = linux
34endif34endif
35ifeq (SunOS, $(UNAME))35ifeq (SunOS, $(UNAME))
36 OS = sun36 HOST_OS = sun
37 ARCHITECTURES = x86_64 i386
37endif38endif
38ifeq (xCYGWIN, $(findstring xCYGWIN,x$(UNAME)))39ifeq (xCYGWIN, $(findstring xCYGWIN,x$(UNAME)))
39 OS = win40 HOST_OS = win
40endif41endif
41ifeq (xMINGW, $(findstring xMINGW,x$(UNAME)))42ifeq (xMINGW, $(findstring xMINGW,x$(UNAME)))
42 OS = win43 HOST_OS = win
43endif44endif
4445
45# OS flavor is normally OS46# assume build OS is the same as host OS
46OSFLAV = $(OS)47OS = $(HOST_OS)
48BUILD_OS = $(OS)
4749
48# determine ARCH50# determine ARCH
49ifeq (mac,$(OS))51ARCHITECTURES = default
50 ARCH = $(shell $(TOP)/build/mac.arch.sh)52ifeq (mac,$(HOST_OS))
53 HOST_ARCH = $(shell $(TOP)/build/mac.arch.sh)
51else54else
52 MARCH = $(shell uname -m)55 MARCH = $(shell uname -m)
5356
54 ifeq (i386, $(MARCH))57 ifeq (i386, $(MARCH))
55 ARCH = i38658 HOST_ARCH = i386
56 endif59 endif
57 ifeq (i486, $(MARCH))60 ifeq (i486, $(MARCH))
58 ARCH = i38661 HOST_ARCH = i386
59 endif62 endif
60 ifeq (i586, $(MARCH))63 ifeq (i586, $(MARCH))
61 ARCH = i38664 HOST_ARCH = i386
62 endif65 endif
63 ifeq (i686, $(MARCH))66 ifeq (i686, $(MARCH))
64 ARCH = i38667 ifeq (WOW64x, $(findstring WOW64x,$(UNAME)x))
68 # 64-bit capable Cygwin. Analyze the version of cl to set the corect architecture
69 CL = $(shell cl.exe 2>&1 >/dev/null)
70 ifeq (for x64, $(findstring for x64, $(CL)))
71 HOST_ARCH = x86_64
72 else
73 HOST_ARCH = i386
74 endif
75 else
76 HOST_ARCH = i386
77 endif
65 endif78 endif
66 ifeq (x86_64, $(MARCH))79 ifeq (x86_64, $(MARCH))
67 ARCH = x86_6480 HOST_ARCH = x86_64
68 endif81 endif
69 ifeq (sun4u,$(MARCH))82 ifeq (i86pc, $(MARCH))
70 ARCH = sparc3283 HOST_ARCH = x86_64
84 ARCHITECTURES = x86_64 i386
85 endif
86 ifeq (sun4v,$(MARCH))
87 HOST_ARCH = sparc64
88 ARCHITECTURES = sparc64 sparc32
71 endif89 endif
72endif90endif
7391
74# determine BITS92ARCH = $(HOST_ARCH)
75ifeq (x86_64, $(ARCH))93REMOTE_ARCH = $(ARCH)
76 BITS = 6494
95# pick up dependencies from object directory
96ifdef SRCDIR
97 include $(wildcard *.d)
77else98else
78 BITS = 3299
79endif100# determine SRCDIR
80
81# first pass through defines SRCDIR
82ifndef SRCDIR
83
84# set SRCDIR from MODULE
85ifdef MODULE101ifdef MODULE
86 SRCDIR=$(TOP)/$(MODULE)102 SRCDIR=$(TOP)/$(MODULE)
87else103else
88 SRCDIR=$(TOP)104 SRCDIR=$(TOP)
89endif105endif
90106
107# set COMP, LNKG and BUILD
108COMP = $(shell test -f $(TOP)/build/COMP && mv $(TOP)/build/COMP $(TOP)/build/COMP.$(OS); test -f $(TOP)/build/COMP.$(OS) && cat $(TOP)/build/COMP.$(OS) || echo gcc)
109LNKG = $(shell test -f $(TOP)/build/STATIC && mv $(TOP)/build/STATIC $(TOP)/build/LNKG.$(OS) && echo stat > $(TOP)/build/LNKG.$(OS); test -f $(TOP)/build/LNKG.$(OS) && cat $(TOP)/build/LNKG.$(OS) || echo stat)
110BUILD = $(shell test -f $(TOP)/build/BUILD && mv $(TOP)/build/BUILD $(TOP)/build/BUILD.$(OS); test -f $(TOP)/build/BUILD.$(OS) && cat $(TOP)/build/BUILD.$(OS) || echo dbg)
111TOOLSET := $(COMP)
112
113ifdef USE_GCC_IF_ICC
114ifeq (icc,$(COMP))
115COMP = gcc
116endif
117ifeq (clang,$(COMP))
118COMP = gcc
119endif
120endif
121
122endif
123
91# set OUTDIR124# set OUTDIR
92ifndef OUTDIR125ifndef OUTDIR
93 OUTDIR = $(shell test -f $(TOP)/build/OUTDIR.$(OS) && cat $(TOP)/build/OUTDIR.$(OS) || echo $(TOP))126 OUTDIR = $(shell test -f $(TOP)/build/OUTDIR && mv $(TOP)/build/OUTDIR $(TOP)/build/OUTDIR.$(BUILD_OS); test -f $(TOP)/build/OUTDIR.$(BUILD_OS) && cat $(TOP)/build/OUTDIR.$(BUILD_OS) || echo $(TOP))
94 ifeq (,$(OUTDIR))127 ifeq (,$(OUTDIR))
95 OUTDIR = $(TOP)128 OUTDIR = $(TOP)
96 endif129 endif
97 ifeq (.,$(OUTDIR))130endif
98 OUTDIR = $(TOP)131ifeq (,$(ROUTDIR))
99 endif132 ROUTDIR = $(RHOME)
100endif133endif
101134
102# set COMP and BUILD135# OS flavor is normally OS
103COMP = $(shell test -f $(TOP)/build/COMP.$(OS) && cat $(TOP)/build/COMP.$(OS) || echo gcc)136OSFLAV = $(OS)
104BUILD = $(shell test -f $(TOP)/build/BUILD.$(OS) && cat $(TOP)/build/BUILD.$(OS) || echo dbg)137
105138# determine BITS
139ifeq (x86_64, $(ARCH))
140 BITS = 64
141endif
142ifeq (sparc64, $(ARCH))
143 BITS = 64
144endif
145ifeq (i386, $(ARCH))
146 BITS = 32
147endif
148ifeq (sparc32, $(ARCH))
149 BITS = 32
106endif150endif
107151
=== modified file '.pc/applied-patches'
--- .pc/applied-patches 2012-01-10 09:06:14 +0000
+++ .pc/applied-patches 2014-04-08 01:47:44 +0000
@@ -1,1 +1,5 @@
1do_not_build_external_libs.patch
110_portability.patch210_portability.patch
3build-with-system-libbz2-libz.patch
4hardening.patch
5hardening-format-security.patch
26
=== added directory '.pc/build-with-system-libbz2-libz.patch'
=== added directory '.pc/build-with-system-libbz2-libz.patch/libs'
=== added directory '.pc/build-with-system-libbz2-libz.patch/libs/ncbi-vdb'
=== added file '.pc/build-with-system-libbz2-libz.patch/libs/ncbi-vdb/Makefile'
--- .pc/build-with-system-libbz2-libz.patch/libs/ncbi-vdb/Makefile 1970-01-01 00:00:00 +0000
+++ .pc/build-with-system-libbz2-libz.patch/libs/ncbi-vdb/Makefile 2014-04-08 01:47:44 +0000
@@ -0,0 +1,154 @@
1# ===========================================================================
2#
3# PUBLIC DOMAIN NOTICE
4# National Center for Biotechnology Information
5#
6# This software/database is a "United States Government Work" under the
7# terms of the United States Copyright Act. It was written as part of
8# the author's official duties as a United States Government employee and
9# thus cannot be copyrighted. This software/database is freely available
10# to the public for use. The National Library of Medicine and the U.S.
11# Government have not placed any restriction on its use or reproduction.
12#
13# Although all reasonable efforts have been taken to ensure the accuracy
14# and reliability of the software and data, the NLM and the U.S.
15# Government do not and cannot warrant the performance or results that
16# may be obtained by using this software or data. The NLM and the U.S.
17# Government disclaim all warranties, express or implied, including
18# warranties of performance, merchantability or fitness for any particular
19# purpose.
20#
21# Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25
26default: std
27
28TOP ?= $(shell ../../build/abspath.sh ../..)
29MODULE = libs/ncbi-vdb
30
31EXT_LIBS = \
32 libncbi-vdb \
33 libncbi-wvdb
34
35ALL_LIBS = \
36 $(EXT_LIBS)
37
38include $(TOP)/build/Makefile.env
39
40#-------------------------------------------------------------------------------
41# outer targets
42#
43all std: makedirs
44 @ $(MAKE_CMD) $(TARGDIR)/std
45
46$(EXT_LIBS): makedirs
47 @ $(MAKE_CMD) $(LIBDIR)/$@
48
49.PHONY: all std $(ALL_LIBS)
50
51#-------------------------------------------------------------------------------
52# std
53#
54$(TARGDIR)/std: \
55 $(addprefix $(LIBDIR)/,$(EXT_LIBS))
56
57.PHONY: $(TARGDIR)/all $(TARGDIR)/std
58
59#-------------------------------------------------------------------------------
60# clean
61#
62clean: stdclean
63
64.PHONY: clean
65
66#-------------------------------------------------------------------------------
67# virtual db library
68#
69$(LIBDIR)/libncbi-vdb: $(addprefix $(LIBDIR)/libncbi-vdb.,$(LIBEXT))
70
71ifeq (linux,$(OS))
72LIBKFF = kff magic
73LIBVDB_BLAST = vdb-blast
74else
75LIBKFF =
76LIBVDB_BLAST =
77endif
78
79ifeq (win,$(OS))
80LIBENTREZ =
81LIBKQ =
82LIBKXML =
83else
84LIBENTREZ =
85LIBKQ = kq
86LIBKXML = kxml kxfs
87endif
88
89VDB_LIB_CMN = \
90 align-access \
91 bz2 \
92 kfg \
93 kfs \
94 klib \
95 kproc \
96 $(LIBKQ) \
97 krypto \
98 ksrch \
99 $(LIBKXML) \
100 kurl \
101 vfs \
102 z
103
104VDB_LIB_RD = \
105 $(VDB_LIB_CMN) \
106 align-reader \
107 ascp \
108 $(EXT_SCHEMA_MODULES) \
109 kdb \
110 sradb \
111 srareader \
112 $(LIBVDB-BLAST) \
113 vdb
114
115VDB_OBJ = \
116 $(addprefix $(ILIBDIR)/lib,$(addsuffix .a,$(VDB_LIB_RD)))
117
118VDB_LIB = \
119 $(addprefix -s,$(VDB_LIB_RD))
120
121$(LIBDIR)/libncbi-vdb.$(SHLX): $(VDB_OBJ)
122 $(LD) --dlib --vers $(SRCDIR) -o $@ $(VDB_LIB)
123
124$(LIBDIR)/libncbi-vdb.$(LIBX): $(VDB_OBJ)
125 $(LD) --slib --vers $(SRCDIR) -o $@ $(VDB_LIB)
126
127#-------------------------------------------------------------------------------
128# update version
129#
130$(LIBDIR)/libncbi-wvdb: $(addprefix $(LIBDIR)/libncbi-wvdb.,$(LIBEXT))
131
132VDB_LIB_RDWR = \
133 $(VDB_LIB_CMN) \
134 align-writer \
135 waxf \
136 wkdb \
137 wsradb \
138 wsraxf \
139 wvdb \
140 $(LIBENTREZ) \
141 wvxf \
142 wwgsxf
143
144WVDB_OBJ = \
145 $(addprefix $(ILIBDIR)/lib,$(addsuffix .a,$(VDB_LIB_RDWR)))
146
147WVDB_LIB = \
148 $(addprefix -s,$(VDB_LIB_RDWR))
149
150$(LIBDIR)/libncbi-wvdb.$(SHLX): $(WVDB_OBJ)
151 $(LD) --dlib --vers $(SRCDIR) -o $@ $(WVDB_LIB) -lxml2
152
153$(LIBDIR)/libncbi-wvdb.$(LIBX): $(WVDB_OBJ)
154 $(LD) --slib --vers $(SRCDIR) -o $@ $(WVDB_LIB)
0155
=== added directory '.pc/do_not_build_external_libs.patch'
=== added directory '.pc/do_not_build_external_libs.patch/libs'
=== added file '.pc/do_not_build_external_libs.patch/libs/Makefile'
--- .pc/do_not_build_external_libs.patch/libs/Makefile 1970-01-01 00:00:00 +0000
+++ .pc/do_not_build_external_libs.patch/libs/Makefile 2014-04-08 01:47:44 +0000
@@ -0,0 +1,74 @@
1# ===========================================================================
2#
3# PUBLIC DOMAIN NOTICE
4# National Center for Biotechnology Information
5#
6# This software/database is a "United States Government Work" under the
7# terms of the United States Copyright Act. It was written as part of
8# the author's official duties as a United States Government employee and
9# thus cannot be copyrighted. This software/database is freely available
10# to the public for use. The National Library of Medicine and the U.S.
11# Government have not placed any restriction on its use or reproduction.
12#
13# Although all reasonable efforts have been taken to ensure the accuracy
14# and reliability of the software and data, the NLM and the U.S.
15# Government do not and cannot warrant the performance or results that
16# may be obtained by using this software or data. The NLM and the U.S.
17# Government disclaim all warranties, express or implied, including
18# warranties of performance, merchantability or fitness for any particular
19# purpose.
20#
21# Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25
26TOP ?= $(shell ../build/abspath.sh ..)
27MODULE = libs
28
29include $(TOP)/build/Makefile.shell
30
31#-------------------------------------------------------------------------------
32# default
33#
34SUBDIRS = \
35 ext \
36 klib \
37 kproc \
38 kfs \
39 kns \
40 kxml \
41 kfg \
42 krypto \
43 vfs \
44 kapp \
45 kdb \
46 vdb \
47 vxf \
48 search \
49 sraxf \
50 align \
51 axf \
52 wgsxf \
53 ktst \
54 loader \
55 ascp \
56 sra \
57 ncbi-vdb
58
59
60# common targets for non-leaf Makefiles; must follow a definition of SUBDIRS
61include $(TOP)/build/Makefile.targets
62
63$(SUBDIRS):
64 @ $(MAKE) -C $@
65
66.PHONY: default $(SUBDIRS)
67
68#-------------------------------------------------------------------------------
69# pass-through
70#
71out debug profile release GCC ICC VC++:
72 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env $@
73
74.PHONY: out debug profile release GCC ICC VC++
075
=== added directory '.pc/hardening-format-security.patch'
=== added directory '.pc/hardening-format-security.patch/libs'
=== added directory '.pc/hardening-format-security.patch/libs/kdb'
=== added file '.pc/hardening-format-security.patch/libs/kdb/database.c'
--- .pc/hardening-format-security.patch/libs/kdb/database.c 1970-01-01 00:00:00 +0000
+++ .pc/hardening-format-security.patch/libs/kdb/database.c 2014-04-08 01:47:44 +0000
@@ -0,0 +1,706 @@
1/*===========================================================================
2*
3* PUBLIC DOMAIN NOTICE
4* National Center for Biotechnology Information
5*
6* This software/database is a "United States Government Work" under the
7* terms of the United States Copyright Act. It was written as part of
8* the author's official duties as a United States Government employee and
9* thus cannot be copyrighted. This software/database is freely available
10* to the public for use. The National Library of Medicine and the U.S.
11* Government have not placed any restriction on its use or reproduction.
12*
13* Although all reasonable efforts have been taken to ensure the accuracy
14* and reliability of the software and data, the NLM and the U.S.
15* Government do not and cannot warrant the performance or results that
16* may be obtained by using this software or data. The NLM and the U.S.
17* Government disclaim all warranties, express or implied, including
18* warranties of performance, merchantability or fitness for any particular
19* purpose.
20*
21* Please cite the author in any work or product based on this material.
22*
23* ===========================================================================
24*
25*/
26
27#define KONST const
28#include <kdb/extern.h>
29#include "database-priv.h"
30#include "dbmgr-priv.h"
31#include "kdb-priv.h"
32#undef KONST
33
34#include <klib/namelist.h>
35#include <klib/log.h>
36#include <klib/rc.h>
37#include <klib/printf.h>
38#include <os-native.h>
39#include <sysalloc.h>
40
41#include <limits.h>
42#include <stdlib.h>
43#include <stdio.h>
44#include <string.h>
45#include <assert.h>
46
47
48/*--------------------------------------------------------------------------
49 * KDatabase
50 * connection to a database within file system
51 */
52
53/* GetPath
54 * return the absolute path to DB
55 */
56LIB_EXPORT rc_t CC KDatabaseGetPath ( KDatabase const *self,
57 const char **path )
58{
59 if ( self == NULL )
60 return RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
61 if ( path == NULL )
62 return RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
63
64 *path = self->path;
65
66 return 0;
67}
68
69/* Whack
70 */
71static
72rc_t KDatabaseWhack ( KDatabase *self )
73{
74 rc_t rc = 0;
75
76 KRefcountWhack ( & self -> refcount, "KDatabase" );
77
78 /* release dad */
79 if ( self -> dad != NULL )
80 {
81 rc = KDatabaseSever ( self -> dad );
82 if ( rc == 0 )
83 self -> dad = NULL;
84 }
85
86 /* remove from mgr */
87 if ( rc == 0 )
88 rc = KDBManagerSever ( self -> mgr );
89
90 /* complete */
91 if ( rc == 0 )
92 {
93 KDirectoryRelease ( self -> dir );
94 free ( self );
95 return 0;
96 }
97
98 KRefcountInit ( & self -> refcount, 1, "KDatabase", "whack", "kdb" );
99
100 return rc;
101}
102
103
104/* AddRef
105 * Release
106 * all objects are reference counted
107 * NULL references are ignored
108 */
109LIB_EXPORT rc_t CC KDatabaseAddRef ( const KDatabase *self )
110{
111 if ( self != NULL )
112 {
113 switch ( KRefcountAdd ( & self -> refcount, "KDatabase" ) )
114 {
115 case krefLimit:
116 return RC ( rcDB, rcDatabase, rcAttaching, rcRange, rcExcessive );
117 }
118 }
119 return 0;
120}
121
122LIB_EXPORT rc_t CC KDatabaseRelease ( const KDatabase *self )
123{
124 if ( self != NULL )
125 {
126 switch ( KRefcountDrop ( & self -> refcount, "KDatabase" ) )
127 {
128 case krefWhack:
129 return KDatabaseWhack ( ( KDatabase* ) self );
130 case krefNegative:
131 return RC ( rcDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
132 }
133 }
134 return 0;
135}
136
137/* Sever
138 * like Release, except called internally
139 * indicates that a child object is letting go...
140 */
141KDatabase *KDatabaseAttach ( const KDatabase *self )
142{
143 if ( self != NULL )
144 {
145 switch ( KRefcountAddDep ( & self -> refcount, "KDatabase" ) )
146 {
147 case krefLimit:
148 return NULL;
149 }
150 }
151 return ( KDatabase* ) self;
152}
153
154rc_t KDatabaseSever ( const KDatabase *self )
155{
156 if ( self != NULL )
157 {
158 switch ( KRefcountDropDep ( & self -> refcount, "KDatabase" ) )
159 {
160 case krefWhack:
161 return KDatabaseWhack ( ( KDatabase* ) self );
162 case krefNegative:
163 return RC ( rcDB, rcDatabase, rcReleasing, rcRange, rcExcessive );
164 }
165 }
166 return 0;
167}
168
169
170/* Make
171 * make an initialized structure
172 */
173static
174rc_t KDatabaseMake ( KDatabase **dbp, const KDirectory *dir, const char *path )
175{
176 KDatabase *db;
177
178 assert ( dbp != NULL );
179 assert ( path != NULL );
180
181 db = malloc ( sizeof * db + strlen ( path ) );
182 if ( db == NULL )
183 {
184 * dbp = NULL;
185 return RC ( rcDB, rcDatabase, rcConstructing, rcMemory, rcExhausted );
186 }
187
188 db -> mgr = NULL;
189 db -> dad = NULL;
190 db -> dir = dir;
191 KRefcountInit ( & db -> refcount, 1, "KDatabase", "make", path );
192 strcpy ( db -> path, path );
193
194 * dbp = db;
195 return 0;
196}
197
198
199/* OpenDBRead
200 * VOpenDBRead
201 * open a database for read
202 *
203 * "db" [ OUT ] - return parameter for newly opened database
204 *
205 * "path" [ IN ] - NUL terminated string in
206 * wd-native character set giving path to database
207 */
208static
209rc_t KDBManagerVOpenDBReadInt ( const KDBManager *self, const KDatabase **dbp,
210 const KDirectory *wd, bool try_srapath,
211 const char *path, va_list args )
212{
213 rc_t rc;
214
215 /* MUST use vsnprintf because the documented behavior of "path"
216 is that of stdc library's printf, not vdb printf */
217 char dbpath [ 4096 ];
218 int z = ( args == NULL ) ?
219 snprintf ( dbpath, sizeof dbpath, path ):
220 vsnprintf ( dbpath, sizeof dbpath, path, args );
221 if ( z < 0 || ( size_t ) z >= sizeof dbpath )
222 rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcExcessive );
223 else
224 {
225 const KDirectory *dir;
226
227 /* open the directory if its a database */
228 rc = KDBOpenPathTypeRead ( self, wd, dbpath, &dir, kptDatabase, NULL, try_srapath );
229 if ( rc == 0 )
230 {
231 KDatabase *db;
232
233 /* allocate a new guy */
234 rc = KDatabaseMake ( & db, dir, dbpath );
235 if ( rc == 0 )
236 {
237 db -> mgr = KDBManagerAttach ( self );
238 * dbp = db;
239 return 0;
240 }
241
242 KDirectoryRelease ( dir );
243 }
244 }
245 return rc;
246}
247
248LIB_EXPORT rc_t CC KDBManagerOpenDBRead ( const KDBManager *self,
249 const KDatabase **db, const char *path, ... )
250{
251 rc_t rc;
252 va_list args;
253
254 va_start ( args, path );
255 rc = KDBManagerVOpenDBRead ( self, db, path, args );
256 va_end ( args );
257
258 return rc;
259}
260
261LIB_EXPORT rc_t CC KDatabaseOpenDBRead ( const KDatabase *self,
262 const KDatabase **db, const char *name, ... )
263{
264 rc_t rc;
265 va_list args;
266
267 va_start ( args, name );
268 rc = KDatabaseVOpenDBRead ( self, db, name, args );
269 va_end ( args );
270
271 return rc;
272}
273
274LIB_EXPORT rc_t CC KDBManagerVOpenDBRead ( const KDBManager *self,
275 const KDatabase **db, const char *path, va_list args )
276{
277 if ( db == NULL )
278 return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
279
280 * db = NULL;
281
282 if ( self == NULL )
283 return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
284
285 return KDBManagerVOpenDBReadInt ( self, db, self -> wd, true, path, args );
286}
287
288LIB_EXPORT rc_t CC KDatabaseVOpenDBRead ( const KDatabase *self,
289 const KDatabase **dbp, const char *name, va_list args )
290{
291 rc_t rc;
292 char path [ 256 ];
293
294 if ( dbp == NULL )
295 return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
296
297 * dbp = NULL;
298
299 if ( self == NULL )
300 return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
301
302 rc = KDBVMakeSubPath ( self -> dir,
303 path, sizeof path, "db", 2, name, args );
304 if ( rc == 0 )
305 {
306 rc = KDBManagerVOpenDBReadInt ( self -> mgr, dbp,
307 self -> dir, false, path, NULL );
308 if ( rc == 0 )
309 {
310 KDatabase *db = ( KDatabase* ) * dbp;
311 db -> dad = KDatabaseAttach ( self );
312 }
313 }
314
315 return rc;
316}
317
318
319/* Locked
320 * returns non-zero if locked
321 */
322LIB_EXPORT bool CC KDatabaseLocked ( const KDatabase *self )
323{
324 rc_t rc;
325
326 if ( self == NULL )
327 return false;
328
329 rc = KDBWritable ( self -> dir, "." );
330 return GetRCState ( rc ) == rcLocked;
331}
332
333/* Exists
334 * returns true if requested object exists
335 *
336 * "type" [ IN ] - a KDBPathType
337 * valid values are kptIndex and kptColumn
338 *
339 * "path" [ IN ] - NUL terminated path
340 */
341LIB_EXPORT bool CC KDatabaseVExists ( const KDatabase *self, uint32_t type, const char *name, va_list args )
342{
343 if ( self != NULL && name != NULL && name [ 0 ] != 0 )
344 {
345 rc_t rc;
346 size_t len;
347 const char *ns;
348 char path [ 256 ];
349
350 switch ( type )
351 {
352 case kptDatabase:
353 ns = "db";
354 len = 2;
355 break;
356
357 case kptTable:
358 ns = "tbl";
359 len = 3;
360 break;
361
362 case kptIndex:
363 ns = "idx";
364 len = 3;
365 break;
366
367 default:
368 return false;
369 }
370
371 rc = KDBVMakeSubPath ( self -> dir, path, sizeof path, ns, len, name, args );
372 if ( rc == 0 )
373 {
374 switch ( KDirectoryPathType ( self -> dir, path ) )
375 {
376 case kptFile:
377 case kptDir:
378 case kptFile | kptAlias:
379 case kptDir | kptAlias:
380 return true;
381 }
382 }
383 }
384 return false;
385}
386
387LIB_EXPORT bool CC KDatabaseExists ( const KDatabase *self, uint32_t type, const char *name, ... )
388{
389 bool exists;
390
391 va_list args;
392 va_start ( args, name );
393
394 exists = KDatabaseVExists ( self, type, name, args );
395
396 va_end ( args );
397
398 return exists;
399}
400
401
402/* IsAlias
403 * returns true if object name is an alias
404 * returns path to fundamental name if it was aliased
405 *
406 * "type" [ IN ] - a KDBPathType
407 * valid values are kptDatabase, kptTable and kptIndex
408 *
409 * "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
410 * for fundamenta object name if "alias" is not a fundamental name,
411 *
412 * "name" [ IN ] - NUL terminated object name
413 */
414LIB_EXPORT bool CC KDatabaseIsAlias ( const KDatabase *self, uint32_t type,
415 char *resolved, size_t rsize, const char *name )
416{
417 if ( self != NULL && name != NULL && name [ 0 ] != 0 )
418 {
419 rc_t rc;
420 size_t len;
421 const char *ns;
422 char path [ 256 ];
423
424 switch ( type )
425 {
426 case kptDatabase:
427 ns = "db";
428 len = 2;
429 break;
430
431 case kptTable:
432 ns = "tbl";
433 len = 3;
434 break;
435
436 case kptIndex:
437 ns = "idx";
438 len = 3;
439 break;
440
441 default:
442 return false;
443 }
444
445 rc = KDBMakeSubPath ( self -> dir, path, sizeof path, ns, len, name );
446 if ( rc == 0 )
447 {
448 switch ( KDirectoryPathType ( self -> dir, path ) )
449 {
450 case kptFile | kptAlias:
451 case kptDir | kptAlias:
452 if ( resolved != NULL && rsize != 0 )
453 {
454 const KDirectory *sub;
455 rc = KDirectoryOpenDirRead ( self -> dir, & sub, false, ns );
456 * resolved = 0;
457 if ( rc != 0 )
458 PLOGERR ( klogWarn, ( klogWarn, rc, "failed to open subdirectory '$(sub)'", "sub=%s", ns ) );
459 else
460 {
461 rc = KDirectoryResolveAlias ( sub, false, resolved, rsize, name );
462 KDirectoryRelease ( sub );
463 if ( rc != 0 )
464 PLOGERR ( klogWarn, ( klogWarn, rc, "failed to resolve alias '$(alias)'", "alias=%s", name ) );
465 }
466 }
467 return true;
468 }
469 }
470 }
471
472 if ( resolved != NULL && rsize != 0 )
473 * resolved = 0;
474
475 return false;
476}
477
478
479/* Writable
480 * returns 0 if object is writable
481 * or a reason why if not
482 *
483 * "type" [ IN ] - a KDBPathType
484 * valid values are kptDatabase, kptTable and kptIndex
485 *
486 * "path" [ IN ] - NUL terminated path
487 */
488LIB_EXPORT rc_t CC KDatabaseVWritable ( const KDatabase *self, uint32_t type, const char *name, va_list args )
489{
490 /* TBD */
491 return -1;
492}
493
494LIB_EXPORT rc_t CC KDatabaseWritable ( const KDatabase *self, uint32_t type, const char *name, ... )
495{
496 rc_t rc;
497
498 va_list args;
499 va_start ( args, name );
500
501 rc = KDatabaseVWritable ( self, type, name, args );
502
503 va_end ( args );
504
505 return rc;
506}
507
508
509/* OpenManager
510 * duplicate reference to manager
511 * NB - returned reference must be released
512 */
513LIB_EXPORT rc_t CC KDatabaseOpenManagerRead ( const KDatabase *self, const KDBManager **mgr )
514{
515 rc_t rc;
516
517 if ( mgr == NULL )
518 rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
519 else
520 {
521 if ( self == NULL )
522 rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
523 else
524 {
525 rc = KDBManagerAddRef ( self -> mgr );
526 if ( rc == 0 )
527 {
528 * mgr = self -> mgr;
529 return 0;
530 }
531 }
532
533 * mgr = NULL;
534 }
535
536 return rc;
537}
538
539
540/* OpenParent
541 * duplicate reference to parent database
542 * NB - returned reference must be released
543 */
544LIB_EXPORT rc_t CC KDatabaseOpenParentRead ( const KDatabase *self, const KDatabase **par )
545{
546 rc_t rc;
547
548 if ( par == NULL )
549 rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
550 else
551 {
552 if ( self == NULL )
553 rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
554 else
555 {
556 rc = KDatabaseAddRef ( self -> dad );
557 if ( rc == 0 )
558 {
559 * par = self -> dad;
560 return 0;
561 }
562 }
563
564 * par = NULL;
565 }
566
567 return rc;
568}
569
570
571/* GetDirectory
572 * access the directory in use
573 */
574LIB_EXPORT rc_t CC KDatabaseOpenDirectoryRead ( const KDatabase *self, const KDirectory **dir )
575{
576 rc_t rc;
577
578 if ( dir == NULL )
579 rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
580 else
581 {
582 if ( self == NULL )
583 rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
584 else
585 {
586 * dir = self -> dir;
587 return KDirectoryAddRef ( * dir );
588 }
589
590 * dir = NULL;
591 }
592
593 return rc;
594}
595
596
597/* ModDate
598 * get modification date
599 */
600LIB_EXPORT rc_t CC KDatabaseModDate ( const KDatabase *self, KTime_t *mtime )
601{
602 rc_t rc;
603
604 if ( mtime == NULL )
605 rc = RC ( rcDB, rcDatabase, rcAccessing, rcParam, rcNull );
606 else
607 {
608 if ( self == NULL )
609 rc = RC ( rcDB, rcDatabase, rcAccessing, rcSelf, rcNull );
610 else
611 {
612 /* HACK ALERT - there needs to be a proper way to record modification times */
613 const KDirectory *dir = self -> dir;
614
615 /* this only tells the last time the table was locked,
616 which may be close to the last time it was modified */
617 rc = KDirectoryDate ( dir, mtime, "lock" );
618 if ( rc == 0 )
619 return 0;
620
621 /* get directory timestamp */
622 rc = KDirectoryDate ( dir, mtime, "." );
623 if ( rc == 0 )
624 return 0;
625 }
626
627 * mtime = 0;
628 }
629
630 return rc;
631}
632
633
634/*--------------------------------------------------------------------------
635 * KNameList
636 */
637
638/* List
639 * create database listings
640 */
641struct FilterData
642{
643 const KDBManager * mgr;
644 int type;
645};
646
647static
648bool CC KDatabaseListFilter ( const KDirectory *dir, const char *name, void *data_ )
649{
650 struct FilterData * data = data_;
651 return ( KDBOpenPathTypeRead ( data->mgr, dir, name, NULL, data->type, NULL, false ) == 0 );
652}
653
654LIB_EXPORT rc_t CC KDatabaseListDB ( const KDatabase *self, KNamelist **names )
655{
656 if ( self != NULL )
657 {
658 struct FilterData data;
659 data.mgr = self->mgr;
660 data.type = kptDatabase;
661
662 return KDirectoryVList ( self -> dir,
663 names, KDatabaseListFilter, &data, "db", NULL );
664 }
665
666 if ( names != NULL )
667 * names = NULL;
668
669 return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
670}
671
672LIB_EXPORT rc_t CC KDatabaseListTbl ( struct KDatabase const *self, KNamelist **names )
673{
674 if ( self != NULL )
675 {
676 struct FilterData data;
677 data.mgr = self->mgr;
678 data.type = kptTable;
679
680 return KDirectoryVList ( self -> dir,
681 names, KDatabaseListFilter, &data, "tbl", NULL );
682 }
683
684 if ( names != NULL )
685 * names = NULL;
686
687 return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
688}
689
690LIB_EXPORT rc_t CC KDatabaseListIdx ( struct KDatabase const *self, KNamelist **names )
691{
692 if ( self != NULL )
693 {
694 struct FilterData data;
695 data.mgr = self->mgr;
696 data.type = kptIndex;
697
698 return KDirectoryVList ( self -> dir,
699 names, KDatabaseListFilter, &data, "idx", NULL );
700 }
701
702 if ( names != NULL )
703 * names = NULL;
704
705 return RC ( rcDB, rcDatabase, rcListing, rcSelf, rcNull );
706}
0707
=== added file '.pc/hardening-format-security.patch/libs/kdb/index.c'
--- .pc/hardening-format-security.patch/libs/kdb/index.c 1970-01-01 00:00:00 +0000
+++ .pc/hardening-format-security.patch/libs/kdb/index.c 2014-04-08 01:47:44 +0000
@@ -0,0 +1,1006 @@
1/*===========================================================================
2*
3* PUBLIC DOMAIN NOTICE
4* National Center for Biotechnology Information
5*
6* This software/database is a "United States Government Work" under the
7* terms of the United States Copyright Act. It was written as part of
8* the author's official duties as a United States Government employee and
9* thus cannot be copyrighted. This software/database is freely available
10* to the public for use. The National Library of Medicine and the U.S.
11* Government have not placed any restriction on its use or reproduction.
12*
13* Although all reasonable efforts have been taken to ensure the accuracy
14* and reliability of the software and data, the NLM and the U.S.
15* Government do not and cannot warrant the performance or results that
16* may be obtained by using this software or data. The NLM and the U.S.
17* Government disclaim all warranties, express or implied, including
18* warranties of performance, merchantability or fitness for any particular
19* purpose.
20*
21* Please cite the author in any work or product based on this material.
22*
23* ===========================================================================
24*
25*/
26
27#include <kdb/extern.h>
28
29#define KONST const
30#include "index-priv.h"
31#include "dbmgr-priv.h"
32#include "database-priv.h"
33#include "table-priv.h"
34#include "kdb-priv.h"
35#undef KONST
36
37#include <kdb/index.h>
38#include <kfs/file.h>
39#include <kfs/mmap.h>
40#include <klib/refcount.h>
41#include <klib/rc.h>
42#include <os-native.h>
43#include <sysalloc.h>
44
45#include <limits.h>
46#include <stdlib.h>
47#include <stdio.h>
48#include <string.h>
49#include <byteswap.h>
50#include <assert.h>
51
52/*--------------------------------------------------------------------------
53 * KIndex
54 * an object capable of mapping an object to integer oid
55 */
56struct KIndex
57{
58 const KDBManager *mgr;
59 const KDatabase *db;
60 const KTable *tbl;
61 KRefcount refcount;
62 uint32_t vers;
63 union
64 {
65 KTrieIndex_v1 txt1;
66 KTrieIndex_v2 txt234;
67 KU64Index_v3 u64_3;
68 } u;
69 bool converted_from_v1;
70 uint8_t type;
71 char path [ 1 ];
72};
73
74
75/* Whack
76 */
77static
78rc_t KIndexWhack ( KIndex *self )
79{
80 rc_t rc = 0;
81
82 KRefcountWhack ( & self -> refcount, "KIndex" );
83
84 /* release owner */
85 if ( self -> db != NULL )
86 {
87 rc = KDatabaseSever ( self -> db );
88 if ( rc == 0 )
89 self -> db = NULL;
90 }
91 else if ( self -> tbl != NULL )
92 {
93 rc = KTableSever ( self -> tbl );
94 if ( rc == 0 )
95 self -> tbl = NULL;
96 }
97
98 /* remove from mgr */
99 if ( rc == 0 )
100 rc = KDBManagerSever ( self -> mgr );
101 if ( rc == 0 )
102 {
103 self -> mgr = NULL;
104
105 /* complete */
106 rc = SILENT_RC ( rcDB, rcIndex, rcDestroying, rcIndex, rcBadVersion );
107
108 switch ( self -> type )
109 {
110 case kitText:
111 case kitText | kitProj:
112 switch ( self -> vers )
113 {
114 case 1:
115 KTrieIndexWhack_v1 ( & self -> u . txt1 );
116 rc = 0;
117 break;
118 case 2:
119 case 3:
120 case 4:
121 KTrieIndexWhack_v2 ( & self -> u . txt234 );
122 rc = 0;
123 break;
124 }
125 break;
126
127 case kitU64:
128 switch ( self -> vers )
129 {
130 case 3:
131 case 4:
132 rc = KU64IndexWhack_v3 ( & self -> u . u64_3 );
133 break;
134 }
135 break;
136
137 }
138
139 if ( rc == 0 )
140 {
141 free ( self );
142 return 0;
143 }
144 }
145
146 KRefcountInit ( & self -> refcount, 1, "KIndex", "whack", "kidx" );
147 return rc;
148}
149
150
151/* AddRef
152 * Release
153 * all objects are reference counted
154 * NULL references are ignored
155 */
156LIB_EXPORT rc_t CC KIndexAddRef ( const KIndex *self )
157{
158 if ( self != NULL )
159 {
160 switch ( KRefcountAdd ( & self -> refcount, "KIndex" ) )
161 {
162 case krefLimit:
163 return RC ( rcDB, rcIndex, rcAttaching, rcRange, rcExcessive );
164 }
165 }
166 return 0;
167}
168
169LIB_EXPORT rc_t CC KIndexRelease ( const KIndex *self )
170{
171 if ( self != NULL )
172 {
173 switch ( KRefcountDrop ( & self -> refcount, "KIndex" ) )
174 {
175 case krefWhack:
176 return KIndexWhack ( ( KIndex* ) self );
177 case krefNegative:
178 return RC ( rcDB, rcIndex, rcReleasing, rcRange, rcExcessive );
179 }
180 }
181 return 0;
182}
183
184
185/* Make
186 */
187static
188rc_t KIndexMake ( KIndex **idxp, const char *path )
189{
190 rc_t rc;
191
192 if ( idxp == NULL )
193 rc = RC ( rcDB, rcIndex, rcCreating, rcParam, rcNull );
194 else
195 {
196 if ( path == NULL )
197 rc = RC ( rcDB, rcIndex, rcCreating, rcPath, rcNull );
198 else if ( path [ 0 ] == 0 )
199 rc = RC ( rcDB, rcIndex, rcCreating, rcPath, rcEmpty );
200 else
201 {
202 KIndex* idx = malloc ( sizeof *idx + strlen ( path ) );
203 if ( idx == NULL )
204 rc = RC ( rcDB, rcIndex, rcConstructing, rcMemory, rcExhausted );
205 else
206 {
207 memset ( idx, 0, sizeof * idx );
208 KRefcountInit ( & idx -> refcount, 1, "KIndex", "make", path );
209 strcpy ( idx -> path, path );
210 * idxp = idx;
211 return 0;
212 }
213 }
214 }
215
216 return rc;
217}
218
219static
220rc_t KIndexAttach ( KIndex *self, const KMMap *mm, bool *byteswap )
221{
222 size_t size;
223 rc_t rc = KMMapSize ( mm, & size );
224 if ( rc == 0 )
225 {
226 const void *addr;
227 rc = KMMapAddrRead ( mm, & addr );
228 if ( rc == 0 )
229 {
230 union
231 {
232 KIndexFileHeader_v1 v1;
233 KIndexFileHeader_v2 v2;
234 KIndexFileHeader_v3 v3;
235 } hdrs;
236
237 const KDBHdr *hdr = addr;
238 const KIndexFileHeader_v3 *fh = addr;
239
240 * byteswap = false;
241 rc = KDBHdrValidate ( hdr, size, 1, KDBINDEXVERS );
242 if ( GetRCState ( rc ) == rcIncorrect && GetRCObject ( rc ) == rcByteOrder )
243 {
244 hdrs . v1 . endian = bswap_32 ( hdr -> endian );
245 hdrs . v1 . version = bswap_32 ( hdr -> version );
246 rc = KDBHdrValidate ( & hdrs . v1, size, 1, KDBINDEXVERS );
247 if ( rc == 0 )
248 {
249 * byteswap = true;
250 switch ( hdrs . v1 . version )
251 {
252 case 1:
253 hdr = & hdrs . v1;
254 break;
255 case 2:
256 hdr = & hdrs . v2;
257 break;
258 case 3:
259 case 4:
260 hdrs . v3 . index_type = bswap_32 ( fh -> index_type );
261 hdrs . v3 . reserved1 = bswap_32 ( fh -> reserved1 );
262 hdr = & hdrs . v3 . h;
263 fh = & hdrs . v3;
264 break;
265 }
266 }
267 }
268 if ( rc == 0 )
269 {
270 self -> vers = hdr -> version;
271 switch ( hdr -> version )
272 {
273 case 1:
274#if KDBINDEXVERS != 1
275 self -> converted_from_v1 = true;
276#endif
277 case 2:
278 self -> type = kitText;
279 break;
280 case 3:
281 case 4:
282 {
283 self -> type = fh -> index_type;
284 switch ( self -> type )
285 {
286 case kitText:
287 case kitU64:
288 break;
289 default:
290 rc = RC(rcDB, rcIndex, rcConstructing, rcIndex, rcUnrecognized);
291 }
292 break;
293 }
294 default:
295 rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcBadVersion );
296 }
297 }
298 }
299 }
300 return rc;
301}
302
303static
304rc_t KIndexMakeRead ( KIndex **idxp,
305 const KDirectory *dir, const char *path )
306{
307 const KFile *f;
308 rc_t rc = KDirectoryVOpenFileRead ( dir, & f, path, NULL );
309 if ( rc == 0 )
310 {
311 const KMMap *mm;
312 rc = KMMapMakeRead ( & mm, f );
313 if ( rc == 0 )
314 {
315 rc = KIndexMake ( idxp, path );
316 if ( rc == 0 )
317 {
318 bool byteswap;
319 KIndex *idx = * idxp;
320 rc = KIndexAttach ( idx, mm, & byteswap );
321 if ( rc == 0 )
322 {
323 rc = RC ( rcDB, rcIndex, rcConstructing, rcIndex, rcBadVersion );
324
325 switch ( idx -> vers )
326 {
327 case 1:
328 /* open using v1 code only if KDBINDEXVERS is 1
329 if 2 or later, open as a v2 index */
330#if KDBINDEXVERS == 1
331 rc = KTrieIndexOpen_v1 ( & idx -> u . txt1, mm );
332 if ( rc == 0 )
333 {
334 if ( idx -> u . txt1 . pt . id2node != NULL )
335 idx -> type = ( uint8_t ) ( kitText | kitProj );
336 else
337 idx -> type = ( uint8_t ) kitText;
338 }
339 break;
340#else
341 case 2:
342 idx -> vers = 3;
343 case 3:
344 case 4:
345 switch ( idx -> type )
346 {
347 case kitText:
348 case kitText | kitProj:
349 /* will guess version in open */
350 rc = KTrieIndexOpen_v2 ( & idx -> u . txt234, mm, byteswap );
351 if( rc == 0 && idx -> u . txt234 . pt . ord2node != NULL )
352 idx -> type |= kitProj;
353 break;
354
355 case kitU64:
356 rc = KU64IndexOpen_v3 ( & idx -> u . u64_3, mm, byteswap );
357 break;
358 }
359 break;
360#endif
361 }
362 }
363
364 if ( rc != 0 )
365 KIndexWhack ( idx );
366 }
367
368 KMMapRelease ( mm );
369 }
370
371 KFileRelease ( f );
372 }
373 return rc;
374}
375
376
377/* OpenIndexRead
378 * VOpenIndexRead
379 * open an index for read
380 *
381 * "idx" [ OUT ] - return parameter for newly opened index
382 *
383 * "name" [ IN ] - NUL terminated string in UTF-8 giving simple name of idx
384 */
385static
386rc_t KDBManagerOpenIndexReadInt ( const KDBManager *self,
387 KIndex **idxp, const KDirectory *wd, const char *path )
388{
389 char idxpath [ 4096 ];
390 rc_t rc = KDirectoryVResolvePath ( wd, true,
391 idxpath, sizeof idxpath, path, NULL );
392 if ( rc == 0 )
393 {
394 KIndex *idx;
395
396 switch ( KDirectoryVPathType ( wd, idxpath, NULL ) )
397 {
398 case kptNotFound:
399 return RC ( rcDB, rcMgr, rcOpening, rcIndex, rcNotFound );
400 case kptBadPath:
401 return RC ( rcDB, rcMgr, rcOpening, rcPath, rcInvalid );
402 case kptFile:
403 case kptFile | kptAlias:
404 break;
405 default:
406 return RC ( rcDB, rcMgr, rcOpening, rcPath, rcIncorrect );
407 }
408
409 rc = KIndexMakeRead ( & idx, wd, idxpath );
410 if ( rc == 0 )
411 {
412 idx -> mgr = KDBManagerAttach ( self );
413 * idxp = idx;
414 return 0;
415 }
416 }
417
418 return rc;
419}
420
421LIB_EXPORT rc_t CC KDatabaseOpenIndexRead ( struct KDatabase const *self,
422 const KIndex **idx, const char *name, ... )
423{
424 rc_t rc = 0;
425 va_list args;
426
427 va_start ( args, name );
428 rc = KDatabaseVOpenIndexRead ( self, idx, name, args );
429 va_end ( args );
430
431 return rc;
432}
433
434LIB_EXPORT rc_t CC KDatabaseVOpenIndexRead ( const KDatabase *self,
435 const KIndex **idxp, const char *name, va_list args )
436{
437 rc_t rc = 0;
438 char path [ 256 ];
439
440 if ( idxp == NULL )
441 return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
442
443 * idxp = NULL;
444
445 if ( self == NULL )
446 return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
447
448 rc = KDBVMakeSubPath ( self -> dir,
449 path, sizeof path, "idx", 3, name, args );
450 if ( rc == 0 )
451 {
452 KIndex *idx;
453 rc = KDBManagerOpenIndexReadInt ( self -> mgr,
454 & idx, self -> dir, path );
455 if ( rc == 0 )
456 {
457 idx -> db = KDatabaseAttach ( self );
458 * idxp = idx;
459 }
460 }
461 return rc;
462}
463
464LIB_EXPORT rc_t CC KTableOpenIndexRead ( struct KTable const *self,
465 const KIndex **idx, const char *name, ... )
466{
467 rc_t rc = 0;
468 va_list args;
469
470 va_start ( args, name );
471 rc = KTableVOpenIndexRead ( self, idx, name, args );
472 va_end ( args );
473
474 return rc;
475}
476
477LIB_EXPORT rc_t CC KTableVOpenIndexRead ( const KTable *self,
478 const KIndex **idxp, const char *name, va_list args )
479{
480 rc_t rc = 0;
481 char path [ 256 ];
482
483 if ( idxp == NULL )
484 return RC ( rcDB, rcTable, rcOpening, rcParam, rcNull );
485
486 * idxp = NULL;
487
488 if ( self == NULL )
489 return RC ( rcDB, rcTable, rcOpening, rcSelf, rcNull );
490
491 if ( self -> prerelease )
492 {
493 int len;
494 if ( args == 0 )
495 len = snprintf ( path, sizeof path, name );
496 else
497 len = vsnprintf ( path, sizeof path, name, args );
498 if ( len < 0 || ( size_t ) len >= sizeof path )
499 return RC ( rcDB, rcTable, rcOpening, rcPath, rcExcessive );
500 rc = 0;
501 }
502 else
503 {
504 rc = KDBVMakeSubPath ( self -> dir,
505 path, sizeof path, "idx", 3, name, args );
506 }
507
508 if ( rc == 0 )
509 {
510 KIndex *idx;
511 rc = KDBManagerOpenIndexReadInt ( self -> mgr,
512 & idx, self -> dir, path );
513 if ( rc == 0 )
514 {
515 idx -> tbl = KTableAttach ( self );
516 * idxp = idx;
517 }
518 }
519 return rc;
520}
521
522
523/* Locked
524 * returns non-zero if locked
525 */
526LIB_EXPORT bool CC KIndexLocked ( const KIndex *self )
527{
528 rc_t rc;
529 const KDirectory *dir;
530
531 if ( self == NULL )
532 return false;
533
534 assert ( self -> db != NULL || self -> tbl != NULL );
535 dir = ( self -> db != NULL ) ?
536 self -> db -> dir : self -> tbl -> dir;
537
538 rc = KDBWritable ( dir, self -> path );
539 return GetRCState ( rc ) == rcLocked;
540}
541
542
543/* Version
544 * returns the format version
545 */
546LIB_EXPORT rc_t CC KIndexVersion ( const KIndex *self, uint32_t *version )
547{
548 if ( version == NULL )
549 return RC ( rcDB, rcIndex, rcAccessing, rcParam, rcNull );
550
551 if ( self == NULL )
552 {
553 * version = 0;
554 return RC ( rcDB, rcIndex, rcAccessing, rcSelf, rcNull );
555 }
556
557 * version = self -> vers;
558 return 0;
559}
560
561
562/* Type
563 * returns the type of index
564 */
565LIB_EXPORT rc_t CC KIndexType ( const KIndex *self, KIdxType *type )
566{
567 if ( type == NULL )
568 return RC ( rcDB, rcIndex, rcAccessing, rcParam, rcNull );
569
570 if ( self == NULL )
571 {
572 * type = ( KIdxType ) 0;
573 return RC ( rcDB, rcIndex, rcAccessing, rcSelf, rcNull );
574 }
575
576 * type = ( KIdxType ) self -> type;
577 return 0;
578}
579
580
581/* CheckConsistency
582 * run a consistency check on the open index
583 *
584 * "level" [ IN ] - a measure of rigor of the exercise:
585 * 0 is the lightest
586 * 1 will test all id mappings
587 * 2 will perform key->id retrievals
588 * 3 will perform id->key retrievals if a projection index exists
589 *
590 * "start_id" [ OUT, NULL OKAY ] - returns the first id in index
591 *
592 * "id_range" [ OUT, NULL OKAY ] - returns the range of ids from first to last
593 *
594 * "num_keys" [ OUT, NULL OKAY ] - returns the number of key entries
595 *
596 * "num_rows" [ OUT, NULL OKAY ] - returns the number of key->id mappings
597 *
598 * "num_holes" [ OUT, NULL OKAY ] - returns the number of holes in the mapped id range
599 */
600LIB_EXPORT rc_t CC KIndexConsistencyCheck ( const KIndex *self, uint32_t level,
601 int64_t *start_id, uint64_t *id_range, uint64_t *num_keys,
602 uint64_t *num_rows, uint64_t *num_holes )
603{
604 rc_t rc;
605
606 if ( self == NULL )
607 rc = RC ( rcDB, rcIndex, rcValidating, rcSelf, rcNull );
608 else
609 {
610 bool key2id, id2key, all_ids;
611 switch ( level )
612 {
613 case 0:
614 key2id = id2key = all_ids = false;
615 break;
616 case 1:
617 key2id = id2key = false;
618 all_ids = true;
619 break;
620 case 2:
621 key2id = id2key = true;
622 all_ids = false;
623 break;
624 default:
625 key2id = id2key = all_ids = true;
626 }
627
628 switch ( self -> type )
629 {
630 case kitText:
631 id2key = false;
632 case kitText | kitProj:
633 switch ( self -> vers )
634 {
635 case 1:
636 rc = KTrieIndexCheckConsistency_v1 ( & self -> u . txt1,
637 start_id, id_range, num_keys, num_rows, num_holes,
638 self, key2id, id2key );
639 break;
640 case 2:
641 case 3:
642 case 4:
643 rc = KTrieIndexCheckConsistency_v2 ( & self -> u . txt234,
644 start_id, id_range, num_keys, num_rows, num_holes,
645 self, key2id, id2key, all_ids, self -> converted_from_v1 );
646 break;
647 default:
648 return RC ( rcDB, rcIndex, rcValidating, rcIndex, rcBadVersion );
649 }
650 break;
651
652 default:
653 rc = RC ( rcDB, rcIndex, rcValidating, rcFunction, rcUnsupported );
654 }
655 }
656
657 return rc;
658}
659
660
661/* Find
662 * finds a single mapping from key
663 */
664LIB_EXPORT rc_t CC KIndexFindText ( const KIndex *self, const char *key, int64_t *start_id, uint64_t *id_count,
665 int ( CC * custom_cmp ) ( const void *item, struct PBSTNode const *n, void *data ),
666 void *data )
667{
668 rc_t rc = 0;
669 uint32_t id32, span;
670
671 if ( id_count != NULL )
672 * id_count = 0;
673
674 if ( start_id == NULL )
675 return RC ( rcDB, rcIndex, rcSelecting, rcParam, rcNull );
676
677 * start_id = 0;
678
679 if ( self == NULL )
680 return RC ( rcDB, rcIndex, rcSelecting, rcSelf, rcNull );
681
682 if ( key == NULL )
683 return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNull );
684 if ( key [ 0 ] == 0 )
685 return RC ( rcDB, rcIndex, rcSelecting, rcString, rcEmpty );
686
687 span = 1;
688
689 switch ( self -> type )
690 {
691 case kitText:
692 case kitText | kitProj:
693 switch ( self -> vers )
694 {
695 case 1:
696 rc = KTrieIndexFind_v1 ( & self -> u . txt1, key, & id32, custom_cmp, data );
697 if ( rc == 0 )
698 * start_id = id32;
699 break;
700 case 2:
701 case 3:
702 case 4:
703#if V2FIND_RETURNS_SPAN
704 rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, start_id, & span, custom_cmp, data, self -> converted_from_v1 );
705#else
706 rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, start_id, custom_cmp, data, self -> converted_from_v1 );
707#endif
708 break;
709 default:
710 return RC ( rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion );
711 }
712 break;
713 default:
714 return RC ( rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown );
715 }
716
717 if ( id_count != NULL )
718 * id_count = span;
719
720 return rc;
721}
722
723
724/* FindAll
725 * finds all mappings from key
726 */
727LIB_EXPORT rc_t CC KIndexFindAllText ( const KIndex *self, const char *key,
728 rc_t ( CC * f ) ( int64_t id, uint64_t id_count, void *data ), void *data )
729{
730 rc_t rc = 0;
731 int64_t id64;
732 uint32_t id32, span;
733
734 if ( self == NULL )
735 return RC ( rcDB, rcIndex, rcSelecting, rcSelf, rcNull );
736
737 if ( f == NULL )
738 return RC ( rcDB, rcIndex, rcSelecting, rcFunction, rcNull );
739
740 if ( key == NULL )
741 return RC ( rcDB, rcIndex, rcSelecting, rcString, rcNull );
742 if ( key [ 0 ] == 0 )
743 return RC ( rcDB, rcIndex, rcSelecting, rcString, rcEmpty );
744
745 span = 1;
746
747 switch ( self -> type )
748 {
749 case kitText:
750 case kitText | kitProj:
751 switch ( self -> vers )
752 {
753 case 1:
754 rc = KTrieIndexFind_v1 ( & self -> u . txt1, key, & id32, NULL, NULL );
755 if ( rc == 0 )
756 rc = ( * f ) ( id32, 1, data );
757 break;
758 case 2:
759 case 3:
760 case 4:
761#if V2FIND_RETURNS_SPAN
762 rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, & id64, & span, NULL, NULL, self -> converted_from_v1 );
763#else
764 rc = KTrieIndexFind_v2 ( & self -> u . txt234, key, & id64, NULL, NULL, self -> converted_from_v1 );
765#endif
766 if ( rc == 0 )
767 rc = ( * f ) ( id64, span, data );
768 break;
769 default:
770 return RC ( rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion );
771 }
772 break;
773 default:
774 return RC ( rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown );
775 }
776
777 return rc;
778}
779
780
781/* Project
782 * finds key(s) mapping to value/id if supported
783 */
784LIB_EXPORT rc_t CC KIndexProjectText ( const KIndex *self,
785 int64_t id, int64_t *start_id, uint64_t *id_count,
786 char *key, size_t kmax, size_t *actsize )
787{
788 rc_t rc = 0;
789 int64_t dummy;
790 uint32_t span;
791
792 if ( start_id == NULL )
793 start_id = & dummy;
794
795 * start_id = 0;
796
797 if ( id_count != NULL )
798 * id_count = 0;
799
800 if ( key == NULL && kmax != 0 )
801 return RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcNull );
802
803 if ( kmax != 0 )
804 key [ 0 ] = 0;
805
806 if ( self == NULL )
807 return RC ( rcDB, rcIndex, rcProjecting, rcSelf, rcNull );
808
809 if ( ( ( KIdxType ) self -> type & kitProj ) == 0 )
810 return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcIncorrect );
811
812 if ( key == NULL )
813 return RC ( rcDB, rcIndex, rcProjecting, rcBuffer, rcNull );
814
815 span = 1;
816
817 switch ( self -> type )
818 {
819 case kitText | kitProj:
820 switch ( self -> vers )
821 {
822 case 1:
823 /* there is a limit on ids in v1 */
824 if ( id <= 0 || ( id >> 32 ) != 0 )
825 return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
826
827 rc = KTrieIndexProject_v1 ( & self -> u . txt1,
828 ( uint32_t ) id, key, kmax, actsize );
829 if ( rc == 0 )
830 * start_id = id;
831 break;
832 case 2:
833 case 3:
834 case 4:
835#if V2FIND_RETURNS_SPAN
836 rc = KTrieIndexProject_v2 ( & self -> u . txt234, id, start_id, & span, key, kmax, actsize );
837#else
838 rc = KTrieIndexProject_v2 ( & self -> u . txt234, id, key, kmax, actsize );
839 if ( rc == 0 )
840 * start_id = id;
841#endif
842 break;
843 default:
844 return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcBadVersion );
845 }
846 break;
847 default:
848 return RC ( rcDB, rcIndex, rcProjecting, rcNoObj, rcUnknown );
849 }
850
851 if ( id_count != NULL )
852 * id_count = span;
853
854 return rc;
855}
856
857
858/* ProjectAll
859 * finds key(s) mapping to value/id if supported
860 */
861LIB_EXPORT rc_t CC KIndexProjectAllText ( const KIndex *self, int64_t id,
862 rc_t ( CC * f ) ( int64_t start_id, uint64_t id_count, const char *key, void *data ),
863 void *data )
864{
865 rc_t rc = 0;
866 char key [ 256 ];
867
868 uint32_t span;
869 int64_t start_id;
870
871 if ( self == NULL )
872 return RC ( rcDB, rcIndex, rcProjecting, rcSelf, rcNull );
873
874 if ( ( ( KIdxType ) self -> type & kitProj ) == 0 )
875 return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcIncorrect );
876
877 if ( f == NULL )
878 return RC ( rcDB, rcIndex, rcProjecting, rcFunction, rcNull );
879
880 span = 1;
881
882 switch ( self -> type )
883 {
884 case kitText | kitProj:
885 switch ( self -> vers )
886 {
887 case 1:
888 /* there is a limit on ids in v1 */
889 if ( id <= 0 || ( id >> 32 ) != 0 )
890 return RC ( rcDB, rcIndex, rcProjecting, rcId, rcNotFound );
891
892 rc = KTrieIndexProject_v1 ( & self -> u . txt1,
893 ( uint32_t ) id, key, sizeof key, NULL );
894 if ( rc == 0 )
895 rc = ( * f ) ( id, 1, key, data );
896 break;
897
898 case 2:
899 case 3:
900 case 4:
901#if V2FIND_RETURNS_SPAN
902 rc = KTrieIndexProject_v2 ( & self -> u . txt234, id, & start_id, & span, key, sizeof key, NULL );
903#else
904 rc = KTrieIndexProject_v2 ( & self -> u . txt234, start_id = id, key, sizeof key );
905#endif
906 if ( rc == 0 )
907 rc = ( * f ) ( start_id, span, key, data );
908 break;
909
910 default:
911 return RC ( rcDB, rcIndex, rcProjecting, rcIndex, rcBadVersion );
912 }
913 break;
914 default:
915 return RC ( rcDB, rcIndex, rcProjecting, rcNoObj, rcUnknown );
916 }
917
918 return rc;
919}
920
921LIB_EXPORT rc_t CC KIndexFindU64( const KIndex* self, uint64_t offset, uint64_t* key, uint64_t* key_size, int64_t* id, uint64_t* id_qty )
922{
923 rc_t rc = 0;
924
925 if( key == NULL || key_size == NULL || id == NULL || id_qty == NULL ) {
926 return RC(rcDB, rcIndex, rcSelecting, rcParam, rcNull);
927 }
928 *key = *key_size = *id = *id_qty = 0;
929 if( self == NULL ) {
930 return RC(rcDB, rcIndex, rcSelecting, rcSelf, rcNull);
931 }
932
933 switch( self->type )
934 {
935 case kitU64:
936 switch( self->vers )
937 {
938 case 3:
939 case 4:
940 rc = KU64IndexFind_v3(&self->u.u64_3, offset, key, key_size, id, id_qty);
941 break;
942 default:
943 return RC(rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion);
944 }
945 break;
946 default:
947 return RC(rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown);
948 }
949 return rc;
950}
951
952LIB_EXPORT rc_t CC KIndexFindAllU64( const KIndex* self, uint64_t offset,
953 rc_t ( CC * f )(uint64_t key, uint64_t key_size, int64_t id, uint64_t id_qty, void* data ), void* data)
954{
955 rc_t rc = 0;
956
957 if ( self == NULL )
958 return RC(rcDB, rcIndex, rcSelecting, rcSelf, rcNull);
959 if ( f == NULL )
960 return RC(rcDB, rcIndex, rcSelecting, rcFunction, rcNull);
961
962 switch ( self->type )
963 {
964 case kitU64:
965 switch ( self->vers )
966 {
967 case 3:
968 case 4:
969 rc = KU64IndexFindAll_v3(&self->u.u64_3, offset, f, data);
970 break;
971 default:
972 return RC(rcDB, rcIndex, rcSelecting, rcIndex, rcBadVersion);
973 }
974 break;
975 default:
976 return RC(rcDB, rcIndex, rcSelecting, rcNoObj, rcUnknown);
977 }
978
979 return rc;
980}
981
982
983/* SetMaxId
984 * certain legacy versions of skey were built to know only the starting id
985 * of the NAME_FMT column, but were never given a maximum id. allow them
986 * to be corrected here.
987 */
988LIB_EXPORT void CC KIndexSetMaxRowId ( const KIndex *cself, int64_t max_row_id )
989{
990 if ( cself != NULL ) switch ( cself -> type )
991 {
992 case kitText:
993 case kitText | kitProj:
994 switch ( cself -> vers )
995 {
996 case 2:
997 case 3:
998 case 4:
999 /* here we can repair the max row id */
1000 if ( cself -> u . txt234 . pt . maxid < max_row_id )
1001 ( ( KIndex* ) cself ) -> u . txt234 . pt . maxid = max_row_id;
1002 break;
1003 }
1004 break;
1005 }
1006}
01007
=== added file '.pc/hardening-format-security.patch/libs/kdb/table.c'
--- .pc/hardening-format-security.patch/libs/kdb/table.c 1970-01-01 00:00:00 +0000
+++ .pc/hardening-format-security.patch/libs/kdb/table.c 2014-04-08 01:47:44 +0000
@@ -0,0 +1,706 @@
1/*===========================================================================
2*
3* PUBLIC DOMAIN NOTICE
4* National Center for Biotechnology Information
5*
6* This software/database is a "United States Government Work" under the
7* terms of the United States Copyright Act. It was written as part of
8* the author's official duties as a United States Government employee and
9* thus cannot be copyrighted. This software/database is freely available
10* to the public for use. The National Library of Medicine and the U.S.
11* Government have not placed any restriction on its use or reproduction.
12*
13* Although all reasonable efforts have been taken to ensure the accuracy
14* and reliability of the software and data, the NLM and the U.S.
15* Government do not and cannot warrant the performance or results that
16* may be obtained by using this software or data. The NLM and the U.S.
17* Government disclaim all warranties, express or implied, including
18* warranties of performance, merchantability or fitness for any particular
19* purpose.
20*
21* Please cite the author in any work or product based on this material.
22*
23* ===========================================================================
24*
25*/
26
27#define TRACK_REFERENCES 0
28
29#define KONST const
30#include "table-priv.h"
31#include "dbmgr-priv.h"
32#include "database-priv.h"
33#include "kdb-priv.h"
34#undef KONST
35
36#include <kdb/extern.h>
37#include <klib/namelist.h>
38#include <klib/log.h>
39#include <klib/rc.h>
40#include <klib/printf.h>
41#include <os-native.h>
42#include <sysalloc.h>
43
44#include <limits.h>
45#include <stdlib.h>
46#include <stdio.h>
47#include <string.h>
48#include <assert.h>
49
50
51/*--------------------------------------------------------------------------
52 * KTable
53 * a collection of columns indexed by row id, metadata, indices
54 */
55
56/* GetPath
57 * return the absolute path to table
58 */
59LIB_EXPORT rc_t CC KTableGetPath ( const KTable *self,
60 const char **path )
61{
62 if ( self == NULL )
63 return RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
64 if ( path == NULL )
65 return RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
66
67 *path = self->path;
68
69 return 0;
70}
71
72/* Whack
73 */
74static
75rc_t KTableWhack ( KTable *self )
76{
77 rc_t rc = 0;
78
79 KRefcountWhack ( & self -> refcount, "KTable" );
80
81 if ( self -> db != NULL )
82 {
83 rc = KDatabaseSever ( self -> db );
84 if ( rc == 0 )
85 self -> db = NULL;
86 }
87
88 if ( rc == 0 )
89 rc = KDBManagerSever ( self -> mgr );
90
91 if ( rc == 0 )
92 {
93 KDirectoryRelease ( self -> dir );
94 free ( self );
95 return 0;
96 }
97
98 KRefcountInit ( & self -> refcount, 1, "KTable", "whack", "ktbl" );
99
100 return rc;
101}
102
103
104/* AddRef
105 * Release
106 * all objects are reference counted
107 * NULL references are ignored
108 */
109LIB_EXPORT rc_t CC KTableAddRef ( const KTable *self )
110{
111 if ( self != NULL )
112 {
113 switch ( KRefcountAdd ( & self -> refcount, "KTable" ) )
114 {
115 case krefLimit:
116 return RC ( rcDB, rcTable, rcAttaching, rcRange, rcExcessive );
117 }
118 }
119 return 0;
120}
121
122LIB_EXPORT rc_t CC KTableRelease ( const KTable *self )
123{
124 if ( self != NULL )
125 {
126 switch ( KRefcountDrop ( & self -> refcount, "KTable" ) )
127 {
128 case krefWhack:
129 return KTableWhack ( ( KTable* ) self );
130 case krefNegative:
131 return RC ( rcDB, rcTable, rcReleasing, rcRange, rcExcessive );
132 }
133 }
134 return 0;
135}
136
137/* Attach
138 * Sever
139 */
140KTable *KTableAttach ( const KTable *self )
141{
142 if ( self != NULL )
143 {
144 switch ( KRefcountAddDep ( & self -> refcount, "KTable" ) )
145 {
146 case krefLimit:
147 return NULL;
148 }
149 }
150 return ( KTable* ) self;
151}
152
153/* Sever
154 * like KTableRelease, except called internally
155 * indicates that a child object is letting go...
156 */
157rc_t KTableSever ( const KTable *self )
158{
159 if ( self != NULL )
160 {
161 switch ( KRefcountDropDep ( & self -> refcount, "KTable" ) )
162 {
163 case krefWhack:
164 return KTableWhack ( ( KTable* ) self );
165 case krefNegative:
166 return RC ( rcDB, rcTable, rcReleasing, rcRange, rcExcessive );
167 }
168 }
169 return 0;
170}
171
172/* Make
173 * make an initialized structure
174 * NB - does NOT attach reference to dir, but steals it
175 */
176static
177rc_t KTableMake ( KTable **tblp, const KDirectory *dir, const char *path )
178{
179 KTable *tbl;
180
181 assert ( tblp != NULL );
182 assert ( path != NULL );
183
184 tbl = malloc ( sizeof * tbl + strlen ( path ) );
185 if ( tbl == NULL )
186 {
187 * tblp = NULL;
188 return RC ( rcDB, rcTable, rcConstructing, rcMemory, rcExhausted );
189 }
190
191 memset ( tbl, 0, sizeof * tbl );
192 tbl -> dir = dir;
193 KRefcountInit ( & tbl -> refcount, 1, "KTable", "make", path );
194 strcpy ( tbl -> path, path );
195
196 * tblp = tbl;
197 return 0;
198}
199
200
201/* OpenTableRead
202 * VOpenTableRead
203 * open a table for read
204 *
205 * "tbl" [ OUT ] - return parameter for newly opened table
206 *
207 * "path" [ IN ] - NUL terminated string in
208 * wd-native character set giving path to table
209 */
210static
211rc_t KDBManagerVOpenTableReadInt ( const KDBManager *self,
212 const KTable **tblp, const KDirectory *wd, bool try_srapath,
213 const char *path, va_list args )
214{
215 rc_t rc;
216
217 char tblpath [ 4096 ];
218 int z = ( args == NULL ) ?
219 snprintf ( tblpath, sizeof tblpath, path ):
220 vsnprintf ( tblpath, sizeof tblpath, path, args );
221 if ( z < 0 || ( size_t ) z >= sizeof tblpath )
222 rc = RC ( rcDB, rcMgr, rcOpening, rcPath, rcExcessive );
223 else
224 {
225 KTable *tbl;
226 const KDirectory *dir;
227 bool prerelease = false;
228
229 rc = KDBOpenPathTypeRead ( self, wd, tblpath, &dir, kptTable, NULL, try_srapath );
230 if ( rc != 0 )
231 {
232 prerelease = true;
233 rc = KDBOpenPathTypeRead ( self, wd, tblpath, &dir, kptPrereleaseTbl, NULL, try_srapath );
234 }
235
236 if ( rc == 0 )
237 {
238 rc = KTableMake ( & tbl, dir, tblpath );
239 if ( rc == 0 )
240 {
241 tbl -> mgr = KDBManagerAttach ( self );
242 tbl -> prerelease = prerelease;
243 * tblp = tbl;
244 return 0;
245 }
246 KDirectoryRelease ( dir );
247 }
248 }
249 return rc;
250}
251
252
253LIB_EXPORT rc_t CC KDBManagerOpenTableRead ( const KDBManager *self,
254 const KTable **tbl, const char *path, ... )
255{
256 rc_t rc;
257 va_list args;
258
259 va_start ( args, path );
260 rc = KDBManagerVOpenTableRead ( self, tbl, path, args );
261 va_end ( args );
262
263 return rc;
264}
265
266
267LIB_EXPORT rc_t CC KDBManagerVOpenTableRead ( const KDBManager *self,
268 const KTable **tbl, const char *path, va_list args )
269{
270 if ( tbl == NULL )
271 return RC ( rcDB, rcMgr, rcOpening, rcParam, rcNull );
272
273 * tbl = NULL;
274
275 if ( self == NULL )
276 return RC ( rcDB, rcMgr, rcOpening, rcSelf, rcNull );
277
278 return KDBManagerVOpenTableReadInt ( self, tbl, self -> wd, true, path, args);
279}
280
281LIB_EXPORT rc_t CC KDatabaseOpenTableRead ( const KDatabase *self,
282 const KTable **tbl, const char *name, ... )
283{
284 rc_t rc;
285 va_list args;
286
287 va_start ( args, name );
288 rc = KDatabaseVOpenTableRead ( self, tbl, name, args );
289 va_end ( args );
290
291 return rc;
292}
293
294LIB_EXPORT rc_t CC KDatabaseVOpenTableRead ( const KDatabase *self,
295 const KTable **tblp, const char *name, va_list args )
296{
297 rc_t rc;
298 char path [ 256 ];
299
300 if ( tblp == NULL )
301 return RC ( rcDB, rcDatabase, rcOpening, rcParam, rcNull );
302
303 * tblp = NULL;
304
305 if ( self == NULL )
306 return RC ( rcDB, rcDatabase, rcOpening, rcSelf, rcNull );
307
308 rc = KDBVMakeSubPath ( self -> dir,
309 path, sizeof path, "tbl", 3, name, args );
310 if ( rc == 0 )
311 {
312 rc = KDBManagerVOpenTableReadInt ( self -> mgr, tblp,
313 self -> dir, false, path, NULL );
314 if ( rc == 0 )
315 {
316 KTable *tbl = ( KTable* ) * tblp;
317 tbl -> db = KDatabaseAttach ( self );
318 }
319 }
320
321 return rc;
322}
323
324
325/* Locked
326 * returns non-zero if locked
327 */
328LIB_EXPORT bool CC KTableLocked ( const KTable *self )
329{
330 rc_t rc;
331
332 if ( self == NULL )
333 return false;
334
335 rc = KDBWritable ( self -> dir, "." );
336 return GetRCState ( rc ) == rcLocked;
337}
338
339
340/* Exists
341 * returns true if requested object exists
342 *
343 * "type" [ IN ] - a KDBPathType
344 *
345 * "path" [ IN ] - NUL terminated path
346 */
347LIB_EXPORT bool CC KTableVExists ( const KTable *self, uint32_t type, const char *name, va_list args )
348{
349 if ( self != NULL && name != NULL && name [ 0 ] != 0 )
350 {
351 rc_t rc;
352 const char *ns;
353 char path [ 256 ];
354
355 switch ( type )
356 {
357 case kptIndex:
358 ns = "idx";
359 break;
360
361 case kptColumn:
362 ns = "col";
363 break;
364
365 default:
366 return false;
367 }
368
369 rc = KDBVMakeSubPath ( self -> dir, path, sizeof path, ns, 3, name, args );
370 if ( rc == 0 )
371 {
372 switch ( KDirectoryPathType ( self -> dir, path ) )
373 {
374 case kptFile:
375 case kptDir:
376 case kptFile | kptAlias:
377 case kptDir | kptAlias:
378 return true;
379 }
380 }
381 }
382 return false;
383}
384
385LIB_EXPORT bool CC KTableExists ( const KTable *self, uint32_t type, const char *name, ... )
386{
387 bool exists;
388
389 va_list args;
390 va_start ( args, name );
391
392 exists = KTableVExists ( self, type, name, args );
393
394 va_end ( args );
395
396 return exists;
397}
398
399
400/* IsAlias
401 * returns true if object name is an alias
402 * returns path to fundamental name if it was aliased
403 *
404 * "type" [ IN ] - a KDBPathType
405 * valid values are kptIndex and kptColumn
406 *
407 * "resolved" [ OUT ] and "rsize" [ IN ] - optional output buffer
408 * for fundamenta object name if "alias" is not a fundamental name,
409 *
410 * "name" [ IN ] - NUL terminated object name
411 */
412LIB_EXPORT bool CC KTableIsAlias ( const KTable *self, uint32_t type,
413 char *resolved, size_t rsize, const char *name )
414{
415 if ( self != NULL && name != NULL && name [ 0 ] != 0 )
416 {
417 rc_t rc;
418 const char *ns;
419 char path [ 256 ];
420
421 switch ( type )
422 {
423 case kptIndex:
424 ns = "idx";
425 break;
426
427 case kptColumn:
428 ns = "col";
429 break;
430
431 default:
432 return false;
433 }
434
435 rc = KDBMakeSubPath ( self -> dir, path, sizeof path, ns, 3, name );
436 if ( rc == 0 )
437 {
438 switch ( KDirectoryPathType ( self -> dir, path ) )
439 {
440 case kptFile | kptAlias:
441 case kptDir | kptAlias:
442 if ( resolved != NULL && rsize != 0 )
443 {
444 const KDirectory *sub;
445 rc = KDirectoryOpenDirRead ( self -> dir, & sub, false, ns );
446 * resolved = 0;
447 if ( rc != 0 )
448 PLOGERR ( klogWarn, ( klogWarn, rc, "failed to open subdirectory '$(sub)'", "sub=%s", ns ) );
449 else
450 {
451 rc = KDirectoryResolveAlias ( sub, false, resolved, rsize, name );
452 KDirectoryRelease ( sub );
453 if ( rc != 0 )
454 PLOGERR ( klogWarn, ( klogWarn, rc, "failed to resolve alias '$(alias)'", "alias=%s", name ) );
455 }
456 }
457 return true;
458 }
459 }
460 }
461
462 if ( resolved != NULL && rsize != 0 )
463 * resolved = 0;
464
465 return false;
466}
467
468
469/* Writable
470 * returns 0 if object is writable
471 * or a reason why if not
472 *
473 * "type" [ IN ] - a KDBPathType
474 * valid values are kptIndex and kptColumn
475 *
476 * "path" [ IN ] - NUL terminated path
477 */
478LIB_EXPORT rc_t CC KTableVWritable ( const KTable *self, uint32_t type, const char *name, va_list args )
479{
480 /* TBD */
481 return -1;
482}
483
484LIB_EXPORT rc_t CC KTableWritable ( const KTable *self, uint32_t type, const char *name, ... )
485{
486 rc_t rc;
487
488 va_list args;
489 va_start ( args, name );
490
491 rc = KTableVWritable ( self, type, name, args );
492
493 va_end ( args );
494
495 return rc;
496}
497
498
499/* OpenManager
500 * duplicate reference to manager
501 * NB - returned reference must be released
502 */
503LIB_EXPORT rc_t CC KTableOpenManagerRead ( const KTable *self, const KDBManager **mgr )
504{
505 rc_t rc;
506
507 if ( mgr == NULL )
508 rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
509 else
510 {
511 if ( self == NULL )
512 rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
513 else
514 {
515 rc = KDBManagerAddRef ( self -> mgr );
516 if ( rc == 0 )
517 {
518 * mgr = self -> mgr;
519 return 0;
520 }
521 }
522
523 * mgr = NULL;
524 }
525
526 return rc;
527}
528
529
530/* OpenParent
531 * duplicate reference to parent database
532 * NB - returned reference must be released
533 */
534LIB_EXPORT rc_t CC KTableOpenParentRead ( const KTable *self, const KDatabase **db )
535{
536 rc_t rc;
537
538 if ( db == NULL )
539 rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
540 else
541 {
542 if ( self == NULL )
543 rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
544 else
545 {
546 rc = KDatabaseAddRef ( self -> db );
547 if ( rc == 0 )
548 {
549 * db = self -> db;
550 return 0;
551 }
552 }
553
554 * db = NULL;
555 }
556
557 return rc;
558}
559
560
561/* GetDirectory
562 * access the directory in use
563 */
564LIB_EXPORT rc_t CC KTableOpenDirectoryRead ( const KTable *self, const KDirectory **dir )
565{
566 rc_t rc;
567
568 if ( dir == NULL )
569 rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
570 else
571 {
572 if ( self == NULL )
573 rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
574 else
575 {
576 * dir = self -> dir;
577 return KDirectoryAddRef ( * dir );
578 }
579
580 * dir = NULL;
581 }
582
583 return rc;
584}
585
586
587/* ModDate
588 * get modification date
589 */
590LIB_EXPORT rc_t CC KTableModDate ( const KTable *self, KTime_t *mtime )
591{
592 rc_t rc;
593
594 if ( mtime == NULL )
595 rc = RC ( rcDB, rcTable, rcAccessing, rcParam, rcNull );
596 else
597 {
598 if ( self == NULL )
599 rc = RC ( rcDB, rcTable, rcAccessing, rcSelf, rcNull );
600 else
601 {
602 /* HACK ALERT - there needs to be a proper way to record modification times */
603 const KDirectory *dir = self -> dir;
604
605 /* this only tells the last time the table was locked,
606 which may be close to the last time it was modified */
607 rc = KDirectoryDate ( dir, mtime, "lock" );
608 if ( rc == 0 )
609 return 0;
610
611 if ( GetRCState ( rc ) == rcNotFound )
612 {
613 rc = KDirectoryDate ( dir, mtime, "sealed" );
614 if ( rc == 0 )
615 return 0;
616 }
617
618 /* get directory timestamp */
619 rc = KDirectoryDate ( dir, mtime, "." );
620 if ( rc == 0 )
621 return 0;
622 }
623
624 * mtime = 0;
625 }
626
627 return rc;
628}
629
630
631/*--------------------------------------------------------------------------
632 * KNamelist
633 */
634
635/* List
636 * create table listings
637 */
638struct FilterData
639{
640 const KDBManager * mgr;
641 int type;
642};
643
644static
645bool CC KDatabaseListFilter ( const KDirectory *dir, const char *name, void *data_ )
646{
647 struct FilterData * data = data_;
648 return ( KDBOpenPathTypeRead ( data->mgr, dir, name, NULL, data->type, NULL, false ) == 0 );
649}
650
651LIB_EXPORT rc_t CC KTableListCol ( const KTable *self, KNamelist **names )
652{
653 if ( self != NULL )
654 {
655 struct FilterData data;
656
657 data.mgr = self->mgr;
658 data.type = kptColumn;
659
660 return KDirectoryVList ( self -> dir,
661 names, KDatabaseListFilter, &data, "col", NULL );
662 }
663
664 if ( names != NULL )
665 * names = NULL;
666
667 return RC ( rcDB, rcTable, rcListing, rcSelf, rcNull );
668}
669
670static
671bool CC KTableListIdxFilter ( const KDirectory *dir, const char *name, void *data )
672{
673 const size_t sz = strlen(name);
674
675 if (sz > 4 && strcmp(&name[sz - 4], ".md5") == 0)
676 return false;
677 return true;
678}
679
680static
681bool CC KTableListSkeyFilter ( const KDirectory *dir, const char *name, void *data )
682{
683 if ( strcmp ( name, "skey" ) == 0 )
684 return true;
685 return false;
686}
687
688LIB_EXPORT rc_t CC KTableListIdx ( const KTable *self, KNamelist **names )
689{
690 if ( self != NULL )
691 {
692 if ( ! self -> prerelease )
693 {
694 return KDirectoryVList ( self -> dir,
695 names, KTableListIdxFilter, NULL, "idx", NULL );
696 }
697
698 return KDirectoryVList ( self -> dir,
699 names, KTableListSkeyFilter, NULL, ".", NULL );
700 }
701
702 if ( names != NULL )
703 * names = NULL;
704
705 return RC ( rcDB, rcTable, rcListing, rcSelf, rcNull );
706}
0707
=== added directory '.pc/hardening.patch'
=== added file '.pc/hardening.patch/Makefile'
--- .pc/hardening.patch/Makefile 1970-01-01 00:00:00 +0000
+++ .pc/hardening.patch/Makefile 2014-04-08 01:47:44 +0000
@@ -0,0 +1,110 @@
1# ===========================================================================
2#
3# PUBLIC DOMAIN NOTICE
4# National Center for Biotechnology Information
5#
6# This software/database is a "United States Government Work" under the
7# terms of the United States Copyright Act. It was written as part of
8# the author's official duties as a United States Government employee and
9# thus cannot be copyrighted. This software/database is freely available
10# to the public for use. The National Library of Medicine and the U.S.
11# Government have not placed any restriction on its use or reproduction.
12#
13# Although all reasonable efforts have been taken to ensure the accuracy
14# and reliability of the software and data, the NLM and the U.S.
15# Government do not and cannot warrant the performance or results that
16# may be obtained by using this software or data. The NLM and the U.S.
17# Government disclaim all warranties, express or implied, including
18# warranties of performance, merchantability or fitness for any particular
19# purpose.
20#
21# Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25
26#-------------------------------------------------------------------------------
27# environment
28#
29TOP ?= $(CURDIR)
30include $(TOP)/build/Makefile.shell
31
32
33#-------------------------------------------------------------------------------
34# default
35#
36SUBDIRS = \
37 libs \
38 tools
39
40# common targets for non-leaf Makefiles; must follow a definition of SUBDIRS
41include $(TOP)/build/Makefile.targets
42
43default: $(SUBDIRS)
44
45test: $(SUBDIRS)
46
47$(SUBDIRS) test:
48 @ $(MAKE) -C $@
49
50.PHONY: default $(SUBDIRS) test
51
52#-------------------------------------------------------------------------------
53# all
54#
55$(SUBDIRS_ALL):
56
57#-------------------------------------------------------------------------------
58# std
59#
60$(SUBDIRS_STD):
61
62#-------------------------------------------------------------------------------
63# clean
64#
65clean: clean_test
66
67clean_test:
68
69#-------------------------------------------------------------------------------
70# pass-through targets
71#
72COMPILERS = GCC VC++ CLANG
73ARCHITECTURES = i386 x86_64 sparc32 sparc64
74CONFIG = debug profile release static dynamic
75PUBLISH = scm pubtools
76REPORTS = bindir targdir osdir config compilers architecture architectures
77PASSTHRUS = \
78 out \
79 CC $(COMPILERS) \
80 $(ARCHITECTURES) \
81 $(CONFIG) $(PUBLISH)
82
83$(PASSTHRUS):
84 @ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env $@
85 @ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env rebuild-dirlinks config
86
87$(REPORTS):
88 @ $(MAKE) -s TOP=$(CURDIR) -f build/Makefile.env $@
89
90.PHONY: $(PASSTHRUS) $(REPORTS)
91
92
93#-------------------------------------------------------------------------------
94# configuration help
95#
96help configure:
97 @ echo "Before initial build, run 'make OUTDIR=<dir> out' from"
98 @ echo "the project root to set the output directory of your builds."
99 @ echo
100 @ echo "To select a compiler, run 'make <comp>' where"
101 @ echo "comp = { "$(COMPILERS)" }."
102 @ echo
103 @ echo "For hosts that support cross-compilation ( only Macintosh today ),"
104 @ echo "you can run 'make <arch>' where arch = { "$(ARCHITECTURES)" }."
105 @ echo
106 @ echo "To set a build configuration, run 'make <config>' where"
107 @ echo "config = { "$(CONFIG)" }."
108 @ echo
109
110.PHONY: help configure
0111
=== added directory '.pc/hardening.patch/build'
=== added file '.pc/hardening.patch/build/Makefile.env'
--- .pc/hardening.patch/build/Makefile.env 1970-01-01 00:00:00 +0000
+++ .pc/hardening.patch/build/Makefile.env 2014-04-08 01:47:44 +0000
@@ -0,0 +1,343 @@
1# ===========================================================================
2#
3# PUBLIC DOMAIN NOTICE
4# National Center for Biotechnology Information
5#
6# This software/database is a "United States Government Work" under the
7# terms of the United States Copyright Act. It was written as part of
8# the author's official duties as a United States Government employee and
9# thus cannot be copyrighted. This software/database is freely available
10# to the public for use. The National Library of Medicine and the U.S.
11# Government have not placed any restriction on its use or reproduction.
12#
13# Although all reasonable efforts have been taken to ensure the accuracy
14# and reliability of the software and data, the NLM and the U.S.
15# Government do not and cannot warrant the performance or results that
16# may be obtained by using this software or data. The NLM and the U.S.
17# Government disclaim all warranties, express or implied, including
18# warranties of performance, merchantability or fitness for any particular
19# purpose.
20#
21# Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25
26# pick up dependencies from object directory
27ifdef SRCDIR
28 include $(wildcard *.d)
29endif
30
31# determine shell environment
32include $(TOP)/build/Makefile.shell
33
34# normally build shared and static external libs
35LIBEXT = $(LIBX) $(SHLX)
36
37# normally build static intermediate libs
38ILIBEXT = $(LIBX)
39
40# would normally only build dynamic library modules,
41# but some tools are expecting to be able to static link
42MODEXT = $(LIBX) $(SHLX)
43
44# determine BUILD
45ifeq (,$(BUILD))
46 BUILD = dbg
47endif
48
49# some rules are sensitive to the type of build
50BUILDTYPE = $(BUILD)
51
52# adjust settings for build
53ifeq (dbg,$(BUILD))
54 DEBUG := -D_DEBUGGING
55# ILIBEXT = $(LIBX) $(SHLX)
56 MODEXT = $(LIBX) $(SHLX)
57endif
58ifeq (rel,$(BUILD))
59 DEBUG := -DNDEBUG
60endif
61ifeq (prof,$(BUILD))
62 DEBUG := -DNDEBUG -D_PROFILING
63endif
64
65# allow for an all-static build
66ifeq (stat,$(LNKG))
67 STATIC = --static
68 LINKAGE := -D_STATIC
69 LIBEXT = $(LIBX)
70 ILIBEXT = $(LIBX)
71 MODEXT = $(LIBX)
72 STAT_OR_DYN = static
73 STATICSYSLIBS := --static-system-libs
74
75else
76 STAT_OR_DYN = dynamic
77endif
78
79LOCAL_OR_REMOTE = local
80
81
82# drop all suffix rules
83.SUFFIXES:
84
85# load OS and COMP specific files
86include $(TOP)/build/Makefile.$(OS)
87include $(TOP)/build/Makefile.$(COMP)
88include $(TOP)/build/Makefile.rules
89
90# external schema modules
91EXT_SCHEMA_MODULES = axf sraxf wgsxf vxf
92READONLY_SCHEMA_LIBS = $(addprefix -d,$(EXT_SCHEMA_MODULES))
93UPDATE_SCHEMA_LIBS = $(addprefix -dw,$(EXT_SCHEMA_MODULES))
94ALWAYS_STATIC_SCHEMA_LIBS = $(addprefix -s,$(EXT_SCHEMA_MODULES))
95
96# full directory paths
97OLD_TARGDIR = $(OUTDIR)/$(OSFLAV)/$(BUILD)/$(TOOLSET)/$(ARCH)
98TARGDIR = $(OUTDIR)/$(OSFLAV)/$(TOOLSET)/$(LNKG)/$(ARCH)/$(BUILD)
99BINDIR = $(TARGDIR)/bin
100ifeq (win,$(OS))
101 # on Windows, place test executables next to .dlls
102 TEST_BINDIR = $(BINDIR)
103else
104 TEST_BINDIR = $(TARGDIR)/test-bin
105endif
106ILIBDIR = $(TARGDIR)/ilib
107LIBDIR = $(TARGDIR)/lib
108MODDIR = $(TARGDIR)/mod
109WMODDIR = $(TARGDIR)/wmod
110OBJDIR = $(TARGDIR)/obj/$(MODULE)
111
112# path to the ncbi sub-directory
113# this is where modules and installed schema files are kept
114ifeq (win,$(OS))
115 # under Windows, we are always relative to binary path
116 NCBIDIR = $(BINDIR)/ncbi
117else
118ifeq (--static,$(STATIC))
119 # in static builds, we are relative to binary path
120 # because the configuration library will be part of tool
121 NCBIDIR = $(BINDIR)/ncbi
122else
123 # in dynamic builds, we are relative to library path
124 # because the configuration library will live there
125 NCBIDIR = $(LIBDIR)/ncbi
126endif
127endif
128
129# make reissue command
130MAKE_CMD = $(MAKE) BUILD=$(BUILD) TOOLSET=$(TOOLSET) COMP=$(COMP) LNKG=$(LNKG) \
131 TOP=$(TOP) SRCDIR=$(SRCDIR) OUTDIR=$(OUTDIR) -C $(OBJDIR) -f $(SRCDIR)/Makefile
132
133# directory and link creation
134SUBDIRS = bin test-bin ilib lib
135OUTDIRS = schema
136
137# clean rules
138stdclean:
139 @ -rm -rf $(OBJDIR)
140 @ rm -rf $(addsuffix .*,$(addprefix $(ILIBDIR)/,$(ALL_LIBS))) \
141 $(addsuffix .*,$(addprefix $(LIBDIR)/,$(ALL_LIBS))) \
142 $(addsuffix .*,$(addprefix $(MODDIR)/,$(ALL_LIBS))) \
143 $(addsuffix .*,$(addprefix $(WMODDIR)/,$(ALL_LIBS))) \
144 $(addsuffix *,$(addprefix $(BINDIR)/,$(ALL_TOOLS) $(ALL_LIBS))) \
145 $(addsuffix *,$(addprefix $(TEST_BINDIR)/,$(ALL_TOOLS) $(TEST_TOOLS)))
146
147# removing symbolic links that point to specific builds
148removelinks:
149 @ test ! -h $(OUTDIR)/schema && rm -rf $(OUTDIR)/schema || true
150 @ rm -f $(addprefix $(OUTDIR)/,$(addsuffix $(BITS),$(SUBDIRS)))
151 @ rm -f $(addprefix $(OUTDIR)/,$(OUTDIRS))
152
153# create all required output directories
154makedirs:
155 @ mkdir -p $(addprefix $(TARGDIR)/,$(SUBDIRS) obj/$(MODULE)) $(NCBIDIR)
156
157# build version include files
158vers-includes: makedirs
159 @ $(MAKE_CMD) -s $(TARGDIR)/$@
160
161ifeq (win,$(OS))
162
163# Windows doesn't really support symbolic links
164# we may add them back in when our toolkit is able to create them
165rebuild-dirlinks: makedirs
166 @ true
167else
168
169LNDIRS = $(addprefix ln_,$(SUBDIRS))
170$(LNDIRS):
171 @ ln -s $(TARGDIR)/$(subst ln_,,$@) $(OUTDIR)/$(subst ln_,,$@)$(BITS)
172
173ifdef NOREBUILD_LINKS
174rebuild-dirlinks:
175 @ true
176else
177rebuild-dirlinks: removelinks makedirs $(LNDIRS)
178 @ ln -s $(TOP)/interfaces $(OUTDIR)/schema
179endif
180
181endif
182
183.PHONY: stdclean removelinks makedirs vers-includes rebuild-dirlinks
184
185# configuration targets
186out:
187 @ echo $(OUTDIR) > $(TOP)/build/OUTDIR.$(BUILD_OS)
188 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
189
190CC:
191 @ echo cc > $(TOP)/build/COMP.$(OS)
192
193GCC:
194 @ echo gcc > $(TOP)/build/COMP.$(OS)
195
196ICC:
197 @ echo icc > $(TOP)/build/COMP.$(OS)
198
199VC++:
200 @ echo vc++ > $(TOP)/build/COMP.$(OS)
201
202CLANG:
203 @ echo clang > $(TOP)/build/COMP.$(OS)
204
205static:
206 @ echo stat > $(TOP)/build/LNKG.$(OS)
207
208dynamic:
209 @ echo dyn > $(TOP)/build/LNKG.$(OS)
210
211debug:
212 @ echo dbg > $(TOP)/build/BUILD.$(OS)
213
214profile: static
215 @ echo prof > $(TOP)/build/BUILD.$(OS)
216
217release:
218 @ echo rel > $(TOP)/build/BUILD.$(OS)
219
220pubtools: release static
221
222bindir:
223 @ echo "$(BINDIR)"
224
225targdir:
226 @ echo "$(TARGDIR)"
227
228osdir:
229 @ echo "$(OUTDIR)/$(OSFLAV)"
230
231compilers:
232 @ echo "$(COMPILERS)"
233
234architectures:
235 @ echo "$(ARCHITECTURES)"
236
237architecture:
238 @ echo "$(ARCH)"
239
240config:
241 @ echo " current build is $(BUILD_OS) $(STAT_OR_DYN) $(BUILD) $(ARCH) build using $(TOOLSET) tools"
242 @ echo " output target directory is '$(TARGDIR)'"
243 @ echo
244
245.PHONY: out CC GCC ICC debug profile release bindir report_config
246
247# includes based upon build
248ITF = $(TOP)/interfaces
249OSINC = $(TOP)/interfaces/os
250CCINC = $(TOP)/interfaces/cc
251XTINC = $(TOP)/interfaces/ext
252
253# OS specific source and include dirs
254SRCDIRS_OS = $(SRCDIR)/$(OS)
255INCDIRS_OS = $(OSINC)/$(OS)
256
257# most OS' have a parent type
258ifdef OS_DAD
259
260SRCDIRS_OS += $(SRCDIR)/$(OS_DAD)
261INCDIRS_OS += $(OSINC)/$(OS_DAD)
262
263# some OS' have a grandparent
264ifdef OS_GDAD
265SRCDIRS_OS += $(SRCDIR)/$(OS_GDAD)
266INCDIRS_OS += $(OSINC)/$(OS_GDAD)
267endif
268
269endif
270
271# compiler specific includes
272INCDIRS_COMP = \
273 $(CCINC)/$(COMP)/$(ARCH) \
274 $(CCINC)/$(COMP)
275
276# some compilers have a parent type
277ifdef COMP_DAD
278
279INCDIRS_COMP += \
280 $(CCINC)/$(COMP_DAD)/$(ARCH) \
281 $(CCINC)/$(COMP_DAD)
282
283endif
284
285VPATH = \
286 $(SRCDIR)/$(COMP)/$(ARCH) \
287 $(SRCDIR)/$(COMP) \
288 $(SRCDIRS_OS) \
289 $(SRCDIR)
290
291INCDIRS = \
292 $(addprefix -I,$(SRCDIRS_OS)) \
293 $(addprefix -I,$(SRCDIR) $(ITF)) \
294 $(addprefix -I,$(INCDIRS_COMP)) \
295 $(addprefix -I,$(INCDIRS_OS) $(XTINC)) \
296 -I.
297
298
299# defines that describe os & architecture
300DLLX ?= $(SHLX)
301ARCHDEFS = -D_ARCH_BITS=$(BITS) -DLIBPREFIX=$(LPFX) -DSHLIBEXT=$(DLLX)
302
303# default tool parameters
304CFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(PED) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)
305CPFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)
306LDFLAGS = $(DBG) $(PROF) $(CARCH)
307
308#-------------------------------------------------------------------------------
309# runtests
310#
311# MallocScribble=1 is for catching allocation problems on Mac
312#
313ifeq ($(RUNTESTS_OVERRIDE),)
314runtests: std $(TEST_TOOLS)
315 @ echo "$0 $*"; export LD_LIBRARY_PATH=$(LIBDIR);export MallocScribble=1;\
316 for i in $(TEST_TOOLS);\
317 do\
318 echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++;\
319 echo Run $(TEST_BINDIR)/$$i;eval $(RUN_REMOTELY) $(TEST_BINDIR)/$$i;r=$$?; \
320 if [ "$$r" != "0" ] ; then exit $$r; fi; \
321 done
322
323.PHONY: runtests
324endif
325
326#-------------------------------------------------------------------------------
327# buildtests
328#
329buildtests: std $(TEST_TOOLS) $(SLOW_TEST_TOOLS)
330
331#-------------------------------------------------------------------------------
332# slowtests
333#
334slowtests: std $(SLOW_TEST_TOOLS)
335 @ echo "$0 $*"; export LD_LIBRARY_PATH=$(LIBDIR);\
336 for i in $(SLOW_TEST_TOOLS);\
337 do\
338 echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++;\
339 echo Run $(TEST_BINDIR)/$$i;eval $(TEST_BINDIR)/$$i;r=$$?; \
340 if [ "$$r" != "0" ] ; then exit $$r; fi; \
341 done
342
343.PHONY: slowtests buildtests
0344
=== removed file 'CHANGES'
--- CHANGES 2012-01-10 09:06:14 +0000
+++ CHANGES 1970-01-01 00:00:00 +0000
@@ -1,30 +0,0 @@
1# ===========================================================================
2#
3# PUBLIC DOMAIN NOTICE
4# National Center for Biotechnology Information
5#
6# This software/database is a "United States Government Work" under the
7# terms of the United States Copyright Act. It was written as part of
8# the author's official duties as a United States Government employee and
9# thus cannot be copyrighted. This software/database is freely available
10# to the public for use. The National Library of Medicine and the U.S.
11# Government have not placed any restriction on its use or reproduction.
12#
13# Although all reasonable efforts have been taken to ensure the accuracy
14# and reliability of the software and data, the NLM and the U.S.
15# Government do not and cannot warrant the performance or results that
16# may be obtained by using this software or data. The NLM and the U.S.
17# Government disclaim all warranties, express or implied, including
18# warranties of performance, merchantability or fitness for any particular
19# purpose.
20#
21# Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25
26The NCBI SRA Software Development Kit
27Contact: sra-tools@ncbi.nlm.nih.gov
28
29Release documentation is now being delivered at
30http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software
310
=== modified file 'Makefile'
--- Makefile 2012-01-10 09:06:14 +0000
+++ Makefile 2014-04-08 01:47:44 +0000
@@ -37,6 +37,9 @@
37 libs \37 libs \
38 tools38 tools
3939
40# common targets for non-leaf Makefiles; must follow a definition of SUBDIRS
41include $(TOP)/build/Makefile.targets
42
40default: $(SUBDIRS)43default: $(SUBDIRS)
4144
42test: $(SUBDIRS)45test: $(SUBDIRS)
@@ -47,69 +50,44 @@
47.PHONY: default $(SUBDIRS) test50.PHONY: default $(SUBDIRS) test
4851
49#-------------------------------------------------------------------------------52#-------------------------------------------------------------------------------
50# static vs. dynamic
51#
52static:
53 @ touch "$(CURDIR)/build/STATIC"
54
55dynamic:
56 @ rm -f "$(CURDIR)/build/STATIC"
57
58.PHONY: static dynamic
59
60#-------------------------------------------------------------------------------
61# all53# all
62#54#
63SUBDIRS_ALL = $(addsuffix _all,$(SUBDIRS))
64
65all: $(SUBDIRS_ALL)
66
67$(SUBDIRS_ALL):55$(SUBDIRS_ALL):
68 @ $(MAKE) -C $(subst _all,,$@) all
69
70.PHONY: all $(SUBDIRS_ALL)
7156
72#-------------------------------------------------------------------------------57#-------------------------------------------------------------------------------
73# std58# std
74#59#
75SUBDIRS_STD = $(addsuffix _std,$(SUBDIRS))
76
77std: $(SUBDIRS_STD)
78
79$(SUBDIRS_STD):60$(SUBDIRS_STD):
80 @ $(MAKE) -C $(subst _std,,$@) std
81
82.PHONY: std $(SUBDIRS_STD)
8361
84#-------------------------------------------------------------------------------62#-------------------------------------------------------------------------------
85# clean63# clean
86#64#
87SUBDIRS_CLEAN = $(addsuffix _clean,$(SUBDIRS_ALL))65clean: clean_test
8866
89clean: $(SUBDIRS_CLEAN)67clean_test:
90
91$(SUBDIRS_CLEAN):
92 @ $(MAKE) -C $(subst _all_clean,,$@) clean
93
94.PHONY: clean $(SUBDIRS_CLEAN)
95
9668
97#-------------------------------------------------------------------------------69#-------------------------------------------------------------------------------
98# pass-through targets70# pass-through targets
99#71#
100COMPILERS = GCC ICC VC++72COMPILERS = GCC VC++ CLANG
101ARCHITECTURES = i386 x86_6473ARCHITECTURES = i386 x86_64 sparc32 sparc64
102CONFIG = debug profile release74CONFIG = debug profile release static dynamic
75PUBLISH = scm pubtools
76REPORTS = bindir targdir osdir config compilers architecture architectures
103PASSTHRUS = \77PASSTHRUS = \
104 out bindir \78 out \
105 CC $(COMPILERS) \79 CC $(COMPILERS) \
106 $(ARCHITECTURES) \80 $(ARCHITECTURES) \
107 $(CONFIG)81 $(CONFIG) $(PUBLISH)
10882
109$(PASSTHRUS):83$(PASSTHRUS):
110 @ $(MAKE) TOP=$(CURDIR) -f build/Makefile.env $@84 @ $(MAKE) -s TOP=$(CURDIR) DEB_CFLAGS="$(DEB_CFLAGS)" DEB_LDFLAGS="$(DEB_LDFLAGS)" -f build/Makefile.env $@
11185 @ $(MAKE) -s TOP=$(CURDIR) DEB_CFLAGS="$(DEB_CFLAGS)" DEB_LDFLAGS="$(DEB_LDFLAGS)" -f build/Makefile.env rebuild-dirlinks config
112.PHONY: $(PASSTHRUS)86
87$(REPORTS):
88 @ $(MAKE) -s TOP=$(CURDIR) DEB_CFLAGS="$(DEB_CFLAGS)" DEB_LDFLAGS="$(DEB_LDFLAGS)" -f build/Makefile.env $@
89
90.PHONY: $(PASSTHRUS) $(REPORTS)
11391
11492
115#-------------------------------------------------------------------------------93#-------------------------------------------------------------------------------
11694
=== modified file 'README'
--- README 2012-01-10 09:06:14 +0000
+++ README 2014-04-08 01:47:44 +0000
@@ -32,26 +32,8 @@
32The SRA Toolkit and SDK from NCBI is a collection of tools and32The SRA Toolkit and SDK from NCBI is a collection of tools and
33libraries for using data in the INSDC Sequence Read Archives.33libraries for using data in the INSDC Sequence Read Archives.
3434
35With this release, NCBI has implemented Compression by Reference, a35With this release, NCBI has implemented Automatic Remote Access by accession,
36sequence alignment compression process for storing sequence data.36making it possible to access data using NCBI servers without prior download.
37Currently BAM, Complete Genomics and Illumina export.txt formats
38contain alignment information. Compression by Reference only stores
39the difference in base pairs between sequence data and the segments it
40aligns to. The decompression process to restore original data such as
41fastq-dump would require fast access to the actual sequences of the
42references. NCBI recommends that SRA users dedicate local disk space
43to store local references downloaded from the NCBI SRA site. Linked
44references should be in a location accessible by the SRA Reader
45software.
46
47Older files in the NCBI system may not have been compressed using
48Compression by Reference. For more information on how to use
49Reference-based compressed files, download local references, and use
50related tools please refer to Compression by Reference file on the
51NCBI SRA website:
52
53 "http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=softwareReadme"
54
5537
56For additional information on using and building the toolkit,38For additional information on using and building the toolkit,
57please visit our web site at:39please visit our web site at:
5840
=== modified file 'README-WINDOWS.txt'
--- README-WINDOWS.txt 2012-01-10 09:06:14 +0000
+++ README-WINDOWS.txt 2014-04-08 01:47:44 +0000
@@ -29,6 +29,21 @@
29Contact: sra-tools@ncbi.nlm.nih.gov29Contact: sra-tools@ncbi.nlm.nih.gov
3030
3131
32NOTICE:
33
34 Effective as of release 2.1.8, NCBI is no longer supporting public sources for
35 Windows builds. The sources will still contain everything that we use to build
36 the binaries, but may not build in your environment.
37
38 The reason for this change has to do with dependencies upon third party
39 libraries, which are commonly installed on other platforms, but could be
40 described as "hit and miss" on Windows. When the libraries DO exist, it is
41 difficult to know if they have a correct or compatible calling convention.
42
43 We will continue to distribute pre-built binaries for Windows. You are welcome
44 to try your luck at compiling the sources yourself under Cygwin.
45
46
32ENVIRONMENT:47ENVIRONMENT:
3348
34 The Windows build uses the same makefiles as Linux and Mac, and has49 The Windows build uses the same makefiles as Linux and Mac, and has
3550
=== removed file 'README-build'
--- README-build 2012-01-10 09:06:14 +0000
+++ README-build 1970-01-01 00:00:00 +0000
@@ -1,237 +0,0 @@
1# ===========================================================================
2#
3# PUBLIC DOMAIN NOTICE
4# National Center for Biotechnology Information
5#
6# This software/database is a "United States Government Work" under the
7# terms of the United States Copyright Act. It was written as part of
8# the author's official duties as a United States Government employee and
9# thus cannot be copyrighted. This software/database is freely available
10# to the public for use. The National Library of Medicine and the U.S.
11# Government have not placed any restriction on its use or reproduction.
12#
13# Although all reasonable efforts have been taken to ensure the accuracy
14# and reliability of the software and data, the NLM and the U.S.
15# Government do not and cannot warrant the performance or results that
16# may be obtained by using this software or data. The NLM and the U.S.
17# Government disclaim all warranties, express or implied, including
18# warranties of performance, merchantability or fitness for any particular
19# purpose.
20#
21# Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25
26The NCBI SRA ( Sequence Read Archive ) SDK ( Software Development Kit )
27
28
29Contact: sra-tools@ncbi.nlm.nih.gov
30http://trace.ncbi.nlm.nih.gov/Traces/sra/std
31
32
33This version of the NCBI SRA SDK generates loading and dumping tools with
34their respective libraries for building new and accessing existing runs.
35It may be built with GCC, ICC or Microsoft VC++.
36
37
38REQUIREMENTS:
39
40This software release was designed to run under Linux, MacOSX and Windows
41operating systems on Intel x86-compatible 32 and 64 bit architectures.
42
43 ar # tested with version 2.15.90
44 bash # certain scripts require bash
45 make # GNU make version 3.80 or later
46 gcc, g++ # tested with 4.1.2, but should work with others
47 libz # version 1
48 libbz2 # version 1
49 libxml2 # tested with version 2.6.7 [Linux and Mac only]
50
51If your system does NOT have libz or libbz2, or if the build fails due to
52missing one of the expected libraries, try running "make all" which will
53attempt to download the sources to libz and libbz2 and build them.
54
55OPTIONS:
56
57Specific versions of ICC are supported as an alternate compiler.
58
59 icc, icpc # tested with 11.0 (64-bit) and 10.1 (32-bit)
60 # 32-bit 11.0 does not work
61
62WINDOWS BUILD:
63
64The Windows build uses the same makefiles as Linux and Mac, and has been tested
65under Cygwin. You need to execute Cygwin AFTER sourcing the Microsoft batch file
66from Visual Studio.
67
68
69CONTENTS:
70
71 CHANGES # describes changes at pertinent levels
72 Makefile # drives configuration and sub-target builds
73 README
74 README-WINDOWS.txt
75 USAGE
76 build # holds special makefiles and configuration
77 interfaces # contains module interfaces, schema, plus
78 compiler and platform specific includes
79 libs # sdk library code
80 tools # toolkit code
81 test # testing code
82
83
84CONFIGURATION:
85
86There are three configurable parameters:
87 1) BUILD = 'debug', 'release' etc.
88 2) COMP = 'GCC' etc.
89 3) OUTDIR = <path-to-binaries-libs-objfiles>
90
91The target architecture is chosen to match your build host. At this
92time, only the Macintosh build will support cross-compilation. In the
93instructions below, x86_64 is the assumed architecture. If your host
94is i386 (32-bit), then you would substitute 32 for paths that contain
9564.
96
97
98BUILD INSTRUCTIONS:
99
100## create output directories and symlinks for first time
101
102 $ OUTDIR=<path-to-output>
103 $ make OUTDIR="$OUTDIR" out
104
105The path in OUTDIR MUST be a full path - relative paths may fail.
106
107## decide upon STATIC or DYNAMIC builds
108# VDB.2 was designed to make use of dynamic libraries, but
109# in many environments static builds are more convenient or may even be
110# required, due to installation restrictions.
111#
112# THE BUILD DOES NOT CURRENTLY SUPPORT PARALLEL DYNAMIC AND STATIC MODES
113# if you switch between them, you should perform a "make clean" first.
114
115 $ make static
116-OR_
117 $ make dynamic
118
119## if you are using a dynamic build, update LD_LIBRARY_PATH - probably want to put
120# in shell startup ( ensure that libz, libbz2 and libxml2 can be found in your path )
121
122 $ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OUTDIR/lib64"
123
124## the build uses "TOP" as an internal variable
125# if you have it defined in your shell environment, unset it before making
126
127## build the libraries and binaries
128
129 $ make GCC debug # optionally set compiler and/or build
130 $ make # builds libraries and binary executables
131
132The standard make will cause default libraries and tools to be built. Binary
133executables and both shared and static libraries can be found in their
134respective output directories.
135
136If the build fails due to not finding libz or libbz2, try:
137
138 $ make all # see note above on libraries
139
140
141STATIC BUILD RESULTS:
142
143<OUTDIR>/bin64/ # (bin32 for 32-bit builds)
144 abi-dump # dump to ABI-native format
145 abi-load # load from ABI-native format
146 align-info # retrieve information from cSRA object
147 fastq-dump # dump to FASTQ format
148 fastq-load # load from FASTQ format
149 helicos-load # load from Helicos native format
150 illumina-dump # dump to Illumina-native format
151 illumina-load # load from Illumina-native format
152 kar # single file archive utility
153 kdbmeta # access db, table or column metadata
154 rcexplain # return code display utility
155 sam-dump # dump to SAM format from cSRA
156 sff-dump # dumps 454 runs in SFF format
157 sff-load # load from SFF format
158 sra-dbcc # consistency checker
159 sra-kar # sra-specific kar tool
160 sra-stat # gather run statistics and print to stdout
161 srf-load # load from SRF format
162 vdb-copy # tool to copy tables
163 vdb-dump # dump rows in a textual format
164 vdb-lock # locks an object against modification
165 vdb-unlock # unlocks an object
166
167<OUTDIR>/bin64/ncbi # (bin32 for 32-bit builds)
168 config.kfg # simple text file for configuring file system
169
170<OUTDIR>/lib64/ # (lib32 for 32-bit builds)
171 libkdb # static physical layer reading library
172 libkfg # static configuration library
173 libkfs # static file system library
174 libklib # static support library
175 libkproc # static process synchronization library
176 libkq # static cross-thread queue library
177 libksproc # static single-threaded emulation library
178 libksrch # static search algorithm library
179 libkxfs # static XML to filesystem library
180 libkxml # static XML container support library
181 libload # static loader tool utility library
182 libsradb # static API for accessing sra
183 libsrareader # static reader library
184 libsraschema # static version of SRA schema
185 libvdb # static virtual layer reading library
186 libwkdb # static physical layer update library
187 libwsradb # static update API for SRA
188 libwvdb # static virtual layer update library
189
190<OUTDIR>/mod64/ # (mod32 for 32-bit builds)
191 -- empty --
192
193<OUTDIR>/wmod64/ # (wmod32 for 32-bit builds)
194 -- empty --
195
196
197
198DYNAMIC BUILD RESULTS:
199
200<OUTDIR>/bin64/ # (bin32 for 32-bit builds)
201 -- same as static --
202
203<OUTDIR>/bin64/ncbi # (bin32 for 32-bit builds)
204 -- empty --
205
206<OUTDIR>/lib64/ # (lib32 for 32-bit builds)
207 libkdb # physical layer reading library
208 libkfg # configuration library
209 libkfs # file system library
210 libklib # support library
211 libkproc # process synchronization library
212 libkq # cross-thread queue library
213 libksproc # single-threaded emulation library
214 libksrch # search algorithm library
215 libkxfs # XML to filesystem library
216 libkxml # XML container support library
217 libload # loader tool utility library
218 libsra-schema # weak-linked sra schema
219 libsradb # API for accessing sra
220 libsrapath # weak-link stubs for srapath
221 libsrareader # reader library
222 libvdb # virtual layer reading library
223 libwkdb # physical layer update library
224 libwsradb # update API for SRA
225 libwvdb # virtual layer update library
226
227<OUTDIR>/lib64/ncbi # (lib32 for 32-bit builds)
228 config.kfg # simple text file for configuring file system
229
230<OUTDIR>/mod64/ # (mod32 for 32-bit builds)
231 libaxf # cSRA-specific VDB external functions
232 libsraxf # sra-specific VDB external functions
233 libvxf # generic VDB external functions
234
235<OUTDIR>/wmod64/ # (wmod32 for 32-bit builds)
236 libwsraxf # sra-specific VDB external functions for update
237 libwvxf # update VDB external functions
2380
=== added file 'README-build.txt'
--- README-build.txt 1970-01-01 00:00:00 +0000
+++ README-build.txt 2014-04-08 01:47:44 +0000
@@ -0,0 +1,259 @@
1# ===========================================================================
2#
3# PUBLIC DOMAIN NOTICE
4# National Center for Biotechnology Information
5#
6# This software/database is a "United States Government Work" under the
7# terms of the United States Copyright Act. It was written as part of
8# the author's official duties as a United States Government employee and
9# thus cannot be copyrighted. This software/database is freely available
10# to the public for use. The National Library of Medicine and the U.S.
11# Government have not placed any restriction on its use or reproduction.
12#
13# Although all reasonable efforts have been taken to ensure the accuracy
14# and reliability of the software and data, the NLM and the U.S.
15# Government do not and cannot warrant the performance or results that
16# may be obtained by using this software or data. The NLM and the U.S.
17# Government disclaim all warranties, express or implied, including
18# warranties of performance, merchantability or fitness for any particular
19# purpose.
20#
21# Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25
26The NCBI SRA ( Sequence Read Archive ) SDK ( Software Development Kit )
27
28
29Contact: sra-tools@ncbi.nlm.nih.gov
30http://trace.ncbi.nlm.nih.gov/Traces/sra/std
31
32
33This version of the NCBI SRA SDK generates tools with their respective libraries
34for building new and accessing existing runs. It may be built with GCC.
35
36
37REQUIREMENTS:
38
39This software release was designed to run under Linux, MacOSX and Windows
40operating systems on Intel x86-compatible 32 and 64 bit architectures.
41
42 ar # tested with version 2.22
43 bash # certain scripts require bash
44 make # GNU make version 3.81 or later
45 gcc, g++ # tested with 4.4.2, but should work with others
46 libxml2 # tested with version 2.7.6
47 libcurl # tested with version 7.27
48
49WINDOWS BUILD:
50
51The Windows build uses the same make files as Linux and Mac, and has been tested
52under Cygwin. You need to execute Cygwin AFTER sourcing the Microsoft batch file
53from Visual Studio.
54
55
56CONTENTS:
57
58 Makefile # drives configuration and sub-target builds
59 README
60 README-WINDOWS.txt
61 build # holds special makefiles and configuration
62 interfaces # contains module interfaces, schema, plus
63 compiler and platform specific includes
64 libs # sdk library code
65 tools # toolkit code
66
67
68CONFIGURATION:
69
70There are three configurable parameters:
71 1) BUILD = 'debug', 'release' etc.
72 2) COMP = 'GCC' etc.
73 3) OUTDIR = <path-to-binaries-libs-objfiles>
74
75The target architecture is chosen to match your build host. At this
76time, only the Macintosh build will support cross-compilation. In the
77instructions below, x86_64 is the assumed architecture. If your host
78is i386 (32-bit), then you would substitute 32 for paths that contain
7964.
80
81Running "make help" will list more details of how your build may
82be configured:
83
84 Before initial build, run 'make OUTDIR=<dir> out' from
85 the project root to set the output directory of your builds.
86
87 To select a compiler, run 'make <comp>' where
88 comp = { GCC VC++ CLANG }.
89
90 For hosts that support cross-compilation ( only Macintosh today ),
91 you can run 'make <arch>' where arch = { i386 x86_64 sparc32 sparc64 }.
92
93 To set a build configuration, run 'make <config>' where
94 config = { debug profile release static dynamic }.
95
96Running "make config" will show the current configuration, e.g.:
97
98 current build is linux static rel x86_64 build using gcc tools
99 output target directory is '$PATH_TO_OUTPUT/linux/gcc/stat/x86_64/rel'
100
101where "$PATH_TO_OUTPUT" is local to your system, of course.
102
103
104BUILD INSTRUCTIONS:
105
106## create output directories and symlinks for first time
107
108 $ OUTDIR=<path-to-output>
109 $ make OUTDIR="$OUTDIR" out
110
111The path in OUTDIR MUST be a full path - relative paths may fail.
112
113## decide upon STATIC or DYNAMIC builds
114# VDB.2 was designed to make use of dynamic libraries, but
115# in many environments static builds are more convenient or may even be
116# required, due to installation restrictions.
117#
118# THE BUILD DOES NOT CURRENTLY SUPPORT PARALLEL DYNAMIC AND STATIC MODES
119# if you switch between them, you should perform a "make clean" first.
120
121 $ make static
122-OR_
123 $ make dynamic
124
125## if you are using a dynamic build, update LD_LIBRARY_PATH - probably want to put
126# in shell startup ( ensure that libz, libbz2 and libxml2 can be found in your path )
127
128 $ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$OUTDIR/lib64"
129
130## the build uses "TOP" as an internal variable
131# if you have it defined in your shell environment, unset it before making
132
133## build the libraries and binaries
134
135 $ make GCC debug # optionally set compiler and/or build
136 $ make # builds libraries and binary executables
137
138The standard make will cause default libraries and tools to be built. Binary
139executables and both shared and static libraries can be found in their
140respective output directories.
141
142
143STATIC BUILD RESULTS:
144
145<OUTDIR>/bin64/ # (bin32 for 32-bit builds)
146 abi-dump # dump to ABI-native format
147 abi-load # load from ABI-native format
148 align-info # retrieve information from SRA alignment object (cSRA)
149 bam-load # load from BAM format into SRA (cSRA)
150 cg-load # load from Complete Genomics native format
151 fastq-dump # dump to FASTQ format
152 fastq-load # load from FASTQ format
153 helicos-load # load from Helicos native format
154 illumina-dump # dump to Illumina-native format
155 illumina-load # load from Illumina-native format
156 kar # single file archive utility
157 kdbmeta # access db, table or column metadata
158 latf-load # generic FASTQ loader
159 prefetch # tool to download runs from NCBI by accession
160 rcexplain # return code display utility
161 sam-dump # dump to SAM format from cSRA
162 sff-dump # dumps 454 runs in SFF format
163 sff-load # load from SFF format
164 sra-kar # sra-specific kar tool
165 sra-pileup # produces SAM-style pileup information from SRA (cSRA)
166 sra-sort # canonically orders SRA (cSRA) data for improved access
167 sra-stat # gather run statistics and print to stdout
168 srapath # returns the full location of an object by accession
169 srf-load # load from SRF format
170 test-sra # test user's environment for configuration and libraries
171 vdb-config # display and/or modify user configuration
172 vdb-copy # tool to copy tables
173 vdb-decrypt # tool to decrypt files from dbGap
174 vdb-dump # dump rows in a textual format
175 vdb-encrypt # to to (re)encrypt files using dbGap encryption key
176 vdb-lock # locks an object against modification
177 vdb-unlock # unlocks an object
178
179<OUTDIR>/lib64/ # (lib32 for 32-bit builds)
180 libalign-access # BAM format reading API
181 libalign-reader # SRA (cSRA) alignment reading API
182 libbz2 # bzip2 library
183 libkdb # physical layer reading library
184 libkfg # configuration library
185 libkfs # physical file system library
186 libklib # support library
187 libkproc # process synchronization library
188 libkq # cross-thread queue library
189 libkrypto # cryptographic library
190 libsproc # single-threaded stub library
191 libksrch # search algorithm library
192 libkurl # interface to libcurl
193 libkxfs # XML to filesystem library
194 libkxml # XML container support library
195 libload # loader tool utility library
196 libsradb # API for accessing sra
197 libsrareader # reader library
198 libsraschema # version of SRA schema for reading
199 libvdb # virtual layer reading library
200 libvfs # virtual file system library
201 libwkdb # physical layer update library
202 libwsradb # update API for SRA
203 libwsraschema # version of SRA schema for update
204 libwvdb # virtual layer update library
205 libz # gzip library
206
207<OUTDIR>/mod64/ # (mod32 for 32-bit builds)
208 -- empty --
209
210<OUTDIR>/wmod64/ # (wmod32 for 32-bit builds)
211 -- empty --
212
213
214
215DYNAMIC BUILD RESULTS:
216
217<OUTDIR>/bin64/ # (bin32 for 32-bit builds)
218 -- same as static --
219
220<OUTDIR>/lib64/ # (lib32 for 32-bit builds)
221 libalign-access # BAM format reading API
222 libalign-reader # SRA (cSRA) alignment reading API
223 libbz2 # static bzip2 library
224 libkdb # physical layer reading library
225 libkfg # configuration library
226 libkfs # physical file system library
227 libklib # support library
228 libkproc # process synchronization library
229 libkq # cross-thread queue library
230 libkrypto # cryptographic library
231 libsproc # single-threaded stub library
232 libksrch # search algorithm library
233 libkurl # interface to libcurl
234 libkxfs # XML to filesystem library
235 libkxml # XML container support library
236 libload # loader tool utility library
237 libsradb # API for accessing sra
238 libsrareader # reader library
239 libsraschema # static version of SRA schema for reading
240 libvdb # virtual layer reading library
241 libvfs # virtual file system library
242 libwkdb # physical layer update library
243 libwsradb # update API for SRA
244 libwsraschema # static version of SRA schema for update
245 libwvdb # virtual layer update library
246 libz # static gzip library
247
248<OUTDIR>/mod64/ # (mod32 for 32-bit builds)
249 libaxf # cSRA-specific VDB external functions
250 libsraxf # SRA-specific VDB external functions
251 libvxf # generic VDB external functions
252 libwgsxf # WGS-specific VDB external functions
253
254<OUTDIR>/wmod64/ # (wmod32 for 32-bit builds)
255 libwaxf # cSRA-specific VDB external functions for update
256 libwsraxf # SRA-specific VDB external functions for update
257 libwvxf # update VDB external functions
258 libwwgsxf # WGS-specific VDB external functions for update
259
0260
=== added file 'README-config.txt'
--- README-config.txt 1970-01-01 00:00:00 +0000
+++ README-config.txt 2014-04-08 01:47:44 +0000
@@ -0,0 +1,58 @@
1# ===========================================================================
2#
3# PUBLIC DOMAIN NOTICE
4# National Center for Biotechnology Information
5#
6# This software/database is a "United States Government Work" under the
7# terms of the United States Copyright Act. It was written as part of
8# the author's official duties as a United States Government employee and
9# thus cannot be copyrighted. This software/database is freely available
10# to the public for use. The National Library of Medicine and the U.S.
11# Government have not placed any restriction on its use or reproduction.
12#
13# Although all reasonable efforts have been taken to ensure the accuracy
14# and reliability of the software and data, the NLM and the U.S.
15# Government do not and cannot warrant the performance or results that
16# may be obtained by using this software or data. The NLM and the U.S.
17# Government disclaim all warranties, express or implied, including
18# warranties of performance, merchantability or fitness for any particular
19# purpose.
20#
21# Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25
26The NCBI SRA ( Sequence Read Archive )
27
28
29Contact: sra-tools@ncbi.nlm.nih.gov
30http://trace.ncbi.nlm.nih.gov/Traces/sra/std
31
32About configuration-assistant:
33
34 configuration-assistant.perl will help you to configure the SRA tools to be able
35 to access the local reference repository and to download the correct references
36 for a given cSRA file.
37
38To run configuration-assistant on Linux or Mac:
39 - open a shell
40 - change directory to the folder where you extracted the toolkit (cd .../sratoolkit...),
41 - type 'perl configuration-assistant.perl' (without the quotation marks).
42
43
44To run configuration-assistant on Windows:
45
46 - open Command Prompt (Start->Run->cmd.exe),
47 - change directory to the folder where you extracted the toolkit (cd ...\sratoolkit.x.x.x-win64),
48 - type 'perl configuration-assistant.perl' (without the quotation marks).
49
50
51If the following message shows up:
52
53 "'perl' is not recognized as an internal or external command,
54 operable program or batch file."
55
56that means perl is not installed or not installed properly.
57
58Download Perl at ActiveState.com (http://www.activestate.com/activeperl/downloads)
059
=== removed file 'USAGE'
--- USAGE 2012-01-10 09:06:14 +0000
+++ USAGE 1970-01-01 00:00:00 +0000
@@ -1,162 +0,0 @@
1# ===========================================================================
2#
3# PUBLIC DOMAIN NOTICE
4# National Center for Biotechnology Information
5#
6# This software/database is a "United States Government Work" under the
7# terms of the United States Copyright Act. It was written as part of
8# the author's official duties as a United States Government employee and
9# thus cannot be copyrighted. This software/database is freely available
10# to the public for use. The National Library of Medicine and the U.S.
11# Government have not placed any restriction on its use or reproduction.
12#
13# Although all reasonable efforts have been taken to ensure the accuracy
14# and reliability of the software and data, the NLM and the U.S.
15# Government do not and cannot warrant the performance or results that
16# may be obtained by using this software or data. The NLM and the U.S.
17# Government disclaim all warranties, express or implied, including
18# warranties of performance, merchantability or fitness for any particular
19# purpose.
20#
21# Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25
26The NCBI SRA ( Sequence Read Archive ) Toolkit
27
28
29Contact: sra-tools@ncbi.nlm.nih.gov
30http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?view=software
31
32
33For preliminary documentation on tool usage, consult the files within
34the "help" directory.
35
36
37CHANGES:
38
39SRA Toolkit includes new features in sam-dump tool and vdb-dump tools.
40
41Sam-dump now supports slicing across multiple sequences, and dumping cSRA files to fasta and fastq formats. In addition, sam-dump has three new parameters
42-=|--hide-identical Output '=' if base is identical to reference
43--gzip Compress output using gzip
44--bzip2 Compress output using bzip2
45
46vdb-dump has two new parameters
47-o|--column_enum_short enumerates columns in short form
48-b|--boolean defines how boolean's are printed (1,T)
49
50We have combined the functionality of two scripts, config-assistant.perl and reference-assistant.perl into a single script, configuration-assistant.perl that helps users download the correct references for a given cSRA file and configure the user environment for the SRA Toolkit.
51
52DESCRIPTION:
53
54 This release includes tools for reading the SRA archive, generally
55 by converting individual runs into some commonly used format such as
56 fastq. Support for NCBI's Compression by Reference is also included.
57
58 "Linux" binaries have been created on CentOS and SuSE Linux
59 distributions. They are not guaranteed to work on other
60 distributions. In particular, the version of libc.so should be
61 compatible. They are specific to the x86-family architectures.
62
63 "Windows" binaries have been created using MSVC's (not Cygwin)
64 tools. This release includes Win32 binaries. The "*-load" tools
65 are not released for "Windows".
66
67 "Mac OS X" binaries are available for the x86-family
68 architectures. They will NOT run on PPC Macs. The 64-bit binaries
69 will run only on OS 10.6. The 32-bit binaries should run on either
70 10.5 or later.
71
72
73CONTENTS:
74
75 "abi-dump" - dump ABI color-space runs into their native format
76 "abi-load" - load ABI color-space runs
77 "fastq-dump" - dump any run of any platform in FASTQ format
78 "fastq-load" - load FASTQ runs
79 "helicos-load" - load HELICOS runs
80 "illumina-dump" - dump Illumina runs into their native format
81 "illumina-load" - load Illumina native runs
82 "kar" - an archive extraction tool for .sra files
83 "kdbmeta" - display the contents of one or more metadata stores
84 "rcexplain" - print out error string for return codes (RC)
85 "refseq-load" - ( NEW for Linux and Mac ) download a reference
86 sequence object
87 "sff-dump" - dump 454 runs into SFF format
88 "sff-load" - load 454 SFF runs
89 "sra-dbcc" - check SRA runs
90 "sra-dump" - dump any run in a textual format [see note below]
91 "sra-kar" - creates a single file archive from an SRA run
92 "sra-stat" - display run column statistics
93 "srf-load" - load SRF runs
94 "sam-dump" - dump a cSRA into the SAM-format
95 "vdb-copy" - copy SRA objects
96 "vdb-dump" - display SRA objects in a textual format [see note below]
97 "vdb-lock" - lock an object against modification
98 "vdb-unlock" - unlock an object
99 "align-info" - displays which references a csra-archive uses
100 "vdb-config" - displays the configuration
101
102
103NOTES:
104
105 The "sam-dump" tool only works on cSRA's. ( See README-csra )
106 The textual dumpers "sra-dump" and "vdb-dump" are provided in this
107 release as an aid in visual inspection. It is likely that their
108 actual output formatting will be changed in the near future to a
109 stricter, more formalized representation[s].
110
111 The "help" information will be improved in near future releases, and
112 the tool options will become standardized across the set. We will
113 also be providing documentation on our web site.
114
115 Tool options may change in the next release. Version 1 tool options
116 will remain supported wherever possible in order to preserve
117 operation of any existing scripts.
118
119
120CAVEATS:
121
122 SRA tools are designed to handle very large amounts of data, and are
123 not currently oriented toward desktop use. They work well within any
124 Unix-like environment, such as Linux or MacOS's BSD shell.
125
126 Windows operation presents a few challenges. We have tested our
127 binaries under the MS "cmd.exe" shell and Cygwin's bash. Our tools
128 know how to accept paths in Windows, Cygwin, POSIX and MinGW
129 formats. Internally, all paths are treated as MinGW-style POSIX
130 paths, so any information appearing in output will reflect this
131 conversion:
132
133 # simple file names
134 SRR012345.sra => [NO CHANGE]
135
136 # relative paths
137 win\SRR012345.sra => win/SRR012345.sra
138
139 # full or drive-relative paths
140 C:\sra\win\SRR012345.sra => /C/sra/win/SRR012345.sra
141
142 # network paths
143 \\server\sra\SRR012345.sra => //server/sra/SRR012345.sra
144
145 # POSIX paths
146 /sra/posix/SRR012345.sra => [NO CHANGE]
147
148 # Cygwin full paths
149 /cygdrive/C/sra/SRR012345.sra => /C/sra/SRR012345.sra
150
151 There are some situations where the software may behave unexpectedly
152 due to path conversions. In particular, since Windows does not
153 conform to POSIX path conventions, there may be difficulties
154 combining network paths with non-network paths, explicitly or
155 implicitly. IF YOU HAVE PROBLEMS, we recommend mounting file servers
156 as network drives.
157
158 If you run the software under Cygwin, you should take care to use
159 either relative paths (those that do not begin with '/') or full
160 paths that start with "/cygdrive/". The reason is that Cygwin
161 provides its own path manipulation, but our tools are not aware of
162 which shell they are running under.
1630
=== modified file 'build/BUILD.linux'
--- build/BUILD.linux 2012-01-10 09:06:14 +0000
+++ build/BUILD.linux 2014-04-08 01:47:44 +0000
@@ -1,1 +1,1 @@
1pub1rel
22
=== modified file 'build/BUILD.mac'
--- build/BUILD.mac 2012-01-10 09:06:14 +0000
+++ build/BUILD.mac 2014-04-08 01:47:44 +0000
@@ -1,1 +1,1 @@
1pub1rel
22
=== modified file 'build/BUILD.win'
--- build/BUILD.win 2012-01-10 09:06:14 +0000
+++ build/BUILD.win 2014-04-08 01:47:44 +0000
@@ -1,1 +1,1 @@
1pub1rel
22
=== added file 'build/LNKG.linux'
--- build/LNKG.linux 1970-01-01 00:00:00 +0000
+++ build/LNKG.linux 2014-04-08 01:47:44 +0000
@@ -0,0 +1,1 @@
1stat
02
=== added file 'build/LNKG.mac'
--- build/LNKG.mac 1970-01-01 00:00:00 +0000
+++ build/LNKG.mac 2014-04-08 01:47:44 +0000
@@ -0,0 +1,1 @@
1stat
02
=== added file 'build/LNKG.win'
--- build/LNKG.win 1970-01-01 00:00:00 +0000
+++ build/LNKG.win 2014-04-08 01:47:44 +0000
@@ -0,0 +1,1 @@
1stat
02
=== added file 'build/Makefile.clang'
--- build/Makefile.clang 1970-01-01 00:00:00 +0000
+++ build/Makefile.clang 2014-04-08 01:47:44 +0000
@@ -0,0 +1,80 @@
1# ===========================================================================
2#
3# PUBLIC DOMAIN NOTICE
4# National Center for Biotechnology Information
5#
6# This software/database is a "United States Government Work" under the
7# terms of the United States Copyright Act. It was written as part of
8# the author's official duties as a United States Government employee and
9# thus cannot be copyrighted. This software/database is freely available
10# to the public for use. The National Library of Medicine and the U.S.
11# Government have not placed any restriction on its use or reproduction.
12#
13# Although all reasonable efforts have been taken to ensure the accuracy
14# and reliability of the software and data, the NLM and the U.S.
15# Government do not and cannot warrant the performance or results that
16# may be obtained by using this software or data. The NLM and the U.S.
17# Government disclaim all warranties, express or implied, including
18# warranties of performance, merchantability or fitness for any particular
19# purpose.
20#
21# Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25
26# compilers
27CC = @ $(TOP)/build/cc.sh $(OS) 'clang -c' \
28 $(CHECKSUM) --objx $(OBJX) --cflags "$(CFLAGS)" -MD
29CP = @ $(TOP)/build/cc.sh $(OS) 'clang -xc++ -c' \
30 $(CHECKSUM) --objx $(OBJX) --cflags "$(CPFLAGS)" -MD
31
32# C preprocessor
33PP = gcc -E $(CFLAGS)
34
35# linkers
36LD = @ $(TOP)/build/ld.sh $(OS) $(ARCH) gcc \
37 --build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
38 $(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
39 -MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
40
41LP = @ $(TOP)/build/ld.sh $(OS) $(ARCH) g++ \
42 --build $(BUILD) --ldflags "$(LDFLAGS)" $(STATIC) \
43 $(STATICSYSLIBS) $(CHECKSUM) --objx $(OBJX) --shlx $(SHLX) --libx $(LIBX) \
44 -MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
45
46# tool options
47WARN = -Wall -Wno-variadic-macros -Wno-long-long # -Wconversion
48ifeq (linux,$(OS))
49 NO_ARRAY_BOUNDS_WARNING = -Wno-array-bounds
50endif
51
52ifeq (64,$(BITS))
53 CARCH = -m64
54else
55 CARCH = -m32
56endif
57
58ifeq (prof, $(BUILD))
59 PROF = -pg
60endif
61
62ifeq (dbg, $(BUILD))
63 DBG = -g
64 OPT = $(WARN)
65 NOPT = $(WARN)
66 # GCC seems unable to use c99 without ansi, which
67 # basically clobbers features back to c89. the options
68 # must be specified in the order shown.
69 PED = -std=c99 -ansi -pedantic # -fdiagnostics-show-option
70else
71
72ifeq (x86_64, $(ARCH))
73 OPT = -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing
74else
75 OPT = -O3 -Wno-variadic-macros -fno-strict-aliasing
76endif
77endif
78
79# clang is designed to be a GCC substitute
80COMP_DAD = gcc
081
=== modified file 'build/Makefile.env'
--- build/Makefile.env 2012-01-10 09:06:14 +0000
+++ build/Makefile.env 2014-04-08 01:47:44 +0000
@@ -37,8 +37,9 @@
37# normally build static intermediate libs37# normally build static intermediate libs
38ILIBEXT = $(LIBX)38ILIBEXT = $(LIBX)
3939
40# only build dynamic library modules40# would normally only build dynamic library modules,
41MODEXT = $(SHLX)41# but some tools are expecting to be able to static link
42MODEXT = $(LIBX) $(SHLX)
4243
43# determine BUILD44# determine BUILD
44ifeq (,$(BUILD))45ifeq (,$(BUILD))
@@ -59,27 +60,24 @@
59endif60endif
60ifeq (prof,$(BUILD))61ifeq (prof,$(BUILD))
61 DEBUG := -DNDEBUG -D_PROFILING62 DEBUG := -DNDEBUG -D_PROFILING
62 STATIC = --static63endif
63endif
64ifeq (pub,$(BUILD))
65 DEBUG := -DNDEBUG
66 BUILDTYPE = rel
67 STATIC = --static
68 STATICSYSLIBS := --static-system-libs
69endif
70
7164
72# allow for an all-static build65# allow for an all-static build
73ifndef STATIC66ifeq (stat,$(LNKG))
74 STATIC = $(shell test -f $(TOP)/build/STATIC && echo "--static")67 STATIC = --static
75endif
76ifeq (--static,$(STATIC))
77 LINKAGE := -D_STATIC68 LINKAGE := -D_STATIC
78 LIBEXT = $(LIBX)69 LIBEXT = $(LIBX)
79 ILIBEXT = $(LIBX)70 ILIBEXT = $(LIBX)
80 MODEXT = $(LIBX)71 MODEXT = $(LIBX)
72 STAT_OR_DYN = static
73 STATICSYSLIBS := --static-system-libs
74
75else
76 STAT_OR_DYN = dynamic
81endif77endif
8278
79LOCAL_OR_REMOTE = local
80
8381
84# drop all suffix rules82# drop all suffix rules
85.SUFFIXES:83.SUFFIXES:
@@ -89,9 +87,22 @@
89include $(TOP)/build/Makefile.$(COMP)87include $(TOP)/build/Makefile.$(COMP)
90include $(TOP)/build/Makefile.rules88include $(TOP)/build/Makefile.rules
9189
90# external schema modules
91EXT_SCHEMA_MODULES = axf sraxf wgsxf vxf
92READONLY_SCHEMA_LIBS = $(addprefix -d,$(EXT_SCHEMA_MODULES))
93UPDATE_SCHEMA_LIBS = $(addprefix -dw,$(EXT_SCHEMA_MODULES))
94ALWAYS_STATIC_SCHEMA_LIBS = $(addprefix -s,$(EXT_SCHEMA_MODULES))
95
92# full directory paths96# full directory paths
93TARGDIR = $(OUTDIR)/$(OSFLAV)/$(BUILD)/$(COMP)/$(ARCH)97OLD_TARGDIR = $(OUTDIR)/$(OSFLAV)/$(BUILD)/$(TOOLSET)/$(ARCH)
98TARGDIR = $(OUTDIR)/$(OSFLAV)/$(TOOLSET)/$(LNKG)/$(ARCH)/$(BUILD)
94BINDIR = $(TARGDIR)/bin99BINDIR = $(TARGDIR)/bin
100ifeq (win,$(OS))
101 # on Windows, place test executables next to .dlls
102 TEST_BINDIR = $(BINDIR)
103else
104 TEST_BINDIR = $(TARGDIR)/test-bin
105endif
95ILIBDIR = $(TARGDIR)/ilib106ILIBDIR = $(TARGDIR)/ilib
96LIBDIR = $(TARGDIR)/lib107LIBDIR = $(TARGDIR)/lib
97MODDIR = $(TARGDIR)/mod108MODDIR = $(TARGDIR)/mod
@@ -116,22 +127,22 @@
116endif127endif
117128
118# make reissue command129# make reissue command
119MAKE_CMD = $(MAKE) BUILD=$(BUILD) COMP=$(COMP) TOP=$(TOP) \130MAKE_CMD = $(MAKE) BUILD=$(BUILD) TOOLSET=$(TOOLSET) COMP=$(COMP) LNKG=$(LNKG) \
120 SRCDIR=$(SRCDIR) OUTDIR=$(OUTDIR) -C $(OBJDIR) -f $(SRCDIR)/Makefile131 TOP=$(TOP) SRCDIR=$(SRCDIR) OUTDIR=$(OUTDIR) -C $(OBJDIR) -f $(SRCDIR)/Makefile
121132
122# directory and link creation133# directory and link creation
123SUBDIRS = bin ilib lib mod wmod134SUBDIRS = bin test-bin ilib lib
124OUTDIRS = schema135OUTDIRS = schema
125136
126# clean rules137# clean rules
127stdclean:138stdclean:
128 @ rm -rf $(OBJDIR)139 @ -rm -rf $(OBJDIR)
129 @ rm -f $(addsuffix .vers.h,$(ALL_TOOLS) $(ALL_LIBS)) \140 @ rm -rf $(addsuffix .*,$(addprefix $(ILIBDIR)/,$(ALL_LIBS))) \
130 $(addsuffix .*,$(addprefix $(ILIBDIR)/,$(ALL_LIBS))) \
131 $(addsuffix .*,$(addprefix $(LIBDIR)/,$(ALL_LIBS))) \141 $(addsuffix .*,$(addprefix $(LIBDIR)/,$(ALL_LIBS))) \
132 $(addsuffix .*,$(addprefix $(MODDIR)/,$(ALL_LIBS))) \142 $(addsuffix .*,$(addprefix $(MODDIR)/,$(ALL_LIBS))) \
133 $(addsuffix .*,$(addprefix $(WMODDIR)/,$(ALL_LIBS))) \143 $(addsuffix .*,$(addprefix $(WMODDIR)/,$(ALL_LIBS))) \
134 $(addsuffix *,$(addprefix $(BINDIR)/,$(ALL_TOOLS) $(ALL_LIBS)))144 $(addsuffix *,$(addprefix $(BINDIR)/,$(ALL_TOOLS) $(ALL_LIBS))) \
145 $(addsuffix *,$(addprefix $(TEST_BINDIR)/,$(ALL_TOOLS) $(TEST_TOOLS)))
135146
136# removing symbolic links that point to specific builds147# removing symbolic links that point to specific builds
137removelinks:148removelinks:
@@ -143,6 +154,10 @@
143makedirs:154makedirs:
144 @ mkdir -p $(addprefix $(TARGDIR)/,$(SUBDIRS) obj/$(MODULE)) $(NCBIDIR)155 @ mkdir -p $(addprefix $(TARGDIR)/,$(SUBDIRS) obj/$(MODULE)) $(NCBIDIR)
145156
157# build version include files
158vers-includes: makedirs
159 @ $(MAKE_CMD) -s $(TARGDIR)/$@
160
146ifeq (win,$(OS))161ifeq (win,$(OS))
147162
148# Windows doesn't really support symbolic links163# Windows doesn't really support symbolic links
@@ -155,66 +170,79 @@
155$(LNDIRS):170$(LNDIRS):
156 @ ln -s $(TARGDIR)/$(subst ln_,,$@) $(OUTDIR)/$(subst ln_,,$@)$(BITS)171 @ ln -s $(TARGDIR)/$(subst ln_,,$@) $(OUTDIR)/$(subst ln_,,$@)$(BITS)
157172
173ifdef NOREBUILD_LINKS
174rebuild-dirlinks:
175 @ true
176else
158rebuild-dirlinks: removelinks makedirs $(LNDIRS)177rebuild-dirlinks: removelinks makedirs $(LNDIRS)
159 @ ln -s $(TOP)/interfaces $(OUTDIR)/schema178 @ ln -s $(TOP)/interfaces $(OUTDIR)/schema
160179endif
161endif180
162181endif
163.PHONY: stdclean removelinks makedirs rebuild-dirlinks182
183.PHONY: stdclean removelinks makedirs vers-includes rebuild-dirlinks
164184
165# configuration targets 185# configuration targets
166out:186out:
167 echo $(OUTDIR) > $(TOP)/build/OUTDIR.$(OS)187 @ echo $(OUTDIR) > $(TOP)/build/OUTDIR.$(BUILD_OS)
168 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks188 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
169189
170CC:190CC:
171 @ echo cc > $(TOP)/build/COMP.$(OS)191 @ echo cc > $(TOP)/build/COMP.$(OS)
172 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
173192
174GCC:193GCC:
175 @ echo gcc > $(TOP)/build/COMP.$(OS)194 @ echo gcc > $(TOP)/build/COMP.$(OS)
176 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
177195
178ICC:196ICC:
179 @ echo icc > $(TOP)/build/COMP.$(OS)197 @ echo icc > $(TOP)/build/COMP.$(OS)
180 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
181198
182VC++:199VC++:
183 @ echo vc++ > $(TOP)/build/COMP.$(OS)200 @ echo vc++ > $(TOP)/build/COMP.$(OS)
184 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks201
202CLANG:
203 @ echo clang > $(TOP)/build/COMP.$(OS)
204
205static:
206 @ echo stat > $(TOP)/build/LNKG.$(OS)
207
208dynamic:
209 @ echo dyn > $(TOP)/build/LNKG.$(OS)
185210
186debug:211debug:
187 @ echo dbg > $(TOP)/build/BUILD.$(OS)212 @ echo dbg > $(TOP)/build/BUILD.$(OS)
188 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
189213
190profile:214profile: static
191 @ echo prof > $(TOP)/build/BUILD.$(OS)215 @ echo prof > $(TOP)/build/BUILD.$(OS)
192 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
193216
194release:217release:
195 @ echo rel > $(TOP)/build/BUILD.$(OS)218 @ echo rel > $(TOP)/build/BUILD.$(OS)
196 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks219
197220pubtools: release static
198scm:
199 @ echo scm > $(TOP)/build/BUILD.$(OS)
200 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
201
202pubtools:
203 @ echo pub > $(TOP)/build/BUILD.$(OS)
204 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks
205221
206bindir:222bindir:
207 @ echo "$(BINDIR)"223 @ echo "$(BINDIR)"
208224
209purify:225targdir:
210 @ echo pur > $(TOP)/build/BUILD.$(OS)226 @ echo "$(TARGDIR)"
211 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks227
212228osdir:
213purecov:229 @ echo "$(OUTDIR)/$(OSFLAV)"
214 @ echo pcov > $(TOP)/build/BUILD.$(OS)230
215 @ $(MAKE) TOP=$(TOP) -f $(TOP)/build/Makefile.env rebuild-dirlinks231compilers:
216232 @ echo "$(COMPILERS)"
217.PHONY: out CC GCC ICC debug profile release scm purify purecov233
234architectures:
235 @ echo "$(ARCHITECTURES)"
236
237architecture:
238 @ echo "$(ARCH)"
239
240config:
241 @ echo " current build is $(BUILD_OS) $(STAT_OR_DYN) $(BUILD) $(ARCH) build using $(TOOLSET) tools"
242 @ echo " output target directory is '$(TARGDIR)'"
243 @ echo
244
245.PHONY: out CC GCC ICC debug profile release bindir report_config
218246
219# includes based upon build247# includes based upon build
220ITF = $(TOP)/interfaces248ITF = $(TOP)/interfaces
@@ -264,7 +292,8 @@
264 $(addprefix -I,$(SRCDIRS_OS)) \292 $(addprefix -I,$(SRCDIRS_OS)) \
265 $(addprefix -I,$(SRCDIR) $(ITF)) \293 $(addprefix -I,$(SRCDIR) $(ITF)) \
266 $(addprefix -I,$(INCDIRS_COMP)) \294 $(addprefix -I,$(INCDIRS_COMP)) \
267 $(addprefix -I,$(INCDIRS_OS) $(XTINC))295 $(addprefix -I,$(INCDIRS_OS) $(XTINC)) \
296 -I.
268297
269298
270# defines that describe os & architecture299# defines that describe os & architecture
@@ -272,6 +301,43 @@
272ARCHDEFS = -D_ARCH_BITS=$(BITS) -DLIBPREFIX=$(LPFX) -DSHLIBEXT=$(DLLX)301ARCHDEFS = -D_ARCH_BITS=$(BITS) -DLIBPREFIX=$(LPFX) -DSHLIBEXT=$(DLLX)
273302
274# default tool parameters303# default tool parameters
275CFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(PED) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)304CFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(PED) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS) $(DEB_CFLAGS)
276CPFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)305CPFLAGS = $(DEBUG) $(DBG) $(CARCH) $(PROF) $(LINKAGE) $(DEFINES) $(ARCHDEFS) $(INCDIRS)
277LDFLAGS = $(DBG) $(PROF)306LDFLAGS = $(DBG) $(PROF) $(CARCH) $(DEB_LDFLAGS)
307
308#-------------------------------------------------------------------------------
309# runtests
310#
311# MallocScribble=1 is for catching allocation problems on Mac
312#
313ifeq ($(RUNTESTS_OVERRIDE),)
314runtests: std $(TEST_TOOLS)
315 @ echo "$0 $*"; export LD_LIBRARY_PATH=$(LIBDIR);export MallocScribble=1;\
316 for i in $(TEST_TOOLS);\
317 do\
318 echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++;\
319 echo Run $(TEST_BINDIR)/$$i;eval $(RUN_REMOTELY) $(TEST_BINDIR)/$$i;r=$$?; \
320 if [ "$$r" != "0" ] ; then exit $$r; fi; \
321 done
322
323.PHONY: runtests
324endif
325
326#-------------------------------------------------------------------------------
327# buildtests
328#
329buildtests: std $(TEST_TOOLS) $(SLOW_TEST_TOOLS)
330
331#-------------------------------------------------------------------------------
332# slowtests
333#
334slowtests: std $(SLOW_TEST_TOOLS)
335 @ echo "$0 $*"; export LD_LIBRARY_PATH=$(LIBDIR);\
336 for i in $(SLOW_TEST_TOOLS);\
337 do\
338 echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++;\
339 echo Run $(TEST_BINDIR)/$$i;eval $(TEST_BINDIR)/$$i;r=$$?; \
340 if [ "$$r" != "0" ] ; then exit $$r; fi; \
341 done
342
343.PHONY: slowtests buildtests
278344
=== modified file 'build/Makefile.gcc'
--- build/Makefile.gcc 2012-01-10 09:06:14 +0000
+++ build/Makefile.gcc 2014-04-08 01:47:44 +0000
@@ -44,7 +44,14 @@
44 -MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)44 -MD --srcdir $(SRCDIR) --bindir $(BINDIR) -L$(LIBDIR):$(ILIBDIR)
4545
46# tool options46# tool options
47WARN = -Wall # -Wconversion47WARN = -Wall -Wno-long-long
48ifneq (sun,$(OS))
49 WARN += -Wno-variadic-macros
50endif
51
52ifeq (linux,$(OS))
53 NO_ARRAY_BOUNDS_WARNING = -Wno-array-bounds
54endif
4855
49ifeq (prof, $(BUILD))56ifeq (prof, $(BUILD))
50 PROF = -pg57 PROF = -pg
@@ -54,12 +61,15 @@
54 DBG = -g61 DBG = -g
55 OPT = $(WARN)62 OPT = $(WARN)
56 NOPT = $(WARN)63 NOPT = $(WARN)
57 PED = -std=c99 -ansi -pedantic64 # GCC seems unable to use c99 without ansi, which
65 # basically clobbers features back to c89. the options
66 # must be specified in the order shown.
67 PED = -std=c99 -ansi -pedantic # -fdiagnostics-show-option
58else68else
5969
60ifeq (x86_64, $(ARCH))70ifeq (x86_64, $(ARCH))
61 OPT = -O3 -fno-strict-aliasing71 OPT = -O3 -Wall -Wno-variadic-macros -fno-strict-aliasing
62else72else
63 OPT = -O3 -fno-strict-aliasing73 OPT = -O3 -Wno-variadic-macros -fno-strict-aliasing
64endif74endif
65endif75endif
6676
=== modified file 'build/Makefile.linux'
--- build/Makefile.linux 2011-05-24 14:48:10 +0000
+++ build/Makefile.linux 2014-04-08 01:47:44 +0000
@@ -73,3 +73,10 @@
73 endif73 endif
74 DFLT_LIBXML_INCLUDES = $(NCBI)/libxml/include/libxml274 DFLT_LIBXML_INCLUDES = $(NCBI)/libxml/include/libxml2
75endif75endif
76
77# flex+bison
78LEX = @ true
79YACC = @ true
80
81# build matrix
82COMPILERS = GCC # ICC
7683
=== modified file 'build/Makefile.mac'
--- build/Makefile.mac 2011-05-24 14:48:10 +0000
+++ build/Makefile.mac 2014-04-08 01:47:44 +0000
@@ -68,3 +68,10 @@
68OS_GDAD = unix68OS_GDAD = unix
6969
70LIBXML_LPATH = /usr/lib70LIBXML_LPATH = /usr/lib
71
72# flex+bison: on Mac, use source-controlled generated .c/.h files
73YACC = @ true
74LEX = @ true
75
76# build matrix
77COMPILERS = GCC CLANG
7178
=== modified file 'build/Makefile.rules'
--- build/Makefile.rules 2011-05-24 14:48:10 +0000
+++ build/Makefile.rules 2014-04-08 01:47:44 +0000
@@ -99,11 +99,6 @@
99 $(CP) -S -o $@ -fPIC $(NOPT) $<99 $(CP) -S -o $@ -fPIC $(NOPT) $<
100100
101101
102######################################################################
103## TBD: *.vers.h will no longer be generated or used for executables #
104# instead, we will update the linker to produce a *.vers.o #
105# with a stub for KAppVersion to return a constant #
106######################################################################
107# version include generation102# version include generation
108%.vers.h: %.vers103%.vers.h: %.vers
109 $(TOP)/build/make-vers-inc.sh $^ > $@104 $(TOP)/build/make-vers-inc.sh $^ > $@
110105
=== modified file 'build/Makefile.shell'
--- build/Makefile.shell 2012-01-10 09:06:14 +0000
+++ build/Makefile.shell 2014-04-08 01:47:44 +0000
@@ -26,54 +26,72 @@
26# determine OS26# determine OS
27UNAME = $(shell uname -s)27UNAME = $(shell uname -s)
2828
29OS = ''29HOST_OS = ''
30ifeq (Darwin, $(UNAME))30ifeq (Darwin, $(UNAME))
31 OS = mac31 HOST_OS = mac
32endif32endif
33ifeq (Linux, $(UNAME))33ifeq (Linux, $(UNAME))
34 OS = linux34 HOST_OS = linux
35endif35endif
36ifeq (SunOS, $(UNAME))36ifeq (SunOS, $(UNAME))
37 OS = sun37 HOST_OS = sun
38 ARCHITECTURES = x86_64 i386
38endif39endif
39ifeq (xCYGWIN, $(findstring xCYGWIN,x$(UNAME)))40ifeq (xCYGWIN, $(findstring xCYGWIN,x$(UNAME)))
40 OS = win41 HOST_OS = win
41endif42endif
42ifeq (xMINGW, $(findstring xMINGW,x$(UNAME)))43ifeq (xMINGW, $(findstring xMINGW,x$(UNAME)))
43 OS = win44 HOST_OS = win
44endif45endif
45# handle all other OSes (like BSD or Hurd) as if they were linux (see bug #627861)46# handle all other OSes (like BSD or Hurd) as if they were linux (see bug #627861)
46ifeq ($(OS), '')47ifeq ($(HOST_OS), '')
47 OS = linux48 HOST_OS = linux
48endif49endif
4950
50# OS flavor is normally OS51# assume build OS is the same as host OS
51OSFLAV = $(OS)52OS = $(HOST_OS)
53BUILD_OS = $(OS)
5254
53# determine ARCH55# determine ARCH
54ARCH=''56HOST_ARCH=''
55ifeq (mac,$(OS))57ARCHITECTURES = default
56 ARCH = $(shell $(TOP)/build/mac.arch.sh)58ifeq (mac,$(HOST_OS))
59 HOST_ARCH = $(shell $(TOP)/build/mac.arch.sh)
57else60else
58 MARCH = $(shell uname -m)61 MARCH = $(shell uname -m)
5962
60 ifeq (i386, $(MARCH))63 ifeq (i386, $(MARCH))
61 ARCH = i38664 HOST_ARCH = i386
62 endif65 endif
63 ifeq (i486, $(MARCH))66 ifeq (i486, $(MARCH))
64 ARCH = i38667 HOST_ARCH = i386
65 endif68 endif
66 ifeq (i586, $(MARCH))69 ifeq (i586, $(MARCH))
67 ARCH = i38670 HOST_ARCH = i386
68 endif71 endif
69 ifeq (i686, $(MARCH))72 ifeq (i686, $(MARCH))
70 ARCH = i38673 ifeq (WOW64x, $(findstring WOW64x,$(UNAME)x))
74 # 64-bit capable Cygwin. Analyze the version of cl to set the corect architecture
75 CL = $(shell cl.exe 2>&1 >/dev/null)
76 ifeq (for x64, $(findstring for x64, $(CL)))
77 HOST_ARCH = x86_64
78 else
79 HOST_ARCH = i386
80 endif
81 else
82 HOST_ARCH = i386
83 endif
71 endif84 endif
72 ifeq (x86_64, $(MARCH))85 ifeq (x86_64, $(MARCH))
73 ARCH = x86_6486 HOST_ARCH = x86_64
74 endif87 endif
75 ifeq (sun4u,$(MARCH))88 ifeq (i86pc, $(MARCH))
76 ARCH = sparc3289 HOST_ARCH = x86_64
90 ARCHITECTURES = x86_64 i386
91 endif
92 ifeq (sun4v,$(MARCH))
93 HOST_ARCH = sparc64
94 ARCHITECTURES = sparc64 sparc32
77 endif95 endif
78endif96endif
79# Handle all other architectures equivalent as i386 (see bug #627861)97# Handle all other architectures equivalent as i386 (see bug #627861)
@@ -81,32 +99,51 @@
81 ARCH = i38699 ARCH = i386
82endif100endif
83101
84# determine BITS102ARCH = $(HOST_ARCH)
85BITS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)103REMOTE_ARCH = $(ARCH)
86104
87# first pass through defines SRCDIR105# pick up dependencies from object directory
88ifndef SRCDIR106ifdef SRCDIR
89107 include $(wildcard *.d)
90# set SRCDIR from MODULE108else
109
110# determine SRCDIR
91ifdef MODULE111ifdef MODULE
92 SRCDIR=$(TOP)/$(MODULE)112 SRCDIR=$(TOP)/$(MODULE)
93else113else
94 SRCDIR=$(TOP)114 SRCDIR=$(TOP)
95endif115endif
96116
117# set COMP, LNKG and BUILD
118COMP = $(shell test -f $(TOP)/build/COMP && mv $(TOP)/build/COMP $(TOP)/build/COMP.$(OS); test -f $(TOP)/build/COMP.$(OS) && cat $(TOP)/build/COMP.$(OS) || echo gcc)
119LNKG = $(shell test -f $(TOP)/build/STATIC && mv $(TOP)/build/STATIC $(TOP)/build/LNKG.$(OS) && echo stat > $(TOP)/build/LNKG.$(OS); test -f $(TOP)/build/LNKG.$(OS) && cat $(TOP)/build/LNKG.$(OS) || echo stat)
120BUILD = $(shell test -f $(TOP)/build/BUILD && mv $(TOP)/build/BUILD $(TOP)/build/BUILD.$(OS); test -f $(TOP)/build/BUILD.$(OS) && cat $(TOP)/build/BUILD.$(OS) || echo dbg)
121TOOLSET := $(COMP)
122
123ifdef USE_GCC_IF_ICC
124ifeq (icc,$(COMP))
125COMP = gcc
126endif
127ifeq (clang,$(COMP))
128COMP = gcc
129endif
130endif
131
132endif
133
97# set OUTDIR134# set OUTDIR
98ifndef OUTDIR135ifndef OUTDIR
99 OUTDIR = $(shell test -f $(TOP)/build/OUTDIR.$(OS) && cat $(TOP)/build/OUTDIR.$(OS) || echo $(TOP))136 OUTDIR = $(shell test -f $(TOP)/build/OUTDIR && mv $(TOP)/build/OUTDIR $(TOP)/build/OUTDIR.$(BUILD_OS); test -f $(TOP)/build/OUTDIR.$(BUILD_OS) && cat $(TOP)/build/OUTDIR.$(BUILD_OS) || echo $(TOP))
100 ifeq (,$(OUTDIR))137 ifeq (,$(OUTDIR))
101 OUTDIR = $(TOP)138 OUTDIR = $(TOP)
102 endif139 endif
103 ifeq (.,$(OUTDIR))140endif
104 OUTDIR = $(TOP)141ifeq (,$(ROUTDIR))
105 endif142 ROUTDIR = $(RHOME)
106endif143endif
107144
108# set COMP and BUILD145# OS flavor is normally OS
109COMP = $(shell test -f $(TOP)/build/COMP.$(OS) && cat $(TOP)/build/COMP.$(OS) || echo gcc)146OSFLAV = $(OS)
110BUILD = $(shell test -f $(TOP)/build/BUILD.$(OS) && cat $(TOP)/build/BUILD.$(OS) || echo dbg)147
111148# determine BITS
112endif149BITS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)
113150
=== added file 'build/Makefile.targets'
--- build/Makefile.targets 1970-01-01 00:00:00 +0000
+++ build/Makefile.targets 2014-04-08 01:47:44 +0000
@@ -0,0 +1,114 @@
1# ===========================================================================
2#
3# PUBLIC DOMAIN NOTICE
4# National Center for Biotechnology Information
5#
6# This software/database is a "United States Government Work" under the
7# terms of the United States Copyright Act. It was written as part of
8# the author's official duties as a United States Government employee and
9# thus cannot be copyrighted. This software/database is freely available
10# to the public for use. The National Library of Medicine and the U.S.
11# Government have not placed any restriction on its use or reproduction.
12#
13# Although all reasonable efforts have been taken to ensure the accuracy
14# and reliability of the software and data, the NLM and the U.S.
15# Government do not and cannot warrant the performance or results that
16# may be obtained by using this software or data. The NLM and the U.S.
17# Government disclaim all warranties, express or implied, including
18# warranties of performance, merchantability or fitness for any particular
19# purpose.
20#
21# Please cite the author in any work or product based on this material.
22#
23# ===========================================================================
24
25# defines make targets commonly used in non-leaf directories:
26# default
27# all
28# std
29# clean
30# buildtests
31# runtests
32# slowtests
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: