--- bibclean-2.11.4.orig/bibclean.h +++ bibclean-2.11.4/bibclean.h @@ -1,6 +1,6 @@ /* WARNING: Do NOT edit this file. It was created automatically - with the command "make bibclean.h" by beebe@plot79.math.utah.edu - in /u/sy/beebe/tex/bibclean/2-11-4 on Fri Feb 5 09:04:47 MST 1999 */ + with the command "make bibclean.h" by makholm@haimon + in /home/makholm/debian/cvswork/bibclean-2.11.4 on Wed Nov 9 22:43:04 CET 2005 */ "Command-line switches may be abbreviated to a unique leading\n", "prefix, and letter case is not significant. All options are parsed\n", @@ -39,15 +39,15 @@ "-init-file filename\n", " Provide an explicit value pattern initialization file.\n", " It will be processed after any system-wide and job-wide\n", - " initialization files found on the PATH (for VAX VMS,\n", - " SYS$SYSTEM) and BIBINPUTS search paths, respectively, and\n", - " may override them. It in turn may be overridden by a\n", - " subsequent file-specific initialization file. The\n", - " initialization file name can be changed at compile time,\n", - " or at run time through a setting of the environment\n", - " variable BIBCLEANINI, but defaults to .bibcleanrc on\n", - " UNIX, and to bibclean.ini elsewhere. For further\n", - " details, see the INITIALIZATION FILES manual section.\n", + " initialization files, and may override them. It in turn\n", + " may be overridden by a subsequent file-specific\n", + " initialization file. For further details, see the\n", + " INITIALIZATION FILES manual section.\n", + "\n", + "-long-field fieldname\n", + " Suppress warnings that field named fieldname have lenghts\n", + " exceeding the standard BibTeX limits. NB! This is a\n", + " Debian-specific extension!\n", "\n", "-max-width nnn\n", " bibclean normally limits output line widths to 72\n", @@ -227,13 +227,11 @@ " tables. Use this option to check newly-added patterns,\n", " or to see what patterns are being used.\n", "\n", - " When bibclean is compiled with native pattern-matching\n", - " code (the default), these patterns are the ones that will\n", - " be used in checking value strings for valid syntax, and\n", - " all of them are specified in initialization files, rather\n", - " than hard-coded into the program. For further details,\n", - " see the INITIALIZATION FILES manual section. Default:\n", - " no.\n", + " These patterns are the ones that will be used in checking\n", + " value strings for valid syntax, and all of them are\n", + " specified in initialization files, rather than hard-coded\n", + " into the program. For further details, see the\n", + " INITIALIZATION FILES manual section. Default: no.\n", "\n", "-[no-]read-init-files\n", " With the negative form, suppress loading of system-,\n", --- bibclean-2.11.4.orig/bibclean.ini +++ bibclean-2.11.4/bibclean.ini @@ -163,6 +163,9 @@ year = "\"19dd--d\"" %% "1991--2" year = "\"200d--d\"" %% "2001--2" +-long-field abstract +-long-field summary + %% This is a test of option specifications %% -init-file /dev/null %% recursive empty init file --- bibclean-2.11.4.orig/longflds.h +++ bibclean-2.11.4/longflds.h @@ -0,0 +1,5 @@ +struct long_field_struct { + struct long_field_struct *next ; + char fieldname[0]; +} ; +extern struct long_field_struct *long_fields; --- bibclean-2.11.4.orig/Makefile.in +++ bibclean-2.11.4/Makefile.in @@ -73,13 +73,13 @@ #======================================================================= #### Start of system configuration section. #### -prefix = /usr/local -exec_prefix = $(prefix) +prefix = @prefix@ +exec_prefix = @exec_prefix@ -bindir = $(exec_prefix)/bin -datadir = $(prefix)/lib +bindir = @bindir@ +datadir = @datadir@ infodir = $(prefix)/info -libdir = $(prefix)/lib +libdir = @libdir@ srcdir = @srcdir@ # This setting is specific to the developer's site, and not needed elsewhere @@ -93,7 +93,7 @@ CHARSET = @CHARSET@ CXXFLAGS = @CXXFLAGS@ $(OPT) -DEFS = @DEFS@ +DEFS = @DEFS@ -DDATADIR=\"$(datadir)\" INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -107,6 +107,8 @@ VPATH = @srcdir@ +BIBCLEANRC = @BIBCLEANRC@ + # Where to install the manual pages. mandir = $(prefix)/man/man1 # Extension (not including `.') for the installed manual page filenames. @@ -133,9 +135,12 @@ # Use the -p flag where available to preserve file time stamps # All known UNIX implementations have an rcp that supports -p, # but not all have similar support in cp. +# -- NOT! in Debian, /usr/bin/rcp may be a symbolic link to +# /usr/bin/ssh, which uses -p for a port number... CP = /bin/cp -p -CP = /bin/cp -CP = rcp -p +#CP = /bin/cp +#CP = rcp -p + DIST-FILES = ChangeLog README Makefile Makefile.in bibclean.c \ bibclean.h bibclean.hlp bibclean.html bibclean.ini \ @@ -280,7 +285,6 @@ SRC = bibclean.c chek.c do.c fix.c fndfil.c isbn.c \ keybrd.c match.c option.c romtol.c strist.c strtol.c -STRIP = strip # Only the subdirectories with Makefiles are listed here SUBDIRS = doc @@ -373,7 +377,7 @@ echo ' in '$$PWD' on '`date`' */' >>$@ echo >>$@ $(AWK) '{ if ($$0 ~ /^.TH/) \ - printf("%s\n.pl 100i\n.nr LL 7.2i\n.nh\n.na",$$0); \ + printf("%s\n.pl 100i\n.nr LL 7.2i\n.nh\n.na\n",$$0); \ else if ($$0 ~ /^.TP .*remove-OPT-prefixes.*/) \ print ".TP 1in"; \ else \ @@ -471,10 +475,10 @@ docs: bibclean.txt bibclean.hlp bibclean.ps chek.i: chek.c config.h custom.h match.h token.h xctype.h \ - xstat.h xstring.h yesorno.h Makefile + xstat.h xstring.h yesorno.h longflds.h Makefile chek.o: chek.c config.h custom.h match.h token.h xctype.h \ - xstat.h xstring.h yesorno.h + xstat.h xstring.h yesorno.h longflds.h do.i: do.c ch.h config.h custom.h delete.h keybrd.h \ match.h pattern.h token.h toklst.h xctype.h \ @@ -527,12 +531,12 @@ -for d in $(SUBDIRS) ; do (cd $$d ; make mostlyclean ) ; done option.i: option.c bibclean.h ch.h config.h custom.h xstdlib.h \ - xstring.h yesorno.h Makefile + xstring.h yesorno.h longflds.h Makefile # When HOST, USER, __DATE__, and __TIME__ are available, # bibclean preserves them for its version output option.o: option.c bibclean.h ch.h config.h custom.h xstdlib.h \ - xstring.h yesorno.h + xstring.h yesorno.h longflds.h $(CC) -I. -I$(srcdir) $(CFLAGS) -c -DHOST=\"$(HOST)\" -DUSER=\"$(USER)\" option.c # Build a test program for romtol() @@ -581,6 +585,7 @@ distclean: clobber -$(RM) Makefile + -$(RM) config.h -$(RM) config.status -$(RM) config.cache -for d in $(SUBDIRS) ; do (cd $$d ; make distclean ) ; done @@ -612,11 +617,10 @@ fi -$(RM) $(bindir)/bibclean-$(VERSION) $(CP) bibclean $(bindir)/bibclean - -$(STRIP) $(bindir)/bibclean $(LN) $(bindir)/bibclean $(bindir)/bibclean-$(VERSION) $(CHMOD) 775 $(bindir)/bibclean - $(CP) bibclean.ini $(bindir)/.bibcleanrc - $(CHMOD) 664 $(bindir)/.bibcleanrc + $(CP) bibclean.ini $(BIBCLEANRC) + $(CHMOD) 664 $(BIBCLEANRC) install-man: bibclean.man if test -f $(mandir)/bibclean.$(manext) ; \ @@ -955,7 +959,7 @@ uninstall: -$(RM) $(bindir)/bibclean $(bindir)/bibclean-$(VERSION) \ - $(bindir)/.bibcleanrc \ + $(BIBCLEANRC) \ $(mandir)/bibclean.$(manext) \ $(mandir)/bibclean-$(VERSION).$(manext) \ $(mandir)/../cat$(manext)/bibclean.$(manext) \ --- bibclean-2.11.4.orig/README +++ bibclean-2.11.4/README @@ -159,6 +159,23 @@ failure, because the config.cache file created by configure will lead to an incorrect config.h for the next build. +The Debianization by Henning Makholm adds a few new arguments to +the ./configure script: + +--with-pager=/usr/bin/less + (or some other value of /usr/bin/less) suppresses the internal pager + that bibclean normally uses to display the help text for bibclean -help. + Instead, the help text will be piped to the specified program. If the + user has set $PAGER at run time, that will be used instead. + +--with-fhs-rcfiles + will cause bibclean to look for its system-wide configuration in + $(datadir)/bibcleanrc and /etc/bibcleanrc instead of looking in + the executable path for a .bibcleanrc. Note that the filenames + in $(datadir) or /etc do not contain the initial dot. The + configuration file can still be overridden by ~/.bibcleanrc + (this filename does take a dot). + ============ UNIX Systems --- bibclean-2.11.4.orig/configure +++ bibclean-2.11.4/configure @@ -11,6 +11,10 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: +ac_help="$ac_help + --with-pager= use the specified external pager (eg, /bin/more)" +ac_help="$ac_help + --with-fhs-rcfiles look for rcfiles in \$(datadir) or /etc, not \$PATH" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -530,7 +534,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:534: checking for $ac_word" >&5 +echo "configure:538: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -567,7 +571,7 @@ echo $ac_n "checking whether we have NeXT system""... $ac_c" 1>&6 -echo "configure:571: checking whether we have NeXT system" >&5 +echo "configure:575: checking whether we have NeXT system" >&5 if test -d /NextAdmin then CFLAGS=-posix echo "$ac_t""yes" 1>&6 @@ -578,7 +582,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:582: checking for $ac_word" >&5 +echo "configure:586: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -608,7 +612,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:612: checking for $ac_word" >&5 +echo "configure:616: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -659,7 +663,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:663: checking for $ac_word" >&5 +echo "configure:667: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -691,7 +695,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:695: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:699: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -702,12 +706,12 @@ cat > conftest.$ac_ext << EOF -#line 706 "configure" +#line 710 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -733,12 +737,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:737: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:741: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:742: checking whether we are using GNU C" >&5 +echo "configure:746: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -747,7 +751,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -766,7 +770,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:770: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:774: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -802,7 +806,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:806: checking for $ac_word" >&5 +echo "configure:810: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -834,7 +838,7 @@ echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:838: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:842: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -845,12 +849,12 @@ cat > conftest.$ac_ext << EOF -#line 849 "configure" +#line 853 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -876,12 +880,12 @@ { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:880: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:884: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:885: checking whether we are using GNU C++" >&5 +echo "configure:889: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -890,7 +894,7 @@ yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -909,7 +913,7 @@ ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:913: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:917: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -942,10 +946,10 @@ echo $ac_n "checking whether we need _ALL_SOURCE""... $ac_c" 1>&6 -echo "configure:946: checking whether we need _ALL_SOURCE" >&5 +echo "configure:950: checking whether we need _ALL_SOURCE" >&5 all=no cat > conftest.$ac_ext < @@ -956,7 +960,7 @@ ; return 0; } EOF -if { (eval echo configure:960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:964: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -967,7 +971,7 @@ rm -f conftest* if test $all = maybe ; then cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define _ALL_SOURCE 1 @@ -995,10 +999,10 @@ echo "$ac_t""$all" 1>&6 echo $ac_n "checking whether we need _POSIX_SOURCE""... $ac_c" 1>&6 -echo "configure:999: checking whether we need _POSIX_SOURCE" >&5 +echo "configure:1003: checking whether we need _POSIX_SOURCE" >&5 posix=no cat > conftest.$ac_ext < @@ -1009,7 +1013,7 @@ ; return 0; } EOF -if { (eval echo configure:1013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -1020,7 +1024,7 @@ rm -f conftest* if test $posix = maybe ; then cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define _POSIX_SOURCE 1 @@ -1048,9 +1052,9 @@ echo "$ac_t""$posix" 1>&6 echo $ac_n "checking for Standard C and C++ function declarations""... $ac_c" 1>&6 -echo "configure:1052: checking for Standard C and C++ function declarations" >&5 +echo "configure:1056: checking for Standard C and C++ function declarations" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1066: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -1074,17 +1078,17 @@ rm -f conftest* echo $ac_n "checking for SunOS C++ free() argument type bug""... $ac_c" 1>&6 -echo "configure:1078: checking for SunOS C++ free() argument type bug" >&5 +echo "configure:1082: checking for SunOS C++ free() argument type bug" >&5 freebug=no cat > conftest.$ac_ext < int main() { void *p; p = (void*)0; free(p) ; return 0; } EOF -if { (eval echo configure:1088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -1096,14 +1100,14 @@ if test $freebug = maybe ; then cat > conftest.$ac_ext < int main() { void *p; p = (void*)0; free((char*)p) ; return 0; } EOF -if { (eval echo configure:1107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define FREE_CAST_IS_CHAR_STAR 1 @@ -1119,17 +1123,17 @@ echo "$ac_t""$freebug" 1>&6 echo $ac_n "checking for Standard C alert character""... $ac_c" 1>&6 -echo "configure:1123: checking for Standard C alert character" >&5 +echo "configure:1127: checking for Standard C alert character" >&5 havealert=yes if test "$cross_compiling" = yes; then havealert=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1137: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then havealert=yes cat >> confdefs.h <<\EOF @@ -1150,7 +1154,7 @@ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1154: checking how to run the C preprocessor" >&5 +echo "configure:1158: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1165,13 +1169,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1182,13 +1186,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1196: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1199,13 +1203,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1230,12 +1234,12 @@ echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1234: checking for ANSI C header files" >&5 +echo "configure:1238: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1243,7 +1247,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1260,7 +1264,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1278,7 +1282,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1299,7 +1303,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1310,7 +1314,7 @@ exit (0); } EOF -if { (eval echo configure:1314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1341,17 +1345,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1345: checking for $ac_hdr" >&5 +echo "configure:1349: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1355: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1379,12 +1383,12 @@ echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1383: checking for working const" >&5 +echo "configure:1387: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1454,12 +1458,12 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:1458: checking for mode_t" >&5 +echo "configure:1462: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1487,12 +1491,12 @@ fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1491: checking for size_t" >&5 +echo "configure:1495: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1520,12 +1524,12 @@ fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:1524: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:1528: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1533,7 +1537,7 @@ struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:1537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1541: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -1556,13 +1560,13 @@ if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:1560: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:1564: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -1580,7 +1584,7 @@ if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -1602,7 +1606,7 @@ fi echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6 -echo "configure:1606: checking whether utime accepts a null argument" >&5 +echo "configure:1610: checking whether utime accepts a null argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1612,7 +1616,7 @@ ac_cv_func_utime_null=no else cat > conftest.$ac_ext < #include @@ -1623,7 +1627,7 @@ && t.st_mtime - s.st_mtime < 120)); } EOF -if { (eval echo configure:1627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_utime_null=yes else @@ -1649,12 +1653,12 @@ for ac_func in strtol do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1653: checking for $ac_func" >&5 +echo "configure:1657: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1706,12 +1710,12 @@ for ac_func in getcwd getwd re_comp strcspn strdup strspn strstr strtod strtol do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1710: checking for $ac_func" >&5 +echo "configure:1714: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1760,9 +1764,9 @@ echo $ac_n "checking for ioctl prototype""... $ac_c" 1>&6 -echo "configure:1764: checking for ioctl prototype" >&5 +echo "configure:1768: checking for ioctl prototype" >&5 cat > conftest.$ac_ext < @@ -1788,6 +1792,136 @@ rm -f conftest* +# suppress caching of EXTERNAL_PAGER; different searches are made for +# different configurations. +unset ac_cv_path_EXTERNAL_PAGER +# Check whether --with-pager or --without-pager was given. +if test "${with_pager+set}" = set; then + withval="$with_pager" + case $withval in + no | /* | ?:/*) EXTERNAL_PAGER="$withval" ;; + yes) # Try to find a sensible pager to compile in. Feel free + # to extend the list of pagers looked for here + for ac_prog in pager more less +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1811: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_EXTERNAL_PAGER'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$EXTERNAL_PAGER" in + /*) + ac_cv_path_EXTERNAL_PAGER="$EXTERNAL_PAGER" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_EXTERNAL_PAGER="$EXTERNAL_PAGER" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_EXTERNAL_PAGER="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac +fi +EXTERNAL_PAGER="$ac_cv_path_EXTERNAL_PAGER" +if test -n "$EXTERNAL_PAGER"; then + echo "$ac_t""$EXTERNAL_PAGER" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$EXTERNAL_PAGER" && break +done +test -n "$EXTERNAL_PAGER" || EXTERNAL_PAGER="no" + + case $EXTERNAL_PAGER in no) + { echo "configure: error: No well-known pager found in \$PATH, please specify one" 1>&2; exit 1; } + ;; + esac ;; + *) SAVED_PAGER="$withval" + # Extract the first word of ""$SAVED_PAGER"", so it can be a program name with args. +set dummy "$SAVED_PAGER"; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1855: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_EXTERNAL_PAGER'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$EXTERNAL_PAGER" in + /*) + ac_cv_path_EXTERNAL_PAGER="$EXTERNAL_PAGER" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_EXTERNAL_PAGER="$EXTERNAL_PAGER" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_EXTERNAL_PAGER="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_EXTERNAL_PAGER" && ac_cv_path_EXTERNAL_PAGER="no" + ;; +esac +fi +EXTERNAL_PAGER="$ac_cv_path_EXTERNAL_PAGER" +if test -n "$EXTERNAL_PAGER"; then + echo "$ac_t""$EXTERNAL_PAGER" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + case $EXTERNAL_PAGER in no) + { echo "configure: error: --with-pager=$SAVED_PAGER: not absolute pathname and not in \$PATH" 1>&2; exit 1; } + ;; + esac ;; + esac +else + EXTERNAL_PAGER=no +fi + +case $EXTERNAL_PAGER in no) ;; *) + if test x"$ac_cv_header_unistd_h" = xyes ; then + cat >> confdefs.h <<\EOF +#define SCREEN_LINES 0 +EOF + + cat >> confdefs.h <&2 + fi ;; +esac + +BIBCLEANRC='$(bindir)/.bibcleanrc' +# Check whether --with-fhs-rcfiles or --without-fhs-rcfiles was given. +if test "${with_fhs_rcfiles+set}" = set; then + withval="$with_fhs_rcfiles" + case $withval in yes) cat >> confdefs.h <<\EOF +#define FHS_RCFILES 1 +EOF + + BIBCLEANRC='$(datadir)/bibcleanrc' ;; + esac +fi + + + if test "$CC" = "lcc" then CFLAGS="`echo $CFLAGS | sed -e 's/-g //g' -e 's/ -g$//g' -e 's/^-g$//'`" @@ -1930,6 +2064,8 @@ s%@CXX@%$CXX%g s%@CPP@%$CPP%g s%@LIBOBJS@%$LIBOBJS%g +s%@EXTERNAL_PAGER@%$EXTERNAL_PAGER%g +s%@BIBCLEANRC@%$BIBCLEANRC%g CEOF EOF @@ -2144,3 +2280,4 @@ rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + --- bibclean-2.11.4.orig/chek.c +++ bibclean-2.11.4/chek.c @@ -5,9 +5,14 @@ RCSID("$Id: chek.c,v 1.3 1996/05/03 20:11:39 beebe Exp beebe $") +/* ISBN validation code changed heavily by Henning Makholm + * in December 2004 to add support for ISBN-13 + */ + #include "yesorno.h" #include "match.h" /* must come AFTER yesorno.h */ #include "token.h" +#include "longflds.h" typedef struct s_parse_data { @@ -54,9 +59,6 @@ #define UNKNOWN_CODEN "??????" #define MAX_CODEN (sizeof(UNKNOWN_CODEN)-1) -#define UNKNOWN_ISBN "??????????" -#define MAX_ISBN (sizeof(UNKNOWN_ISBN)-1) - #define UNKNOWN_ISSN "????????" #define MAX_ISSN (sizeof(UNKNOWN_ISSN)-1) @@ -90,7 +92,8 @@ void check_year ARGS((void)); static void bad_CODEN ARGS((char CODEN_[6])); -static void bad_ISBN ARGS((char ISBN_[11])); +static void bad_ISBN ARGS((const char *problem, + const char *isbn, size_t isbn_length)); static void bad_ISSN ARGS((char ISSN_[9])); static int CODEN_character_value ARGS((int c_)); static size_t copy_element ARGS((char *target_, size_t nt_, const char *source_, size_t ns_)); @@ -101,10 +104,13 @@ static void parse_list ARGS((const char *s, YESorNO (*is_name_char_) ARGS((int c_, size_t n_)), void (*validate_) ARGS((const char *CODEN_, size_t n_)))); +static void rewrite_list ARGS((char *s,size_t buflen, + YESorNO (*is_name_char_) ARGS((int c_, size_t n_)), + size_t (*rewrite_) ARGS((char *DEST,size_t DS_,const char *SRC,size_t SS_)))); static void parse_element ARGS((parse_data *pd_)); static void parse_separator ARGS((parse_data *pd_)); static void validate_CODEN ARGS((const char *CODEN_, size_t n_)); -static void validate_ISBN ARGS((const char *ISBN_, size_t n_)); +static size_t rewrite_ISBN ARGS((char *DEST,size_t DS,const char *SRC,size_t SS)); static void validate_ISSN ARGS((const char *ISSN_, size_t n_)); static void unexpected ARGS((void)); @@ -138,29 +144,14 @@ } -#if defined(HAVE_STDC) -static void -bad_ISBN(char ISBN[11]) -#else /* K&R style */ static void -bad_ISBN(ISBN) -char ISBN[11]; -#endif +bad_ISBN(const char *problem, const char *isbn, size_t isbn_length) { -#define MAXISBN (13+1) /* space for correctly hyphenated ISBN, plus NUL */ - static char fmt[] = "Invalid checksum for ISBN %s in ``%%f = %%v''"; - char msg[sizeof(fmt)+MAXISBN-1-2]; - char s[MAXISBN]; - char t[MAXISBN]; - size_t n; - - (void)strcpy(s,UNKNOWN_ISBN); - n = strlen(&ISBN[1]); - (void)memcpy(s,&ISBN[1],(n > sizeof(s)) ? sizeof(s) : n); - s[10] = '\0'; - ISBN_hyphenate(s,t,sizeof(s)); - - (void)sprintf(msg, fmt, s); + static char fmt[] = "%s for ISBN %*s in ``%%f = %%v''"; + char msg[100] ; + if (isbn_length > 100-strlen(problem) - sizeof(fmt)) + isbn_length=10 ; + (void)sprintf(msg, fmt, problem, isbn_length, isbn); warning(msg); /* used to be error(), but some books actually have */ /* invalid ISBNs */ } @@ -257,12 +248,7 @@ void check_ISBN(VOID) { - char t[MAX_TOKEN_SIZE]; - - /* Supply correct hyphenation for all ISBNs */ - ISBN_hyphenate(current_value,t,sizeof(t)/sizeof(t[0])); - - parse_list(current_value, is_ISBN_char, validate_ISBN); + rewrite_list(current_value,MAX_TOKEN_SIZE, is_ISBN_char, rewrite_ISBN); } @@ -354,6 +340,7 @@ } +struct long_field_struct *long_fields = (struct long_field_struct *)0 ; #if defined(HAVE_STDC) void check_length(size_t n) @@ -363,6 +350,10 @@ size_t n; #endif { + struct long_field_struct *lfp; + for( lfp = long_fields; lfp; lfp = lfp->next ) + if( STREQUAL(current_field,lfp->fieldname) ) + return ; if ((check_values == YES) && (n >= STD_MAX_TOKEN)) warning("String length exceeds standard BibTeX limit for ``%f'' entry"); } @@ -753,6 +744,11 @@ /* ISBNs match [0-9][- ]*[0-9][- ]*[0-9][- ]*[0-9][- ]*[0-9][- ]* [0-9][- ]*[0-9][- ]*[0-9][- ]*[0-9][- ]*[0-9xX] + or + ([0-9][- ]*){13} + but in order to catch wrong-number-of-digit errors we accept any + number of digits, and start accepting X'es even early in the + sequence. */ if (n == 0) /* start new ISBN */ @@ -761,13 +757,13 @@ /* embedded hyphens and space are accepted, but are not significant */ if ((n_significant > 0) && ((c == '-') || isspace(c))) return (YES); - else if ((n_significant < 9) && isdigit(c)) + else if (isdigit(c)) { n_significant++; return (YES); } - else if ((n_significant >= 9) && (isdigit(c) || (c == 'X') || (c == 'x'))) - { /* tenth character may be [0-9xX] */ + else if ((n_significant >= 5) && ((c == 'X') || (c == 'x'))) + { n_significant++; return (YES); } @@ -882,6 +878,73 @@ } } +#if defined(HAVE_STDC) +static void +rewrite_list(char *s, size_t buflen, + YESorNO (*is_name_char) ARGS((int c, size_t n)), + size_t (*rewrite) ARGS((char *d, size_t ds,const char *s,size_t ss))) +#else /* K&R style */ +static void +rewrite_list(s, buflen, is_name_char, rewrite) +const char *s; +size_t buflen; +YESorNO (*is_name_char) ARGS((int c, size_t n)); +size_t (*rewrite) ARGS((char *d, size_t ds,const char *s,size_t ss)); +#endif +{ + parse_data pd; + char workbuf[MAX_TOKEN_SIZE] ; + char *filler ; + size_t tmp ; + + /******************************************************************* + Parse a list of the same shape as for parse_list, but allow + the individual names to be rewritten while validating them. + + The buffer pointed to by s has size buflen, and is updated + destructively, but only after all names have been rewritten + succesfully. + + The rewrite() argument works with non-zero-terminated strings. + It returns the number of characters copied to the destination, + or (size_t)(-1) if there is not enough space. + *******************************************************************/ + + pd.s = s; + pd.is_name_char = is_name_char; + if( buflen > sizeof(workbuf) ) + buflen = sizeof(workbuf) ; + filler = workbuf ; + + for (;;) + { + parse_separator(&pd); /* may produce a zero-length token */ + if( pd.token_length > buflen ) { + buflen = 0 ; + break ; + } + (void)memcpy(filler,pd.token,pd.token_length); + filler += pd.token_length; + buflen -= pd.token_length; + + parse_element(&pd); + if (pd.token_length == 0) /* no more tokens in list */ + break; + tmp = (*rewrite)(filler,buflen,pd.token,pd.token_length); + if( tmp == (size_t)(-1) || tmp > buflen ) { + buflen = 0 ; + break ; + } + filler += tmp ; + buflen -= tmp ; + } + if( buflen > 0 ) { + *filler = '\0' ; + strcpy(s,workbuf); + } else { + error("Expansion of field ``%v'' would be too long"); + } +} #if defined(HAVE_STDC) static void @@ -1017,14 +1080,14 @@ } -static void -validate_ISBN(const char *the_ISBN, size_t n) +static size_t +rewrite_ISBN(char *dest, size_t destlen, const char *src, size_t srclen) { - int checksum; - char ISBN[1 + MAX_ISBN + 1]; /* saved ISBN for error messages */ - /* (use slots 1..10 instead of 0..9) */ - size_t k; /* index into ISBN[] */ - size_t nleft; + const char *src_first, *src_last; + const char *wrong_because; + int n, xpos, checksum, k; + int hyphenate10; + char c, digits[20]; /******************************************************************* ISBN numbers are 10-character values from the set [0-9Xx], with @@ -1039,24 +1102,128 @@ ISBN digits are grouped into four parts separated by space or hyphen: countrygroupnumber-publishernumber-booknumber-checkdigit. + + Starting January 1, 2005 ISBN numbers can also be 13-digit + numbers that are identical to the EAN retail product barcode + for the book. The first three digits is the "bookland" code + 978; the last 10 digits follows the same numbering plan as + old 10-digit ISBNs; however the check digit is computed + according to the EAN checksum algorithm. + + ISBN-13 numbers are grouped with a hyphen after the bookland + code and the last 10 digits hyphenated as ISBN-10. + + There is also a reserve bookland code 979. The numbering + space for numbers in this range have not been allocated yet, + so we do not try to adjust spacing and hyphenation for them, + though we do validate the checksu. + + Books published before 2005 are still referred to with an + ISBN-10, so we need to be able to validate and reformat + either kind of number. *******************************************************************/ - (void)strcpy(&ISBN[1],UNKNOWN_ISBN); - nleft = copy_element(&ISBN[1], sizeof(ISBN)-1, the_ISBN, n); + src_first = src_last = src ; + for (n=0, xpos=0; srclen>0; srclen--) + { + c = *src++ ; + if( isdigit(c) ) + /* nothing yet */; + else if( c == 'X' || c == 'x' ) + { + if( xpos == 0 ) xpos = n+1 ; + c = 'X'; + } + else + continue ; + + if( n < 13 ) + digits[n] = c ; + n++ ; + src_last = src ; + } + + wrong_because = (const char*)NULL; + + if (xpos != 0) wrong_because = "Illegal position of X"; - for (checksum = 0, k = 1; ISBN[k]; ++k) + if (n == 10) { - if (k < MAX_ISBN) - checksum += ISBN_DIGIT_VALUE(ISBN[k]) * k; - else if (k == MAX_ISBN) - { - if ((checksum % 11) != ISBN_DIGIT_VALUE(ISBN[k])) - bad_ISBN(ISBN); - } - } /* end for (loop over ISBN[]) */ + if( destlen < 14 ) return (size_t)(-1); + if (xpos == 10 ) wrong_because = (const char*)NULL ; + for (checksum = 0, k = 0; k < 9; ++k) + { + dest[k] = digits[k]; + checksum += ISBN_DIGIT_VALUE(digits[k]) * (k+1); + } + dest[9] = digits[9]; + if ((checksum % 11) != ISBN_DIGIT_VALUE(digits[9])) + wrong_because = "Invalid checksum"; + hyphenate10 = 0 ; + } + else if (n == 13) + { + if( destlen < 18 ) return (size_t)(-1); + for (checksum = 0, k = 0; k < 13; ++k) + { + dest[k+(k>=3)] = digits[k] ; + checksum += ISBN_DIGIT_VALUE(digits[k]) * (1+2*(k%2)); + } + dest[3] = '-'; + if ((checksum % 10) != 0) + wrong_because = "Invalid checksum"; + else if (digits[0] != '9' || + digits[1] != '7' || + (digits[2] != '8' && digits[2] != '9')) + wrong_because = "Non-bookland prefix"; + /* Only change hyphenation for bookland 978; no prefixes + * for booland 979 have been assigned yet. + */ + hyphenate10 = digits[2] == '8' ? 4 : -1 ; + } + else if (n < 6) + { + /* Do nothing. Things shorter than 6 characters probably + * aren't meant as ISBNs anyway. */ + hyphenate10 = -1; + } + else + { + wrong_because = "Invalid length" ; + hyphenate10 = -1; + } + + if (hyphenate10 >= 0) + { + dest[hyphenate10+10] = '\0' ; + k = destlen-hyphenate10; + if (k >= 20) k = 20; + (void)ISBN_hyphenate(dest+hyphenate10,digits,k); + + k = strlen(dest); + if (k > hyphenate10+10) + { + /* We only get here if the ISBN was actually hyphenated; this + * may not happen if the ISBN is in an unknown number range. + */ + if (wrong_because != NULL) + (void)bad_ISBN(wrong_because,dest,k); + + n = src - src_last ; + if (destlen < k + n) + return (size_t)(-1); + (void)memcpy(dest+k,src_last,n); + return k+n ; + } + } - if ((strlen(&ISBN[1]) != MAX_ISBN) || (nleft > 0)) - bad_ISBN(ISBN); + if (wrong_because != NULL) + (void)bad_ISBN(wrong_because,src_first,src_last-src_first); + n = src - src_first ; + if (destlen < n) + return (size_t)(-1); + (void)memcpy(dest,src_first,n); + return n ; } --- bibclean-2.11.4.orig/do.c +++ bibclean-2.11.4/do.c @@ -226,8 +226,6 @@ extern char *initialization_file_name; extern int isidchar ARGS((int c_)); extern int isoptionprefix ARGS((int c)); -extern keyboard_code_t kbcode ARGS((void)); -extern int kbget ARGS((void)); extern void out_at ARGS((void)); extern void out_c ARGS((int c_)); extern void out_flush ARGS((void)); --- bibclean-2.11.4.orig/isbn.c +++ bibclean-2.11.4/isbn.c @@ -48,6 +48,9 @@ characters. This is produced by Robert Solovay's checksum utility.", } +The checksum does not match anymore after Henning Makholm + updated the ISBN prefix range data in December +2004. ***********************************************************************/ #include @@ -168,402 +171,656 @@ const char *end; } ISBN_range[] = { + /* Table generated by ./rangecvt.pl; then edited manually */ + /* Australia, Canada (English), Gibraltar, Ireland, New Zealand, South Africa, Swaziland, United Kingdom, United States of America, Zimbabwe */ { "0-00", "0-19" }, - { "0-200", "0-698" }, + { "0-200", "0-699" }, { "0-7000", "0-8499" }, - { "0-85000", "0-89997" }, + { "0-85000", "0-89999" }, { "0-900000", "0-949999" }, - { "0-9500000", "0-9801223" }, + { "0-9500000", "0-9999999" }, /* Australia, Canada (English), Gibraltar, Ireland, New Zealand, South Africa, Swaziland, United Kingdom, United States of America, Zimbabwe */ - { "1-55000", "1-86957" }, - { "1-869800", "1-895682" }, + { "1-00", "1-09" }, + { "1-100", "1-399" }, + { "1-4000", "1-5499" }, + { "1-55000", "1-86979" }, + { "1-869800", "1-998999" }, + { "1-9990000", "1-9999999" }, /* Belgium, Canada (French), France, Luxembourg, Switzerland (French) */ - { "2-01", "2-19" }, - { "2-200", "2-607" }, - { "2-7000", "2-8317" }, - { "2-84001", "2-89436" }, - { "2-900000", "2-940028" }, - { "2-9500000", "2-9900003" }, + { "2-00", "2-19" }, + { "2-200", "2-349" }, + { "2-35000", "2-39999" }, + { "2-400", "2-699" }, + { "2-7000", "2-8399" }, + { "2-84000", "2-89999" }, + { "2-900000", "2-949999" }, + { "2-9500000", "2-9999999" }, /* Austria, Germany, Switzerland (German) */ - { "3-01", "3-19" }, - { "3-201", "3-633" }, - { "3-7001", "3-8252" }, - { "3-85001", "3-89524" }, - { "3-900001", "3-929031" }, - { "3-9500000", "3-9802964" }, + { "3-00", "3-02" }, + { "3-030", "3-033" }, + { "3-0340", "3-0369" }, + { "3-03700", "3-03999" }, + { "3-04", "3-19" }, + { "3-200", "3-699" }, + { "3-7000", "3-8499" }, + { "3-85000", "3-89999" }, + { "3-900000", "3-949999" }, + { "3-9500000", "3-9999999" }, /* Japan */ { "4-00", "4-19" }, - { "4-250", "4-657" }, - { "4-7500", "4-8470" }, - { "4-87000", "4-89829" }, + { "4-200", "4-699" }, + { "4-7000", "4-8499" }, + { "4-85000", "4-89999" }, { "4-900000", "4-949999" }, + { "4-9500000", "4-9999999" }, /* Azerbaijan, Belarus, Commonwealth of Independent States, Estonia, Georgia, Kazakhstan, Kyrgyzstan, Latvia, Lithuania, Tajikistan, Turkmenistan, Uzbekistan */ - - { "5-01", "5-12" }, - { "5-200", "5-690" }, - { "5-7000", "5-8396" }, - { "5-85001", "5-89996" }, - { "5-900165", "5-900850" }, - - /* No 6- ISBN assignments */ + { "5-00", "5-19" }, + { "5-200", "5-699" }, + { "5-7000", "5-8499" }, + { "5-85000", "5-89999" }, + { "5-900000", "5-909999" }, + { "5-91000", "5-91999" }, + { "5-9200", "5-9299" }, + { "5-93000", "5-94999" }, + { "5-9500", "5-9799" }, + { "5-98000", "5-98999" }, + { "5-9900000", "5-9909999" }, + { "5-9910", "5-9999" }, /* China */ - { "7-00", "7-04" }, - { "7-100", "7-314" }, - { "7-5000", "7-5639" }, - { "7-80000", "7-81035" }, - { "7-900000", "7-900000" }, + { "7-00", "7-09" }, + { "7-100", "7-499" }, + { "7-5000", "7-7999" }, + { "7-80000", "7-89999" }, + { "7-900000", "7-999999" }, /* Czechoslovakia (Czech Republic, Slovakia) */ - { "80-00", "80-09" }, - { "80-200", "80-236" }, - { "80-7000", "80-7151" }, - { "80-85000", "80-85529" }, - { "80-900075", "80-901081" }, + { "80-00", "80-19" }, + { "80-200", "80-699" }, + { "80-7000", "80-8499" }, + { "80-85000", "80-89999" }, + { "80-900000", "80-999999" }, /* India */ - { "81-200", "81-648" }, - { "81-7000", "81-7266" }, - { "81-85000", "81-85690" }, - { "81-900000", "81-900211" }, + { "81-00", "81-19" }, + { "81-200", "81-699" }, + { "81-7000", "81-8499" }, + { "81-85000", "81-89999" }, + { "81-900000", "81-999999" }, /* Norway */ - { "82-400", "82-599" }, - { "82-7000", "82-7661" }, - { "82-90000", "82-91769" }, - { "82-990000", "82-992517" }, + { "82-00", "82-19" }, + { "82-200", "82-699" }, + { "82-7000", "82-8999" }, + { "82-90000", "82-98999" }, + { "82-990000", "82-999999" }, /* Poland */ - { "83-00", "83-11" }, - { "83-200", "83-233" }, - { "83-7000", "83-7080" }, - { "83-85000", "83-85541" }, - { "83-900000", "83-900482" }, + { "83-00", "83-19" }, + { "83-200", "83-599" }, + { "83-60000", "83-69999" }, + { "83-7000", "83-8499" }, + { "83-85000", "83-89999" }, + { "83-900000", "83-999999" }, /* Spain */ - { "84-00", "84-07" }, + { "84-00", "84-19" }, { "84-200", "84-699" }, - { "84-7000", "84-8420" }, - { "84-85000", "84-89600" }, + { "84-7000", "84-8499" }, + { "84-85000", "84-89999" }, + { "84-9000", "84-9199" }, + { "84-920000", "84-923999" }, + { "84-92400", "84-92999" }, + { "84-930000", "84-949999" }, + { "84-95000", "84-96999" }, + { "84-9700", "84-9999" }, /* Brazil */ - { "85-00", "85-17" }, - { "85-200", "85-341" }, - { "85-7000", "85-7261" }, - { "85-85000", "85-85457" }, - { "85-900000", "85-900051" }, + { "85-00", "85-19" }, + { "85-200", "85-599" }, + { "85-60000", "85-69999" }, + { "85-7000", "85-8499" }, + { "85-85000", "85-89999" }, + { "85-900000", "85-979999" }, + { "85-98000", "85-99999" }, /* Bosnia and Herzegovina, Croatia, Macedonia, Slovenia, Yugoslavia */ - { "86-03", "86-27" }, - { "86-301", "86-455" }, - { "86-7001", "86-7861" }, - { "86-80001", "86-82045" }, - { "86-900941", "86-901289" }, + { "86-00", "86-29" }, + { "86-300", "86-699" }, + { "86-7000", "86-7999" }, + { "86-80000", "86-89999" }, + { "86-900000", "86-999999" }, /* Denmark */ - { "87-00", "87-20" }, - { "87-411", "87-611" }, - { "87-7000", "87-7799" }, - { "87-85001", "87-89796" }, - { "87-980000", "87-997202" }, + { "87-00", "87-29" }, + { "87-400", "87-649" }, + { "87-7000", "87-7999" }, + { "87-85000", "87-94999" }, + { "87-970000", "87-999999" }, /* Italy, Switzerland (Italian) */ { "88-00", "88-19" }, - { "88-200", "88-461" }, - { "88-7000", "88-8402" }, - { "88-81785", "88-86065" }, + { "88-200", "88-599" }, + { "88-6000", "88-8499" }, + { "88-85000", "88-89999" }, + { "88-900000", "88-949999" }, + { "88-95000", "88-99999" }, /* Republic of Korea */ - { "89-0", "89-0" /* <--no assignments yet */ }, + { "89-00", "89-24" }, + { "89-250", "89-549" }, + { "89-5500", "89-8499" }, + { "89-85000", "89-94999" }, + { "89-950000", "89-999999" }, /* Belgium (Flemish), Netherlands */ - { "90-00", "90-18" }, - { "90-200", "90-449" }, + { "90-00", "90-19" }, + { "90-200", "90-499" }, { "90-5000", "90-6999" }, - { "90-70000", "90-74319" }, - { "90-800000", "90-800868" }, + { "90-70000", "90-79999" }, + { "90-800000", "90-849999" }, + { "90-8500", "90-8999" }, + { "90-900000", "90-909999" }, + { "90-940000", "90-949999" }, /* Sweden */ { "91-0", "91-1" }, - { "91-20", "91-48" }, - { "91-500", "91-632" }, - { "91-7000", "91-7998" }, - { "91-85002", "91-88356" }, - { "91-970000", "91-992083" }, + { "91-20", "91-49" }, + { "91-500", "91-649" }, + { "91-7000", "91-7999" }, + { "91-85000", "91-94999" }, + { "91-970000", "91-999999" }, /* International Publishers (UNESCO) */ { "92-0", "92-5" }, - { "92-61", "92-77" }, - { "92-800", "92-891" }, - { "92-9001", "92-9117" }, + { "92-60", "92-79" }, + { "92-800", "92-899" }, + { "92-9000", "92-9499" }, + { "92-95000", "92-98999" }, + { "92-990000", "92-999999" }, /* India */ - { "93-0", "93-0" /* <--no assignments yet */ }, + { "93-0", "93-0" /* <-no assignments yet */ }, /* Argentina */ - { "950-00", "950-47" }, - { "950-500", "950-795" }, + { "950-00", "950-49" }, + { "950-500", "950-899" }, { "950-9000", "950-9899" }, - { "950-99000", "950-99949" }, + { "950-99000", "950-99999" }, /* Finland */ { "951-0", "951-1" }, { "951-20", "951-54" }, { "951-550", "951-889" }, - { "951-8900", "951-9498" }, - { "951-95000", "951-96448" }, + { "951-8900", "951-9499" }, + { "951-95000", "951-99999" }, /* Finland */ - { "952-90", "952-90" }, - { "952-6666", "952-6666" }, - { "952-9500", "952-9714" }, - - /* Croatia (publisher range unknown) */ - { "953-00", "953-99" }, + { "952-00", "952-19" }, + { "952-200", "952-499" }, + { "952-5000", "952-5999" }, + { "952-60", "952-65" }, + { "952-6600", "952-6699" }, + { "952-67000", "952-69999" }, + { "952-7000", "952-7999" }, + { "952-89", "952-94" }, + { "952-9500", "952-9899" }, + { "952-99000", "952-99999" }, + + /* Croatia */ + { "953-0", "953-0" }, + { "953-10", "953-14" }, + { "953-150", "953-599" }, + { "953-6000", "953-9499" }, + { "953-95000", "953-99999" }, /* Bulgaria */ - { "954-0", "954-0" /* <--no assignments yet */ }, + { "954-00", "954-29" }, + { "954-300", "954-799" }, + { "954-8000", "954-8999" }, + { "954-90000", "954-92999" }, + { "954-9300", "954-9999" }, /* Sri Lanka */ - { "955-20", "955-28" }, - { "955-550", "955-616" }, - { "955-9000", "955-9151" }, - { "955-95000", "955-95444" }, + { "955-0", "955-0" }, + { "955-1000", "955-1999" }, + { "955-20", "955-54" }, + { "955-550", "955-799" }, + { "955-8000", "955-9499" }, + { "955-95000", "955-99999" }, /* Chile */ - { "956-10", "956-19" }, - { "956-200", "956-266" }, - { "956-7000", "956-7205" }, + { "956-00", "956-19" }, + { "956-200", "956-699" }, + { "956-7000", "956-9999" }, /* Taiwan (Republic of China) */ - { "957-05", "957-43" }, - { "957-500", "957-685" }, - { "957-8500", "957-9699" }, + { "957-00", "957-02" }, + { "957-0300", "957-0499" }, + { "957-05", "957-19" }, + { "957-2000", "957-2099" }, + { "957-21", "957-27" }, + { "957-28000", "957-30999" }, + { "957-31", "957-43" }, + { "957-440", "957-819" }, + { "957-8200", "957-9699" }, + { "957-97000", "957-99999" }, /* Colombia */ - { "958-02", "958-32" }, - { "958-600", "958-656" }, - { "958-9000", "958-9285" }, - { "958-95001", "958-95343" }, + { "958-00", "958-59" }, + { "958-600", "958-799" }, + { "958-8000", "958-9499" }, + { "958-95000", "958-99999" }, /* Cuba */ - { "959-00", "959-13" }, - { "959-200", "959-216" }, - { "959-7000", "959-7033" }, + { "959-00", "959-19" }, + { "959-200", "959-699" }, + { "959-7000", "959-8499" }, /* Greece */ - { "960-00", "960-12" }, - { "960-200", "960-433" }, + { "960-00", "960-19" }, + { "960-200", "960-659" }, + { "960-6600", "960-6899" }, + { "960-690", "960-699" }, { "960-7000", "960-8499" }, - { "960-85000", "960-85203" }, + { "960-85000", "960-99999" }, - /* Slovenia (publisher range unknown) */ - { "961-00", "961-99" }, + /* Slovenia */ + { "961-00", "961-19" }, + { "961-200", "961-599" }, + { "961-6000", "961-8999" }, + { "961-90000", "961-94999" }, /* Hong Kong */ { "962-00", "962-19" }, - { "962-201", "962-474" }, - { "962-7001", "962-7646" }, + { "962-200", "962-699" }, + { "962-7000", "962-8499" }, + { "962-85000", "962-86999" }, + { "962-8700", "962-8999" }, + { "962-900", "962-999" }, /* Hungary */ - { "963-00", "963-18" }, - { "963-200", "963-892" }, - { "963-700", "963-8481" }, - { "963-85000", "963-85084" }, - - /* Iran (publisher range unknown) */ - { "964-00", "964-99" }, + { "963-00", "963-19" }, + { "963-200", "963-699" }, + { "963-7000", "963-8499" }, + { "963-85000", "963-89999" }, + { "963-9000", "963-9999" }, + + /* Iran */ + { "964-00", "964-29" }, + { "964-300", "964-549" }, + { "964-5500", "964-8999" }, + { "964-90000", "964-96999" }, + { "964-970", "964-989" }, + { "964-9900", "964-9999" }, /* Israel */ - { "965-01", "965-19" }, - { "965-207", "965-442" }, - - /* Ukraine (publisher range unknown) */ - { "966-00", "966-99" }, + { "965-00", "965-19" }, + { "965-200", "965-599" }, + { "965-7000", "965-7999" }, + { "965-90000", "965-99999" }, + + /* Ukraine */ + { "966-00", "966-29" }, + { "966-300", "966-699" }, + { "966-7000", "966-8999" }, + { "966-90000", "966-99999" }, /* Malaysia */ + { "967-0", "967-5" }, { "967-60", "967-89" }, { "967-900", "967-989" }, { "967-9900", "967-9989" }, - { "967-99901", "967-99999" }, + { "967-99900", "967-99999" }, /* Mexico */ - { "968-10", "968-39" }, - { "968-400", "968-899" }, - { "968-6000", "968-7275" }, + { "968-01", "968-39" }, + { "968-400", "968-499" }, + { "968-5000", "968-7999" }, + { "968-800", "968-899" }, /* Pakistan */ { "969-0", "969-1" }, - { "969-26", "969-39" }, - { "969-400", "969-473" }, - { "969-8000", "969-8159" }, + { "969-20", "969-39" }, + { "969-400", "969-799" }, + { "969-8000", "969-9999" }, /* Mexico */ - { "970-05", "970-10" }, - { "970-604", "970-619" }, - { "970-91000", "970-91074" }, + { "970-01", "970-59" }, + { "970-600", "970-899" }, + { "970-9000", "970-9099" }, + { "970-91000", "970-96999" }, + { "970-9700", "970-9999" }, /* Philippines */ - { "971-06", "971-36" }, - { "971-500", "971-631" }, - { "971-8500", "971-8819" }, - { "971-91000", "971-91273" }, + { "971-000", "971-019" }, + { "971-02", "971-02" }, + { "971-0300", "971-0599" }, + { "971-06", "971-09" }, + { "971-10", "971-49" }, + { "971-500", "971-849" }, + { "971-8500", "971-9099" }, + { "971-91000", "971-99999" }, /* Portugal */ { "972-0", "972-1" }, - { "972-20", "972-50" }, - { "972-550", "972-722" }, - { "972-8004", "972-9499" }, - { "972-95000", "972-97520" }, + { "972-20", "972-54" }, + { "972-550", "972-799" }, + { "972-8000", "972-9499" }, + { "972-95000", "972-99999" }, /* Romania */ - { "973-21", "973-49" }, - { "973-550", "973-682" }, - { "973-9000", "973-9134" }, - { "973-95000", "973-95521" }, + { "973-0", "973-1" }, + { "973-20", "973-54" }, + { "973-550", "973-759" }, + { "973-7600", "973-8499" }, + { "973-85000", "973-89999" }, + { "973-9000", "973-9499" }, + { "973-95000", "973-99999" }, /* Thailand */ - { "974-00", "974-10" }, - { "974-200", "974-685" }, + { "974-00", "974-19" }, + { "974-200", "974-699" }, { "974-7000", "974-8499" }, - { "974-85000", "974-88000" }, + { "974-85000", "974-89999" }, + { "974-90000", "974-94999" }, + { "974-9500", "974-9999" }, /* Turkey */ - { "975-09", "975-19" }, - { "975-345", "975-554" }, - { "975-7402", "975-7797" }, - { "975-95384", "975-96606" }, - - /* Caribbean Community (CARICOM): Antigua, Bahamas, Barbados, */ - /* Belize, Dominica, Grenada, Guyana, Jamaica, Montserrat, Saint */ - /* Kitts and Nevis, Saint Lucia, Saint Vincent, Trinidad and Tobago */ - { "976-40", "976-42" }, - { "976-600", "976-636" }, - { "976-8000", "976-8105" }, + { "975-00000", "975-00999" }, + { "975-01", "975-24" }, + { "975-250", "975-599" }, + { "975-6000", "975-9199" }, + { "975-92000", "975-98999" }, + { "975-990", "975-999" }, + + /* Caribbean Community (CARICOM): Antigua, Bahamas, Barbados, + Belize, Dominica, Grenada, Guyana, Jamaica, Montserrat, Saint + Kitts and Nevis, Saint Lucia, Saint Vincent, Trinidad and Tobago */ + { "976-0", "976-3" }, + { "976-40", "976-59" }, + { "976-600", "976-799" }, + { "976-8000", "976-9499" }, + { "976-95000", "976-99999" }, /* Egypt */ - { "977-01", "977-17" }, - { "977-200", "977-457" }, - { "977-5000", "977-5235" }, + { "977-00", "977-19" }, + { "977-200", "977-499" }, + { "977-5000", "977-6999" }, + { "977-700", "977-999" }, /* Nigeria */ { "978-000", "978-199" }, - { "978-2000", "978-2887" }, - { "978-30000", "978-31118" }, + { "978-2000", "978-2999" }, + { "978-30000", "978-79999" }, + { "978-8000", "978-8999" }, + { "978-900", "978-999" }, /* Indonesia */ - { "979-400", "979-557" }, - { "979-8000", "979-8322" }, + { "979-0", "979-0" }, + { "979-20", "979-29" }, + { "979-3000", "979-3999" }, + { "979-400", "979-799" }, + { "979-8000", "979-9499" }, + { "979-95000", "979-99999" }, /* Venezuela */ - { "980-00", "980-07" }, - { "980-200", "980-316" }, - { "980-6001", "980-6303" }, + { "980-00", "980-19" }, + { "980-200", "980-599" }, + { "980-6000", "980-9999" }, /* Singapore */ - { "981-00", "981-03" }, - { "981-200", "981-215" }, - { "981-3000", "981-3099" }, - - /* South Pacific, Cook Islands, Fiji, Kiribati, Nauru, Niue, */ - /* Solomon Islands, Tokelau, Tonga, Tuvalu, Vanuatu, Samoa */ - { "982-01", "982-03" }, - { "982-100", "982-500" }, + { "981-00", "981-19" }, + { "981-200", "981-299" }, + { "981-3000", "981-9999" }, + + /* South Pacific: Cook Islands, Fiji, Kiribati, Nauru, Niue, + Solomon Islands, Tokelau, Tonga, Tuvalu, Vanuatu, Samoa */ + { "982-00", "982-09" }, + { "982-100", "982-699" }, + { "982-70", "982-89" }, + { "982-9000", "982-9999" }, /* Malaysia */ - { "983-60", "983-73" }, + { "983-00", "983-01" }, + { "983-020", "983-199" }, + { "983-2000", "983-3999" }, + { "983-40000", "983-49999" }, + { "983-50", "983-79" }, { "983-800", "983-899" }, - { "983-9000", "983-9750" }, - { "983-99382", "983-99747" }, + { "983-9000", "983-9899" }, + { "983-99000", "983-99999" }, /* Bangladesh */ - { "984-01", "984-30" }, - { "984-400", "984-556" }, - { "984-8005", "984-8085" }, - - /* Belarus (publisher range unknown) */ - { "985-00", "985-99" }, + { "984-00", "984-39" }, + { "984-400", "984-799" }, + { "984-8000", "984-8999" }, + { "984-90000", "984-99999" }, + + /* Belarus */ + { "985-00", "985-39" }, + { "985-400", "985-599" }, + { "985-6000", "985-8999" }, + { "985-90000", "985-99999" }, + + /* Taiwan [also 957] */ + { "986-00", "986-11" }, + { "986-120", "986-559" }, + { "986-5600", "986-7999" }, + { "986-80000", "986-99999" }, /* Argentina */ - { "987-0", "987-0" /* <--no assignments yet */ }, - - /* Libya (publisher range unknown) */ - { "9959-0", "9959-9" }, - - /* Algeria (publisher range unknown) */ - { "9961-0", "9961-9" }, + { "987-00", "987-09" }, + { "987-1000", "987-1999" }, + { "987-20000", "987-29999" }, + { "987-30", "987-49" }, + { "987-500", "987-899" }, + { "987-9000", "987-9499" }, + { "987-95000", "987-99999" }, + + /* Hongkong [also 962] */ + { "988-00", "988-19" }, + { "988-200", "988-799" }, + { "988-8000", "988-9699" }, + { "988-97000", "988-99999" }, + + /* Portugal [also 972] */ + { "989-0", "989-1" }, + { "989-20", "989-54" }, + { "989-550", "989-799" }, + { "989-8000", "989-9499" }, + { "989-95000", "989-99999" }, + + /* Dominican Republic */ + { "9945-00", "9945-39" }, + { "9945-400", "9945-849" }, + { "9945-8500", "9945-9999" }, + + /* North Korea */ + { "9946-0", "9946-1" }, + { "9946-20", "9946-39" }, + { "9946-400", "9946-899" }, + { "9946-9000", "9946-9999" }, + + /* Algeria */ + { "9947-0", "9947-1" }, + { "9947-20", "9947-79" }, + { "9947-800", "9947-999" }, + + /* United Arab Emirates */ + { "9948-00", "9948-39" }, + { "9948-400", "9948-849" }, + { "9948-8500", "9948-9999" }, + + /* Estonia */ + { "9949-0", "9949-0" }, + { "9949-10", "9949-39" }, + { "9949-400", "9949-899" }, + { "9949-9000", "9949-9999" }, + + /* Palestine */ + { "9950-00", "9950-29" }, + { "9950-300", "9950-849" }, + { "9950-8500", "9950-9999" }, + + /* Kosova */ + { "9951-00", "9951-39" }, + { "9951-400", "9951-849" }, + { "9951-8500", "9951-9999" }, + + /* Azerbaijan */ + { "9952-0", "9952-1" }, + { "9952-20", "9952-39" }, + { "9952-400", "9952-799" }, + { "9952-8000", "9952-9999" }, + + /* Lebanon */ + { "9953-0", "9953-0" }, + { "9953-10", "9953-39" }, + { "9953-400", "9953-599" }, + { "9953-60", "9953-89" }, + { "9953-9000", "9953-9999" }, - /* Panama (publisher range unknown) */ - { "9962-0", "9962-9" }, + /* Morocco */ + { "9954-0", "9954-1" }, + { "9954-20", "9954-39" }, + { "9954-400", "9954-799" }, + { "9954-8000", "9954-9999" }, + + /* Lithuania */ + { "9955-00", "9955-39" }, + { "9955-400", "9955-929" }, + { "9955-9300", "9955-9999" }, + + /* Cameroon */ + { "9956-0", "9956-0" }, + { "9956-10", "9956-39" }, + { "9956-400", "9956-899" }, + { "9956-9000", "9956-9999" }, + + /* Jordan */ + { "9957-00", "9957-39" }, + { "9957-400", "9957-849" }, + { "9957-8500", "9957-9999" }, + + /* Bosina and Herzegovina */ + { "9958-0", "9958-0" }, + { "9958-10", "9958-49" }, + { "9958-500", "9958-899" }, + { "9958-9000", "9958-9999" }, + + /* Libya */ + { "9959-0", "9959-1" }, + { "9959-20", "9959-79" }, + { "9959-800", "9959-949" }, + { "9959-9500", "9959-9999" }, + + /* Saudi Arabia */ + { "9960-00", "9960-59" }, + { "9960-600", "9960-899" }, + { "9960-9000", "9960-9999" }, + + /* Algeria */ + { "9961-0", "9961-2" }, + { "9961-30", "9961-69" }, + { "9961-700", "9961-949" }, + { "9961-9500", "9961-9999" }, + + /* Panama */ + { "9962-00", "9962-54" }, + { "9962-5500", "9962-5599" }, + { "9962-56", "9962-59" }, + { "9962-600", "9962-849" }, + { "9962-8500", "9962-9999" }, /* Cyprus */ - { "9963-0", "9963-1" }, - { "9963-30", "9963-44" }, - { "9963-550", "9963-599" }, - { "9963-7500", "9963-7846" }, + { "9963-0", "9963-2" }, + { "9963-30", "9963-54" }, + { "9963-550", "9963-749" }, + { "9963-7500", "9963-9999" }, /* Ghana */ { "9964-0", "9964-6" }, { "9964-70", "9964-94" }, - { "9964-950", "9964-990" }, + { "9964-950", "9964-999" }, - /* Kazakhstan (publisher range unknown) */ - { "9965-0", "9965-9" }, + /* Kazakhstan */ + { "9965-00", "9965-39" }, + { "9965-400", "9965-899" }, + { "9965-9000", "9965-9999" }, /* Kenya */ - { "9966-20", "9966-49" }, - { "9966-830", "9966-882" }, - { "9966-9840", "9966-9874" }, - - /* Kyrgyzstan (publisher range unknown) */ - { "9967-0", "9967-9" }, + { "9966-00", "9966-69" }, + { "9966-7000", "9966-7499" }, + { "9966-750", "9966-959" }, + { "9966-9600", "9966-9999" }, + + /* Kyrgyzstan */ + { "9967-00", "9967-39" }, + { "9967-400", "9967-899" }, + { "9967-9000", "9967-9999" }, /* Costa Rica */ - { "9968-9702", "9968-9703" }, - - /* Uganda (publisher range unknown) */ - { "9970-0", "9970-9" }, + { "9968-00", "9968-49" }, + { "9968-500", "9968-939" }, + { "9968-9400", "9968-9999" }, + + /* Uganda */ + { "9970-00", "9970-39" }, + { "9970-400", "9970-899" }, + { "9970-9000", "9970-9999" }, /* Singapore */ - { "9971-0", "9971-4" }, + { "9971-0", "9971-5" }, { "9971-60", "9971-89" }, { "9971-900", "9971-989" }, - { "9971-9900", "9971-9924" }, + { "9971-9900", "9971-9999" }, - /* Peru (publisher range unknown) */ - { "9972-0", "9972-9" }, + /* Peru */ + { "9972-00", "9972-09" }, + { "9972-1", "9972-1" }, + { "9972-200", "9972-249" }, + { "9972-2500", "9972-2999" }, + { "9972-30", "9972-59" }, + { "9972-600", "9972-899" }, + { "9972-9000", "9972-9999" }, /* Tunisia */ - { "9973-10", "9973-18" }, - { "9973-700", "9973-925" }, - { "9973-9700", "9973-9918" }, + { "9973-0", "9973-0" }, + { "9973-10", "9973-69" }, + { "9973-700", "9973-969" }, + { "9973-9700", "9973-9999" }, /* Uruguay */ - { "9974-0", "9974-0" }, - { "9974-30", "9974-36" }, - { "9974-550", "9974-580" }, - { "9974-7500", "9974-7505" }, - - /* Moldova (publisher range unknown) */ - { "9975-0", "9975-9" }, + { "9974-0", "9974-2" }, + { "9974-30", "9974-54" }, + { "9974-550", "9974-749" }, + { "9974-7500", "9974-9499" }, + { "9974-95", "9974-99" }, + + /* Moldova */ + { "9975-0", "9975-4" }, + { "9975-50", "9975-89" }, + { "9975-900", "9975-949" }, + { "9975-9500", "9975-9999" }, /* Tanzania */ - { "9976-1", "9976-5" }, - { "9976-60", "9976-84" }, - { "9976-900", "9976-988" }, - { "9976-9990", "9976-9992" }, + { "9976-0", "9976-5" }, + { "9976-60", "9976-89" }, + { "9976-900", "9976-989" }, + { "9976-9990", "9976-9999" }, /* Costa Rica */ { "9977-00", "9977-89" }, @@ -571,161 +828,323 @@ { "9977-9900", "9977-9999" }, /* Ecuador */ - { "9978-57", "9978-99" }, - { "9978-951", "9978-971" }, - { "9978-9904", "9978-9910" }, + { "9978-00", "9978-29" }, + { "9978-300", "9978-399" }, + { "9978-40", "9978-94" }, + { "9978-950", "9978-989" }, + { "9978-9900", "9978-9999" }, /* Iceland */ - { "9979-1", "9979-4" }, - { "9979-50", "9979-57" }, - { "9979-800", "9979-827" }, - { "9979-9000", "9979-9067" }, + { "9979-0", "9979-4" }, + { "9979-50", "9979-75" }, + { "9979-760", "9979-899" }, + { "9979-9000", "9979-9999" }, /* Papua New Guinea */ - { "9980-0", "9980-1" }, - { "9980-54", "9980-84" }, - { "9980-900", "9980-915" }, + { "9980-0", "9980-3" }, + { "9980-40", "9980-89" }, + { "9980-900", "9980-989" }, + { "9980-9900", "9980-9999" }, /* Morocco */ - { "9981-0", "9981-0" /* <-- no assignments yet */ }, + { "9981-00", "9981-09" }, + { "9981-100", "9981-159" }, + { "9981-1600", "9981-1999" }, + { "9981-20", "9981-79" }, + { "9981-800", "9981-949" }, + { "9981-9500", "9981-9999" }, /* Zambia */ - { "9982-00", "9982-30" }, - { "9982-800", "9982-815" }, - { "9982-9900", "9982-9900" }, + { "9982-00", "9982-79" }, + { "9982-800", "9982-989" }, + { "9982-9900", "9982-9999" }, /* Gambia */ - { "9983-85", "9983-87" }, - { "9983-9900", "9983-9901" }, - - /* Latvia (publisher range unknown) */ - { "9984-0", "9984-9" }, - - /* Estonia (publisher range unknown) */ - { "9985-0", "9985-9" }, - - /* Lithuania (publisher range unknown) */ - { "9986-0", "9986-9" }, + { "9983-80", "9983-94" }, + { "9983-950", "9983-989" }, + { "9983-9900", "9983-9999" }, + + /* Latvia */ + { "9984-00", "9984-49" }, + { "9984-500", "9984-899" }, + { "9984-9000", "9984-9999" }, + + /* Estonia */ + { "9985-0", "9985-4" }, + { "9985-50", "9985-79" }, + { "9985-800", "9985-899" }, + { "9985-9000", "9985-9999" }, + + /* Lithuania */ + { "9986-00", "9986-39" }, + { "9986-400", "9986-899" }, + { "9986-9000", "9986-9399" }, + { "9986-940", "9986-969" }, + { "9986-97", "9986-99" }, /* Tanzania */ - { "9987-30", "9987-30" }, - { "9987-550", "9987-583" }, - { "9987-8800", "9987-8823" }, + { "9987-00", "9987-39" }, + { "9987-400", "9987-879" }, + { "9987-8800", "9987-9999" }, /* Ghana */ - { "9988-0", "9988-0" /* <--no assignments yet */ }, - - /* Macedonia (publisher range unknown) */ - { "9989-0", "9989-9" }, - - /* Mauritius */ - { "99903-0", "99903-0" /* <--no assignments yet */ }, + { "9988-0", "9988-2" }, + { "9988-30", "9988-54" }, + { "9988-550", "9988-749" }, + { "9988-7500", "9988-9999" }, + + /* Macedonia */ + { "9989-0", "9989-0" }, + { "9989-100", "9989-199" }, + { "9989-2000", "9989-2999" }, + { "9989-30", "9989-59" }, + { "9989-600", "9989-949" }, + { "9989-9500", "9989-9999" }, + + /* Bahrain */ + { "99901-00", "99901-49" }, + { "99901-500", "99901-799" }, + { "99901-80", "99901-99" }, + + /* Mauritius [also 99949] */ + { "99903-0", "99903-1" }, + { "99903-20", "99903-89" }, + { "99903-900", "99903-999" }, /* Netherlands Antilles */ - { "99904-0", "99904-4" }, - { "99904-60", "99904-65" }, - { "99904-900", "99904-917" }, + { "99904-0", "99904-5" }, + { "99904-60", "99904-89" }, + { "99904-900", "99904-999" }, + + /* Bolivia */ + { "99905-0", "99905-3" }, + { "99905-40", "99905-79" }, + { "99905-800", "99905-999" }, + + /* Kuwait */ + { "99906-0", "99906-2" }, + { "99906-30", "99906-59" }, + { "99906-600", "99906-699" }, + { "99906-70", "99906-89" }, + { "99906-9", "99906-9" }, /* Malawi */ - { "99908-11", "99908-29" }, - { "99908-900", "99908-900" }, - - /* Malta (publisher range unknown) */ - { "99909-0", "99909-9" }, + { "99908-0", "99908-0" }, + { "99908-10", "99908-89" }, + { "99908-900", "99908-999" }, + + /* Malta */ + { "99909-0", "99909-3" }, + { "99909-40", "99909-94" }, + { "99909-950", "99909-999" }, + + /* Sierra Leone */ + { "99910-0", "99910-2" }, + { "99910-30", "99910-89" }, + { "99910-900", "99910-999" }, /* Lesotho */ - { "99911-00", "99911-32" }, - { "99911-600", "99911-860" }, + { "99911-00", "99911-59" }, + { "99911-600", "99911-999" }, /* Botswana */ - { "99912-0", "99912-5" }, - { "99912-60", "99912-79" }, - { "99912-900", "99912-900" }, + { "99912-0", "99912-4" }, + { "99912-500", "99912-599" }, + { "99912-60", "99912-89" }, + { "99912-900", "99912-999" }, /* Andorra */ - { "99913-0", "99913-0" /* <--no assignments yet */ }, + { "99913-0", "99913-2" }, + { "99913-30", "99913-35" }, + { "99913-600", "99913-604" }, /* Suriname */ { "99914-0", "99914-4" }, - { "99914-50", "99914-58" }, - { "99914-900", "99914-927" }, + { "99914-50", "99914-89" }, + { "99914-900", "99914-949" }, /* Maldives */ - { "99915-0", "99915-3" }, - { "99915-50", "99915-78" }, - { "99915-800", "99915-830" }, - - /* Namibia */ - { "99916-1", "99916-1" }, - { "99916-30", "99916-35" }, - { "99916-700", "99916-704" }, - - /* Benin (publisher range unknown) */ - { "99919-0", "99919-9" }, + { "99915-0", "99915-4" }, + { "99915-50", "99915-79" }, + { "99915-800", "99915-999" }, + + /* Namibia [also 99945] */ + { "99916-0", "99916-2" }, + { "99916-30", "99916-69" }, + { "99916-700", "99916-999" }, + + /* Brunei Darussalam */ + { "99917-0", "99917-2" }, + { "99917-30", "99917-89" }, + { "99917-900", "99917-999" }, + + /* Faroe Islands */ + { "99918-0", "99918-3" }, + { "99918-40", "99918-79" }, + { "99918-800", "99918-999" }, + + /* Benin */ + { "99919-0", "99919-2" }, + { "99919-40", "99919-69" }, + { "99919-900", "99919-999" }, /* Andorra */ - { "99920-0", "99920-2" }, - { "99920-50", "99920-55" }, - { "99920-900", "99920-904" }, - - /* Qatar (publisher range unknown) */ - { "99921-0", "99921-9" }, - - /* Guatemala (publisher range unknown) */ - { "99922-0", "99922-9" }, - - /* Nicaragua (publisher range unknown) */ - { "99924-0", "99924-9" }, - - /* From http://www.bowker.com/standards/home/isbn/international/hyphenation-instructions.html - The publisher prefix ranges in the English group (U.S., U.K., - Canada, Australia, New Zealand, etc) are as follows: - - Group If Number Ranges Insert Hyphens - Identifier "0" are Between After - ------------------------------------------------------------------- - 00.......19 00-19 1st 3rd 9th digit - 200......699 20-69 " 4th " - 7000.....8499 70-84 " 5th " - 85000....89999 85-89 " 6th " - 900000...949999 90-94 " 7th " - 9500000..9999999 95-99 " 8th " - - - - Group If Number Ranges Insert Hyphens - Identifier "1" are Between After - ------------------------------------------------------------------- - 55000....86979 5500-8697 1st 6th 9th digit - 869800...998999 8698-9989 " 7th " - 9990000..9999999 9990-9999 " 8th " - - - - The following table gives the range distribution of the group identifiers: - - 0 - 7 - 80 - 94 - 950 - 995 - 9960 - 9989 - 99900 - 99999 - - These ranges are already partially covered by ranges above, but - we include them here for completeness, unless they are identical - to one above, in which case, they are commented out. I have yet - to find comparable data for other language groups. */ - - - /* { "0-00", "0-19" }, */ - { "0-200", "0-699" }, - /* { "0-7000", "0-8499" }, */ - { "0-85000", "0-89999" }, - /* { "0-900000", "0-949999" }, */ - { "0-9500000", "0-9999999" }, - - { "1-55000", "1-86979" }, - { "1-869800", "1-998999" }, - { "1-9990000", "1-9999999" }, + { "99920-0", "99920-4" }, + { "99920-50", "99920-89" }, + { "99920-900", "99920-999" }, + + /* Qatar */ + { "99921-0", "99921-1" }, + { "99921-20", "99921-69" }, + { "99921-700", "99921-799" }, + { "99921-8", "99921-8" }, + { "99921-90", "99921-99" }, + + /* Guatemala */ + { "99922-0", "99922-3" }, + { "99922-40", "99922-69" }, + { "99922-700", "99922-999" }, + + /* El Salvador */ + { "99923-0", "99923-1" }, + { "99923-20", "99923-79" }, + { "99923-800", "99923-999" }, + + /* Nicaragua */ + { "99924-0", "99924-2" }, + { "99924-30", "99924-79" }, + { "99924-800", "99924-900" }, + + /* Paraguay */ + { "99925-0", "99925-3" }, + { "99925-40", "99925-79" }, + { "99925-800", "99925-999" }, + + /* Honduras */ + { "99926-0", "99926-0" }, + { "99926-10", "99926-59" }, + { "99926-600", "99926-999" }, + + /* Albania [also 99943] */ + { "99927-0", "99927-2" }, + { "99927-30", "99927-59" }, + { "99927-600", "99927-999" }, + + /* Georgia [also 99940] */ + { "99928-0", "99928-0" }, + { "99928-10", "99928-79" }, + { "99928-800", "99928-999" }, + + /* Mongolia */ + { "99929-0", "99929-0" /* <-no assignments yet */ }, + + /* Armenia [also 99941] */ + { "99930-0", "99930-4" }, + { "99930-50", "99930-79" }, + { "99930-800", "99930-999" }, + + /* Seychelles */ + { "99931-0", "99931-4" }, + { "99931-50", "99931-79" }, + { "99931-800", "99931-999" }, + + /* Malta [also 99909] */ + { "99932-0", "99932-0" }, + { "99932-10", "99932-59" }, + { "99932-600", "99932-699" }, + { "99932-7", "99932-7" }, + { "99932-80", "99932-99" }, + + /* Nepal [also 99946] */ + { "99933-0", "99933-2" }, + { "99933-30", "99933-59" }, + { "99933-600", "99933-999" }, + + /* Dominican Replublic [also 9945] */ + { "99934-0", "99934-1" }, + { "99934-20", "99934-79" }, + { "99934-800", "99934-999" }, + + /* Haiti */ + { "99935-0", "99935-2" }, + { "99935-30", "99935-59" }, + { "99935-600", "99935-799" }, + { "99935-8", "99935-8" }, + { "99935-90", "99935-99" }, + + /* Bhutan */ + { "99936-0", "99936-0" }, + { "99936-10", "99936-59" }, + { "99936-600", "99936-999" }, + + /* Macau */ + { "99937-0", "99937-1" }, + { "99937-20", "99937-59" }, + { "99937-600", "99937-999" }, + + /* Srpska */ + { "99938-0", "99938-2" }, + { "99938-30", "99938-59" }, + { "99938-600", "99938-899" }, + { "99938-90", "99938-99" }, + + /* Guatemala [also 99922] */ + { "99939-0", "99939-5" }, + { "99939-60", "99939-89" }, + { "99939-900", "99939-999" }, + + /* Georgia [also 99928] */ + { "99940-0", "99940-0" }, + { "99940-10", "99940-69" }, + { "99940-700", "99940-999" }, + + /* Armenia [also 99930] */ + { "99941-0", "99941-2" }, + { "99941-30", "99941-89" }, + { "99941-900", "99941-999" }, + + /* Sudan */ + { "99942-0", "99942-4" }, + { "99942-50", "99942-79" }, + { "99942-800", "99942-999" }, + + /* Albania [also 99927] */ + { "99943-0", "99943-2" }, + { "99943-30", "99943-59" }, + { "99943-600", "99943-999" }, + + /* Ethiopia */ + { "99944-0", "99944-4" }, + { "99944-50", "99944-79" }, + { "99944-800", "99944-999" }, + + /* Namibia [also 99916] */ + { "99945-0", "99945-5" }, + { "99945-60", "99945-89" }, + { "99945-900", "99945-999" }, + + /* Nepal [also 99933] */ + { "99946-0", "99946-2" }, + { "99946-30", "99946-59" }, + { "99946-600", "99946-999" }, + + /* Tajikistan */ + { "99947-0", "99947-0" /* <-no assignments yet */ }, + + /* Eritrea */ + { "99948-0", "99948-4" }, + { "99948-50", "99948-79" }, + { "99948-800", "99948-999" }, + + /* Mauritius [also 99903] */ + { "99949-0", "99949-1" }, + { "99949-20", "99949-89" }, + { "99949-900", "99949-999" }, + + /* Cambodia */ + { "99950-0", "99950-4" }, + { "99950-50", "99950-79" }, + { "99950-800", "99950-999" }, { (const char*)NULL, (const char*)NULL } }; --- bibclean-2.11.4.orig/fndfil.c +++ bibclean-2.11.4/fndfil.c @@ -118,6 +118,12 @@ again. If it is successful, the name[] string is replaced by the substituted name, so it can be later used to open the file. +SPECIAL DEBIAN ENHANCEMENT by Henning Makholm : +*Before* the initial lookup, if the filename contains the string +"/?undot?/", it will be replaced by a single slash (once), and if +it was followed by a full stop, that too will be deleted. This allows +searching for either /etc/foo or ~/.foo + ***********************************************************************/ #include @@ -317,6 +323,23 @@ } +static void +dot_hack(char *pc) +{ + char *s ; + static const char magic[] = SEP_PATH "?undot?" SEP_PATH ; + int i = strlen(magic) ; + while( strncmp(pc,magic,i) != 0 ) + if( !*pc++ ) + return ; + s = pc+i; + pc += strlen(SEP_PATH) ; + if( *s == '.' ) + s++ ; + while( (*pc++ = *s++) != 0 ) + ; +} + /*********************************************************************** Given a directory search path in pathlist[] and a file name in name[], search the path for an existing file. If one is found, return a @@ -432,6 +455,7 @@ (void)strncpy(&fullname[k],name,(size_t)(MAXPATHLEN-k)); /* append name */ fullname[MAXPATHLEN] = '\0'; /* strncpy may not supply this */ + dot_hack(fullname); if (isfile(fullname)) return ((char*)&fullname[0]); --- bibclean-2.11.4.orig/rangecvt.pl +++ bibclean-2.11.4/rangecvt.pl @@ -0,0 +1,88 @@ +#! /usr/bin/perl + +# This script takes the output of pdftotext on +# http://www.isbn-international.org/en/identifiers/List-of-Ranges.pdf +# and converts it to C source for the database section in isbn.c. + +# Written by Henning Makholm , December 2004 +# Changed (fighting bit rot), November 2005 +# Distribution of modified or unmodified versions of this file is +# permitted without any restrictions. + +use strict ; +use warnings ; + +my %groups ; + +if( open ISBNC, "<", "isbn.c" ) { + while( ) { + last if /ISBN_range\[\]/ ; + } + my $curcmt ; + while( ) { + if( /^\s+{ "(\d+)-\d+",\s+"(\d+)-\d+"/ && $1 eq $2 ) { + my $group = $1 ; + if( defined $curcmt && + $curcmt =~ /\*\/\s*$/ && + !exists $groups{$group} ) { + $groups{$group} = $curcmt ; + } + undef $curcmt ; + } elsif( /^\s*\/\*/ ) { + $curcmt = $_ ; + } elsif( /^\s*\};/ ) { + last ; + } elsif( defined $curcmt ) { + $curcmt .= $_ ; + } + } + close ISBNC ; +} + +print " /* Table generated by $0 */\n\n" ; + +my $prevgroup = '-' ; +sub putline($$$$) { + my ($group,$begin,$end,$extra) = @_ ; + if( $group ne $prevgroup ) { + print "\n" if $prevgroup ne '-' ; + if( exists $groups{$group} ) { + print $groups{$group} ; + } else { + print " /* XXX: group $group? */\n" ; + } + $prevgroup = $group ; + } + my $line = " { \"$group-$begin\",\t\"$group-$end\" $extra},\n" ; + $line =~ s[^(.*)\t][$1 . ("\t" x int((39-length $1)/8))]e ; + print $line ; +} + + +while( <> ) { + chomp ; + s/\f// ; + if( s/\((.*)// ) { + my $x = $1 ; + while( $x !~ /\)/ ) { + defined($x = <>) or die "unterminated parenthesis" ; + } + } + if( /^(\d+)\s+(\d+)(\s+|\s*-)\s*(\d+)\s*$/ && length($2) == length($4) ) { + putline($1,$2,$4,""); + } elsif( /^(\d+)\s+(\d+)\s*$/ ) { + putline($1,$2,$2,""); + } elsif( /^\s+(\d+)\s*(no ranges fixed yet\s*)?$/ ) { + putline($1,"0","0","/* <-no assignments yet */ "); + } elsif( /^(Group Number\s*Ranges)?\s*$/ ) { + # all OK + } else { + print STDERR "strange line '$_'\n" ; + } +} + +print "\n" ; +print " { (const char*)NULL,\t(const char*)NULL }\n" ; + + + --- bibclean-2.11.4.orig/configure.in +++ bibclean-2.11.4/configure.in @@ -130,6 +130,47 @@ AC_MSG_RESULT(no) ]) +# suppress caching of EXTERNAL_PAGER; different searches are made for +# different configurations. +unset ac_cv_path_EXTERNAL_PAGER +AC_ARG_WITH(pager, + [ --with-pager= use the specified external pager (eg, /bin/more)], + [case $withval in + no | /* | ?:/*) EXTERNAL_PAGER="$withval" ;; + yes) # Try to find a sensible pager to compile in. Feel free + # to extend the list of pagers looked for here + AC_PATH_PROGS(EXTERNAL_PAGER,pager more less,no) + case $EXTERNAL_PAGER in no) + AC_MSG_ERROR( + [No well-known pager found in \$PATH, please specify one]) + ;; + esac ;; + *) SAVED_PAGER="$withval" + AC_PATH_PROG(EXTERNAL_PAGER,"$SAVED_PAGER",no) + case $EXTERNAL_PAGER in no) + AC_MSG_ERROR( + [--with-pager=$SAVED_PAGER: not absolute pathname and not in \$PATH]) + ;; + esac ;; + esac], + [EXTERNAL_PAGER=no]) +case $EXTERNAL_PAGER in no) ;; *) + if test x"$ac_cv_header_unistd_h" = xyes ; then + AC_DEFINE(SCREEN_LINES,0) + AC_DEFINE_UNQUOTED(PAGER_PROGRAM,"$EXTERNAL_PAGER") + else + AC_MSG_WARN([unistd.h was not found, so --with-pager is ignored]) + fi ;; +esac + +BIBCLEANRC='$(bindir)/.bibcleanrc' +AC_ARG_WITH(fhs-rcfiles, + [ --with-fhs-rcfiles look for rcfiles in \$(datadir) or /etc, not \$PATH], + [case $withval in yes) AC_DEFINE(FHS_RCFILES,1) + BIBCLEANRC='$(datadir)/bibcleanrc' ;; + esac]) +AC_SUBST(BIBCLEANRC) + dnl Remove -g from CFLAGS if we are compiling with lcc because it dnl produces bad debug symbol tables on Sun Solaris 2.x. if test "$CC" = "lcc" @@ -138,3 +179,4 @@ fi AC_OUTPUT(Makefile) + --- bibclean-2.11.4.orig/bibclean.c +++ bibclean-2.11.4/bibclean.c @@ -1182,7 +1182,14 @@ do_preargs(argc,argv);/* some args must be handled BEFORE initializations */ if (read_initialization_files == YES) + { +#ifdef FHS_RCFILES + do_initfile("~;"DATADIR SEP_PATH "?undot?;/etc" SEP_PATH "?undot?", + initfile) ; +#else do_initfile(getenv(SYSPATH),initfile); +#endif /* FHS_RCFILES */ + } if (read_initialization_files == YES) do_initfile(getenv(USERPATH),initfile); @@ -1378,6 +1385,14 @@ out_s("\"\n"); } +#ifdef PAGER_PROGRAM +FILE *pager_pipe = 0 ; +static void +close_pager_pipe() +{ + pclose(pager_pipe); +} +#endif #if defined(HAVE_STDC) void @@ -1437,6 +1452,31 @@ (void)fputs(lines[k], fpout); } #else /* NOT (SCREEN_LINES > 0) */ + /* If the user wants messages, he may want to be able to collect + * them for mechanical processing. Sending them to stdout makes + * this easier. + */ + if( fpout == stderr ) + fpout = stdout ; + #ifdef PAGER_PROGRAM + /* Debian: if stderr is a terminal, then redirect to a pager. */ + if( pausing && fpout == stdout ) { + if ( pager_pipe == NULL && isatty(1) ) { + char *pager = getenv("PAGER"); + if( pager == NULL ) { + pager = PAGER_PROGRAM ; + /* Note: non-Debian systems might want to use "more" here */ + } + fflush(NULL); + if( (pager_pipe=popen(pager,"w")) != NULL ) + atexit(close_pager_pipe); + } + if ( pager_pipe == NULL ) + pager_pipe = stdout ; + else + fpout = pager_pipe ; + } + #endif /* PAGER_PROGRAQM */ for (k = 0; lines[k] != (const char*)NULL; k++) (void)fputs(lines[k], fpout); #endif /* (SCREEN_LINES > 0) */ --- bibclean-2.11.4.orig/bibclean.man +++ bibclean-2.11.4/bibclean.man @@ -32,6 +32,9 @@ .\" characters. This is produced by Robert .\" Solovay's checksum utility.", .\" } +.\" However, the checksums do not match because Henning Makholm changed +.\" details (about initialization file path) and removed stuff about +.\" non-UNIX behavior when he debianized bibclean. .\"===================================================================== .\" .if t .ds Bi B\s-2IB\s+2T\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X @@ -51,130 +54,56 @@ data base files .\"===================================================================== .SH SYNOPSIS -.B bibclean -[ -.B \-author -] -[ -.BI \-error-log " filename" -] -[ -.B \-help -] -.if n .ti +9n -[ -.B '\-?' -] -[ -.BI \-init-file " filename" -] -.if t .ti +.5i -[ -.BI \-max-width " nnn" -] -.if n .ti +9n -[ -.B \-[no-]align-equals -] -[ -.B \-[no-]check-values -] -.if n .ti +9n -[ -.B \-[no-]delete-empty-values -] -.if n .ti +9n -.if t .ti +.5i -[ -.B \-[no-]file-position -] -[ -.B \-[no-]fix-font-changes -] -.if n .ti +9n -[ -.B \-[no-]fix-initials -] -[ -.B \-[no-]fix-names -] -.if n .ti +9n -.if t .ti +.5i -[ -.B \-[no-]German-style -] -[ -.B \-[no-]keep-linebreaks -] -.if n .ti +9n -[ -.B \-[no-]keep-parbreaks -] -.if n .ti +9n -.if t .ti +.5i -[ -.B \-[no-]keep-preamble-spaces -] -.if n .ti +9n -[ -.B \-[no-]keep-spaces -] -[ -.B \-[no-]keep-string-spaces -] -.if n .ti +9n -.if t .ti +.5i -[ -.B \-[no-]parbreaks -] -[ -.B \-[no-]prettyprint -] -.if n .ti +9n -[ -.B \-[no-]print-patterns -] -.if t .ti +.5i -[ -.BI \-[no-]read-init-files -] -.if n .ti +9n -[ -.B \-[no-]remove-OPT-prefixes -] -[ -.B \-[no-]scribe -] -.if n .ti +9n -.if t .ti +.5i -[ -.B \-[no-]trace-file-opening -] -[ -.B \-[no-]warnings -] -.if n .ti +9n -[ -.B \-version -] -.if n .ti +9n -.if t .ti +.5i -.IR "outfile" -.PP +.\" Select right justification and no hyphenation, +.\" first save the old state in registers yy and jj. +.nr yy 1 +.ie \n(.g .nr yy \n[.hy] \" Plain troff has no such register. Sigh. +.nr jj \n(.j +.ad l +.nh +.HP "\w'\fBbibclean 'u" +.B bibclean +[\ \fB\-author\fR\ ] +[\ \fB\-error\-log\ \fIfilename\fR\ ] +[\ \fB\-help\fR\ ] +[\ \fB\-?\fR\ ] +[\ \fB\-init\-file\ \fIfilename\fR\ ] +[\ \fB\-long\-field\ \fIfieldname\fR\ ] +[\ \fB\-max\-width\ \fInnn\fR\ ] +[\ \fB\-[no\-]align\-equals\fR\ ] +[\ \fB\-[no\-]check\-values\fR\ ] +[\ \fB\-[no\-]delete\-empty\-values\fR\ ] +[\ \fB\-[no\-]file\-position\fR\ ] +[\ \fB\-[no\-]fix\-font\-changes\fR\ ] +[\ \fB\-[no\-]fix\-initials\fR\ ] +[\ \fB\-[no\-]fix\-names\fR\ ] +[\ \fB\-[no\-]German\-style\fR\ ] +[\ \fB\-[no\-]keep\-linebreaks\fR\ ] +[\ \fB\-[no\-]keep\-parbreaks\fR\ ] +[\ \fB\-[no\-]keep\-preamble\-spaces\fR\ ] +[\ \fB\-[no\-]keep\-spaces\fR\ ] +[\ \fB\-[no\-]keep\-string\-spaces\fR\ ] +[\ \fB\-[no\-]parbreaks\fR\ ] +[\ \fB\-[no\-]prettyprint\fR\ ] +[\ \fB\-[no\-]print\-patterns\fR\ ] +[\ \fB\-[no\-]read\-init\-files\fR\ ] +[\ \fB\-[no\-]remove\-OPT\-prefixes\fR\ ] +[\ \fB\-[no\-]scribe\fR\ ] +[\ \fB\-[no\-]trace\-file\-opening\fR\ ] +[\ \fB\-[no\-]warnings\fR\ ] +[\ \fB\-version\fR\ ] +(\ \fB<\fIinfile\fR\ |\ \fIbibfile1\ bibfile2\ bibfile3\ .\|.\|.\fR\ ) +\fB>\fIoutfile\fR +.PP +.\" Restore hyphenation and adjustment mode +.hy \n(yy +.ad \n(jj All options can be abbreviated to a unique leading prefix. .PP An explicit file name of ``\-'' represents standard input; it is assumed if no input files are specified. -.PP -On VAX VMS and IBM PC DOS, the leading ``\-'' on -option names may be replaced by a slash, ``/''; -however, the ``\-'' option prefix is always -recognized. .\"===================================================================== .SH DESCRIPTION .B bibclean @@ -297,7 +226,7 @@ or .IR ./-foo.bib . .\"----------------------------------------------- -.TP \w'\-[no-]remove-OPT-prefixes'u+3n +.TP 1in .B \-author Display an author credit on the standard error unit, .IR stderr , @@ -329,30 +258,22 @@ Provide an explicit value pattern initialization file. It will be processed .I after -any system-wide and job-wide initialization files -found on the -.B PATH -(for VAX VMS, -.BR SYS$SYSTEM ) -and -.B BIBINPUTS -search paths, respectively, and may override them. +any system-wide and job-wide initialization files, +and may override them. It in turn may be overridden by a subsequent -file-specific initialization file. The -initialization file name can be changed at compile -time, or at run time through a setting of the -environment variable -.BR BIBCLEANINI , -but defaults to -.I .bibcleanrc -on UNIX, and to -.I bibclean.ini -elsewhere. +file-specific initialization file. For further details, see the .B "INITIALIZATION FILES" manual section. .\"----------------------------------------------- .TP +.BI \-long-field " fieldname" +Suppress warnings that field named +.I fieldname +have lenghts exceeding the standard BibTeX limits. +.B NB! This is a Debian-specific extension! +.\"----------------------------------------------- +.TP .BI \-max-width " nnn" .B bibclean normally limits output line widths to 72 @@ -616,10 +537,7 @@ newly-added patterns, or to see what patterns are being used. .IP -When -.B bibclean -is compiled with native pattern-matching code (the -default), these patterns are the ones that will be +These patterns are the ones that will be used in checking value strings for valid syntax, and all of them are specified in initialization files, rather than hard-coded into the program. @@ -806,9 +724,9 @@ entirely from initialization files. .RE .PP -The second and third versions are the ones of most -interest here, because they allow the user to -control what values are considered acceptable. +This Debianized version of +.B bibclean +uses the third version. However, command-line options can also be specified in initialization files, no matter which pattern matching choice was selected. @@ -816,12 +734,29 @@ When .B bibclean starts, it searches for initialization files, -finding the first one in the system executable -program search path (on UNIX and IBM PC DOS, -.BR PATH ) -and the first one in the +using the first one of +.BR $(HOME)/.bibcleanrc , +.BR /usr/share/bibcleanrc , +and +.B /etc/bibcleanrc +that exists. +Afterwards, it reads the first +.B .bibcleanrc +found in the .B BIBINPUTS -search path, and processes them in turn. Then, +search path. +The name +.B .bibcleanrc +can be changed at run time through a setting of the +environment variable +.BR BIBCLEANINI . +If the name starts with a dot, it will be stripped +when looking in +.B /usr/share +and +.BR /etc . +.PP +Then, when command-line arguments are processed, any additional files specified by .BI \-init-file filename @@ -1211,9 +1146,6 @@ patterns are even used in these three cases. .TP \(bu -When -.B bibclean -is compiled with pattern-matching code support, .IR chapter , .IR number , .IR pages , @@ -1481,34 +1413,15 @@ Name of .B bibclean initialization files. Default: -.IR .bibcleanrc " (UNIX)," -.IR bibclean.ini " (non-UNIX)." +.IR .bibcleanrc . .TP .B BIBINPUTS Search path for .B bibclean -and \*(Bi input files. On UNIX, this is a +and \*(Bi input files. This is a colon-separated list of directories that are searched in order from first to last. It is not an error for a specified directory to not exist. -.IP -On other operating systems, the directory names -should be separated by whatever character is used -in system search path specifications, such as a -semicolon on IBM PC DOS. -.TP -.B PATH -On Atari TOS, IBM PC DOS, IBM PC OS/2, Microsoft -NT, and UNIX, search path for system executable -files. The system-wide -.B bibclean -initialization file is searched for in this path. -.TP -.B SYS$SYSTEM -On VAX VMS, search path for system executable -files and the system-wide -.B bibclean -initialization file. .\"===================================================================== .SH FILES .TP \w'\fIbibclean.ini\fP'u+3n @@ -1518,11 +1431,11 @@ .I *.ini File-specific initialization files. .TP -.I .bibcleanrc -UNIX system-wide and user-specific initialization files. +.IR /usr/share/bibcleanrc ", " /etc/bibcleanrc +System-wide initialization files. .TP -.I bibclean.ini -Non-UNIX system-wide and user-specific initialization files. +.I .bibcleanrc +User-specific initialization files. .\"===================================================================== .SH "SEE ALSO" .BR bibcheck (1), @@ -1559,6 +1472,19 @@ Email: beebe@math.utah.edu, beebe@acm.org, beebe@ieee.org (Internet) URL: http://www.math.utah.edu/~beebe .fi +.PP +This Debianization of +.B bibclean +was done by Henning Makholm , and +differs from the upstream source in where it looks for the system-wide +initialization file (vanilla +.B bibclean +expects to find it in +.BR $PATH ), +and has also been patched to ignore the built-in +\*(Bi\& field-length limit for +.I abstract +fields. .\"===================================================================== .\" This is for GNU Emacs file-specific customization: .\" Local Variables: --- bibclean-2.11.4.orig/config.hin +++ bibclean-2.11.4/config.hin @@ -2,6 +2,11 @@ changes in custom.h, so that they can override assumptions made in the automatically-generated config.h file */ +/* Define to look for system-wide .bibcleanrc file as + * /usr/local/share/bibcleanrc or /etc/bibcleanrc instead of + * searching $PATH for a .bibcleanrc */ +#undef FHS_RCFILES + #undef STDC_HEADERS #undef _ALL_SOURCE @@ -83,7 +88,10 @@ #undef HAVE_IOCTL_PROTOTYPE -#define RCSID(s) static char rcsid[] = s; +#ifndef __GNUC__ +#define __attribute__(x) +#endif +#define RCSID(s) static char rcsid[] __attribute__((unused)) = s; #define OS_UNIX 1 @@ -99,6 +107,7 @@ #define VOID #endif +#undef PAGER_PROGRAM #define SCREEN_LINES 24 /*********************************************************************** --- bibclean-2.11.4.orig/option.c +++ bibclean-2.11.4/option.c @@ -6,8 +6,9 @@ #include "ch.h" #include "yesorno.h" +#include "longflds.h" -#define BIBCLEAN_VERSION "bibclean Version 2.11.4 [09-May-1998]" +#define BIBCLEAN_VERSION "bibclean Version 2.11.4 [09-May-1998] (debian)" typedef struct s_option_function_entry { @@ -56,6 +57,7 @@ OPTION_FUNCTION_ENTRY table_[])); extern void check_inodes ARGS((void)); extern void do_initfile ARGS((const char *pathlist_,const char *name_)); +extern void fatal ARGS((const char *msg_)); #if (SCREEN_LINES > 0) extern int get_screen_lines ARGS((void)); @@ -83,6 +85,7 @@ static void opt_keep_preamble_spaces ARGS((void)); static void opt_keep_spaces ARGS((void)); static void opt_keep_string_spaces ARGS((void)); +static void opt_long_fields ARGS((void)); static void opt_max_width ARGS((void)); static void opt_parbreaks ARGS((void)); static void opt_prettyprint ARGS((void)); @@ -134,6 +137,7 @@ {"keep-preamble-spaces", 7, opt_keep_preamble_spaces}, {"keep-spaces", 7, opt_keep_spaces}, {"keep-string-spaces", 7, opt_keep_string_spaces}, + {"long-field", 1, opt_long_fields}, {"max-width", 1, opt_max_width}, {"no-align-equals", 4, opt_align_equals}, {"no-check-values", 4, opt_check_values}, @@ -376,7 +380,7 @@ }; help_lines[1] = program_name; /* cannot have this in initializer */ - out_lines(stdlog, help_lines, (screen_lines > 0) ? YES : NO); + out_lines(stdlog, help_lines, YES); exit(EXIT_SUCCESS); } @@ -432,6 +436,23 @@ static void +opt_long_fields(VOID) +{ + struct long_field_struct *link ; + current_index++; + link = (struct long_field_struct *) + malloc(sizeof(struct long_field_struct) + + strlen(next_option) + 1); + if( link ) { + link->next = long_fields ; + strcpy(link->fieldname, next_option); + long_fields = link ; + } else + fatal("Out of memory for long field names"); +} + + +static void opt_max_width(VOID) { current_index++; --- bibclean-2.11.4.orig/debian/dirs +++ bibclean-2.11.4/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/share +etc --- bibclean-2.11.4.orig/debian/README.Debian +++ bibclean-2.11.4/debian/README.Debian @@ -0,0 +1,42 @@ +Changes from upstream version: + +* Changed strategy for finding global initialization file. Upstream + bibclean wants to put .bibcleanrc in the $PATH, which is seriously + wrong on unix. Implemented new search strategy that looks for + $(HOME)/.bibcleanrc (per-user override) + $(datadir)/bibcleanrc (system defaults for non-root install) + /etc/bibcleanrc (as specified by Debian policy) + +* Patched to support the new 13-digit ISBN format that will gadually + come into use during 2005 and 2006. + +* Patched to not complain about the length of 'abstract' + fields. These are supposed to be long, and people who use + .bst files that want to read the abstract fields know that + they have to use an enlarged bibtex command anyway. + + More "long" fields can be added with a new -long-field option. + +* Use an external pager instead of upstream's built-in one + for paging through the long -help text. Print small requested + banners to stdout instead of stderr. + +* Some cosmetic fixes in the manual page, and information about + non-unix behavior removed. + +These changes are interesting only for people looking at the source: + +* Incomplete autoconfiscating of Makefile.in fixed. + +* Attempt to use 'rcp -p' as an install program fixed. + +* Do not remove doc/bibclean.dvi when cleaning; it cannot + always be remade automatically. Apparently the TeX source has + gotten bit rot, it does not TeX cleanly. Even if it did, we + don't want to build-depend on an entire TeX installation. + +* Changed the definition of RCSID in config.hin to suppress warnings + under gcc. + + -- Henning Makholm , Wed Dec 29 08:19:05 2004 + --- bibclean-2.11.4.orig/debian/copyright +++ bibclean-2.11.4/debian/copyright @@ -0,0 +1,68 @@ +This package was debianized by Henning Makholm on +September 7-21, 2003. + +It was downloaded from + http://www.math.utah.edu/pub/bibclean/bibclean-2.11.4.tar.gz + +Upstream Author: + Nelson H. F. Beebe + +Copyright: + The upstream tarball contains no copyright notices, but the + following email from the author makes it clear that it is intended + to be "in the public domain, and freely distributable and + modifiable": + +Date: Sat, 20 Sep 2003 08:43:14 -0600 (MDT) +From: "Nelson H. F. Beebe" +To: Henning Makholm +Cc: beebe@math.utah.edu +X-US-Mail: "Center for Scientific Computing, Department of Mathematics, 110 + LCB, University of Utah, 155 S 1400 E RM 233, Salt Lake City, UT + 84112-0090, USA" +X-Telephone: +1 801 581 5254 +X-FAX: +1 801 585 1640, +1 801 581 4148 +X-URL: http://www.math.utah.edu/~beebe +Subject: Re: Request for license clarification for bibclean +In-Reply-To: Your message of Sat, 20 Sep 2003 16:14:26 +0200 +Message-ID: + +Thanks for your query about the licensing issue with bibclean. + +I am of course happy to see bibclean used and freely distributed. In +the past, I have not placed explicit licenses on my software packages, +expecting them to be consider in the public domain, and freely +distributable and modifiable. However, at the urging of Karl Berry +and Richard Stallman in their response to instances of unscrupulous +reuse of free software, I have starting adding explicit GPL licensing +as new package releases come out. It is not practical to retrofit +such licenses into older releases. + +The next release of bibclean will have such a license. + +I am at the tail end of a year-long book project, so many of my +software projects have been delayed. + +Recently, I found some time to work on the next version of bibclean, +which is primarily polishing of packaging, and enhancing portability +even further. That version will be bibclean-2-14, but it is quite +likely that it won't be out before late fall this year. + +It would therefore make sense to delay your Debian packaging until +then. In the meantime, you can continue to point people to the +official archive at + + ftp://ftp.math.utah.edu/pub/bibclean + http://www.math.utah.edu/pub/bibclean + +------------------------------------------------------------------------------- +- Nelson H. F. Beebe Tel: +1 801 581 5254 - +- Center for Scientific Computing FAX: +1 801 581 4148 - +- University of Utah Internet e-mail: beebe@math.utah.edu - +- Department of Mathematics, 110 LCB beebe@acm.org beebe@computer.org - +- 155 S 1400 E RM 233 - +- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe - +------------------------------------------------------------------------------- + + + --- bibclean-2.11.4.orig/debian/changelog +++ bibclean-2.11.4/debian/changelog @@ -0,0 +1,59 @@ +bibclean (2.11.4-7) unstable; urgency=low + + * QA upload. + + Set maintainer to Debian QA Group . + * Make clean not ignore errors. + * Move URL from package description to Homepage. + * Remove strip from Makefile.in. (Closes: #436582). + * Update debhelper build-dep to >= 5. + * Move DH_COMPAT from rules to debian/compat and set to 5. + * Bump Standards Version to 3.8.1. + + -- Barry deFreese Mon, 27 Apr 2009 22:12:51 -0400 + +bibclean (2.11.4-6) unstable; urgency=low + + * Add watch file + * Update ISBN prefix range database in isbn.c with current ranges + + -- Henning Makholm Wed, 9 Nov 2005 22:39:58 +0100 + +bibclean (2.11.4-5) unstable; urgency=low + + * Support the new ISDN-13 format (validation and format canonicalization). + * Update ISBN prefix range database in isbn.c with fresh data from + www.isbn-international.org. + + -- Henning Makholm Wed, 29 Dec 2004 14:27:06 +0000 + +bibclean (2.11.4-4) unstable; urgency=low + + * Add lintian override for false positive (GPL) + * Now lintian clean. + * Show all options on manual page + + -- Henning Makholm Tue, 28 Dec 2004 20:01:28 +0000 + +bibclean (2.11.4-3) unstable; urgency=low + + * Fix the autotools timestamp skew problem for configure/configure.in. + Thanks to Martin Loschwitz for noticing that my previous attempt at + fixing this did not work reliably (due to upstream shipping a + Makefile in his tarball rather than just a Makefile.in). + * Tune generation of the canned help text in bibclean.h such that + its layout matches that distributed by upstream better. + + -- Henning Makholm Tue, 24 Feb 2004 20:58:56 +0000 + +bibclean (2.11.4-2) unstable; urgency=low + + * Minor speling fixes (Closes: #215863) + + -- Henning Makholm Sat, 6 Dec 2003 16:26:49 +0000 + +bibclean (2.11.4-1) unstable; urgency=low + + * Initial Debian release. (Closes: #211799) + + -- Henning Makholm Sun, 21 Sep 2003 17:01:56 +0100 + --- bibclean-2.11.4.orig/debian/compat +++ bibclean-2.11.4/debian/compat @@ -0,0 +1 @@ +5 --- bibclean-2.11.4.orig/debian/watch +++ bibclean-2.11.4/debian/watch @@ -0,0 +1,2 @@ +version=2 +http://www.math.utah.edu/pub/bibclean/ bibclean-(\d+\.[\d\.]+)\.tar\.gz --- bibclean-2.11.4.orig/debian/rules +++ bibclean-2.11.4/debian/rules @@ -0,0 +1,96 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +CFLAGS = -Wall -g +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +# This target makes sure that timestamps of files are in the +# right order after dpkg-deb has unpacked the package. It prevents +# the upstream Makefile from trying to regenerate the files (which +# would be problematic because we don't build-depend on the appropriate +# tools). +autogen-check: configure bibclean.h + dh_testdir + touch configure + touch bibclean.h + +config.status: autogen-check + CFLAGS="$(CFLAGS)" ./configure \ + --with-pager=/usr/bin/pager --with-fhs-rcfiles \ + --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ + --prefix=/usr --mandir=\$${prefix}/share/man + +build: build-stamp + +build-stamp: config.status + $(MAKE) + touch build-stamp + +clean: autogen-check + [ -z "`find -uid 0`" ] || dh_testroot + rm -f build-stamp + [ ! -f Makefile ] || $(MAKE) -o config.status -o Makefile.in distclean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + $(MAKE) install-exe prefix=$(CURDIR)/debian/bibclean/usr + mv debian/bibclean/usr/share/bibcleanrc debian/bibclean/etc/ + rm debian/bibclean/usr/bin/bibclean-* + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + echo misc:Depends= > debian/bibclean.substvars + dh_testdir + dh_testroot + dh_installdirs $(LINTIAN) + dh_installdocs doc/bibclean.dvi + dh_installman bibclean.man + dh_installchangelogs ChangeLog + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install autogen-check + +# The following two rules will should not fire when the Debian source +# package is unpacked, because the two files in question should already +# exist in that case. However, they *will* fire for a clean checkout +# of my cvs repository, e.g. when cvs-buildpackage runs the clean +# target before creating a source package. +configure: + dh_testdir + autoconf2.13 + +# Special magic to reproduce the same layout as the bibclean.h +# distributed by upstream: +bibclean.h: + dh_testdir + make -f Makefile.in AWK=awk NROFF='nroff -rLL=74n' SED=sed bibclean.h + perl -pi -e's/" /"/' bibclean.h --- bibclean-2.11.4.orig/debian/control +++ bibclean-2.11.4/debian/control @@ -0,0 +1,17 @@ +Source: bibclean +Section: tex +Priority: optional +Maintainer: Debian QA Group +Build-Depends: debhelper (>= 5.0.0) +Standards-Version: 3.8.1 +Homepage: http://ftp.math.utah.edu/pub//bibclean/ + +Package: bibclean +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: tex +Description: pretty-printer for BibTeX databases + This is a pretty-printer and syntax-checker for bibliographic + databases in the BibTeX format. It is a useful tool for canonicalizing + the layout of personal bibliographies with entries fetched from many + different sources. --- bibclean-2.11.4.orig/doc/Makefile +++ bibclean-2.11.4/doc/Makefile @@ -73,7 +73,7 @@ clean mostlyclean: $(RM) *.blg - $(RM) *.dvi* +# $(RM) *.dvi* $(RM) *.idw $(RM) *.ilg $(RM) *.log