diff --git a/Changelog b/Changelog index 9fd60f5..b3b13f3 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,9 @@ +1.2.6: +FIXED: the binary driver (NOTEDB::binary) encounters now if a note + entry is bigger then MaxNoteByte. It prints the overlapping + part to STDERR, and a warning message and finally saves + the complete, unchanged note entry to an external text file. + ================================================================================ 1.2.5: FIXED: removed any file/path actions using '/'. replaced by portable diff --git a/Makefile.old b/Makefile.old index 258eed0..a6913e6 100644 --- a/Makefile.old +++ b/Makefile.old @@ -1,7 +1,7 @@ # This Makefile is for the NOTEDB extension to perl. # # It was generated automatically by MakeMaker version -# 6.03 (Revision: 1.63) from the contents of +# 6.17 (Revision: 1.133) from the contents of # Makefile.PL. Don't edit this file, edit Makefile.PL instead. # # ANY CHANGES MADE HERE WILL BE LOST! @@ -19,7 +19,7 @@ # --- MakeMaker const_config section: -# These definitions are from config.sh (via /usr/lib/perl/5.8.0/Config.pm) +# These definitions are from config.sh (via /usr/lib/perl/5.8/Config.pm) # They may have been overridden via Makefile.PL or on the command line AR = ar @@ -31,74 +31,103 @@ DLSRC = dl_dlopen.xs LD = cc LDDLFLAGS = -shared -L/usr/local/lib LDFLAGS = -L/usr/local/lib -LIBC = /lib/libc-2.3.1.so +LIBC = /lib/libc-2.3.2.so LIB_EXT = .a OBJ_EXT = .o OSNAME = linux -OSVERS = 2.4.19 +OSVERS = 2.4.22-xfs+ti1211 RANLIB = : +SITELIBEXP = /usr/local/share/perl/5.8.3 +SITEARCHEXP = /usr/local/lib/perl/5.8.3 SO = so EXE_EXT = FULL_AR = /usr/bin/ar +VENDORARCHEXP = /usr/lib/perl5 +VENDORLIBEXP = /usr/share/perl5 # --- MakeMaker constants section: AR_STATIC_ARGS = cr +DIRFILESEP = / NAME = NOTEDB -DISTNAME = NOTEDB NAME_SYM = NOTEDB VERSION = 1.3 +VERSION_MACRO = VERSION VERSION_SYM = 1_3 +DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" XS_VERSION = 1.3 +XS_VERSION_MACRO = XS_VERSION +XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" INST_ARCHLIB = blib/arch INST_SCRIPT = blib/script INST_BIN = blib/bin INST_LIB = blib/lib +INST_MAN1DIR = blib/man1 +INST_MAN3DIR = blib/man3 +MAN1EXT = 1p +MAN3EXT = 3pm INSTALLDIRS = site +DESTDIR = PREFIX = /usr +PERLPREFIX = $(PREFIX) SITEPREFIX = $(PREFIX)/local VENDORPREFIX = $(PREFIX) -INSTALLPRIVLIB = $(PREFIX)/share/perl/5.8.0 -INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.8.0 +INSTALLPRIVLIB = $(PERLPREFIX)/share/perl/5.8 +DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB) +INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.8.3 +DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB) INSTALLVENDORLIB = $(VENDORPREFIX)/share/perl5 -INSTALLARCHLIB = $(PREFIX)/lib/perl/5.8.0 -INSTALLSITEARCH = $(SITEPREFIX)/lib/perl/5.8.0 +DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB) +INSTALLARCHLIB = $(PERLPREFIX)/lib/perl/5.8 +DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB) +INSTALLSITEARCH = $(SITEPREFIX)/lib/perl/5.8.3 +DESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH) INSTALLVENDORARCH = $(VENDORPREFIX)/lib/perl5 -INSTALLBIN = $(PREFIX)/bin +DESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH) +INSTALLBIN = $(PERLPREFIX)/bin +DESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN) INSTALLSITEBIN = $(SITEPREFIX)/bin +DESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN) INSTALLVENDORBIN = $(VENDORPREFIX)/bin -INSTALLSCRIPT = $(PREFIX)/bin -PERL_LIB = /usr/share/perl/5.8.0 -PERL_ARCHLIB = /usr/lib/perl/5.8.0 -SITELIBEXP = /usr/local/share/perl/5.8.0 -SITEARCHEXP = /usr/local/lib/perl/5.8.0 +DESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN) +INSTALLSCRIPT = $(PERLPREFIX)/bin +DESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT) +INSTALLMAN1DIR = $(PERLPREFIX)/share/man/man1 +DESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR) +INSTALLSITEMAN1DIR = $(SITEPREFIX)/man/man1 +DESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR) +INSTALLVENDORMAN1DIR = $(VENDORPREFIX)/share/man/man1 +DESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR) +INSTALLMAN3DIR = $(PERLPREFIX)/share/man/man3 +DESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR) +INSTALLSITEMAN3DIR = $(SITEPREFIX)/man/man3 +DESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR) +INSTALLVENDORMAN3DIR = $(VENDORPREFIX)/share/man/man3 +DESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR) +PERL_LIB = /usr/share/perl/5.8 +PERL_ARCHLIB = /usr/lib/perl/5.8 LIBPERL_A = libperl.a FIRST_MAKEFILE = Makefile -MAKE_APERL_FILE = Makefile.aperl +MAKEFILE_OLD = $(FIRST_MAKEFILE).old +MAKE_APERL_FILE = $(FIRST_MAKEFILE).aperl PERLMAINCC = $(CC) -PERL_INC = /usr/lib/perl/5.8.0/CORE +PERL_INC = /usr/lib/perl/5.8/CORE PERL = /usr/bin/perl FULLPERL = /usr/bin/perl +ABSPERL = $(PERL) PERLRUN = $(PERL) FULLPERLRUN = $(FULLPERL) +ABSPERLRUN = $(ABSPERL) PERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" FULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" -ABSPERL = $(PERL) -ABSPERLRUN = $(ABSPERL) ABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" -FULL_AR = /usr/bin/ar PERL_CORE = 0 -NOOP = $(SHELL) -c true -NOECHO = @ +PERM_RW = 644 +PERM_RWX = 755 -VERSION_MACRO = VERSION -DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" -XS_VERSION_MACRO = XS_VERSION -XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" -PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc - -MAKEMAKER = /usr/share/perl/5.8.0/ExtUtils/MakeMaker.pm -MM_VERSION = 6.03 +MAKEMAKER = /usr/share/perl/5.8/ExtUtils/MakeMaker.pm +MM_VERSION = 6.17 +MM_REVISION = 1.133 # FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle). # BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle) @@ -114,61 +143,36 @@ LDFROM = $(OBJECT) LINKTYPE = dynamic # Handy lists of source code files: -XS_FILES= -C_FILES = -O_FILES = -H_FILES = +XS_FILES = +C_FILES = +O_FILES = +H_FILES = MAN1PODS = MAN3PODS = NOTEDB/binary.pm \ NOTEDB/dbm.pm \ NOTEDB/mysql.pm \ note.pod -INST_MAN1DIR = blib/man1 -MAN1EXT = 1p -INSTALLMAN1DIR = $(PREFIX)/share/man/man1 -INSTALLSITEMAN1DIR = $(SITEPREFIX)/man/man1 -INSTALLVENDORMAN1DIR = $(VENDORPREFIX)/share/man/man1 -INST_MAN3DIR = blib/man3 -MAN3EXT = 3pm -INSTALLMAN3DIR = $(PREFIX)/share/man/man3 -INSTALLSITEMAN3DIR = $(SITEPREFIX)/man/man3 -INSTALLVENDORMAN3DIR = $(VENDORPREFIX)/share/man/man3 -PERM_RW = 644 -PERM_RWX = 755 - -# work around a famous dec-osf make(1) feature(?): -makemakerdflt: all - -.SUFFIXES: .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) - -# Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that -# some make implementations will delete the Makefile when we rebuild it. Because -# we call false(1) when we rebuild it. So make(1) is not completely wrong when it -# does so. Our milage may vary. -# .PRECIOUS: Makefile # seems to be not necessary anymore - -.PHONY: all config static dynamic test linkext manifest # Where is the Config information that we are using/depend on -CONFIGDEP = $(PERL_ARCHLIB)/Config.pm $(PERL_INC)/config.h +CONFIGDEP = $(PERL_ARCHLIB)$(DIRFILESEP)Config.pm $(PERL_INC)$(DIRFILESEP)config.h -# Where to put things: +# Where to build things INST_LIBDIR = $(INST_LIB) INST_ARCHLIBDIR = $(INST_ARCHLIB) INST_AUTODIR = $(INST_LIB)/auto/$(FULLEXT) INST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT) -INST_STATIC = -INST_DYNAMIC = -INST_BOOT = - -EXPORT_LIST = - -PERL_ARCHIVE = +INST_STATIC = +INST_DYNAMIC = +INST_BOOT = +# Extra linker info +EXPORT_LIST = +PERL_ARCHIVE = PERL_ARCHIVE_AFTER = + TO_INST_PM = NOTEDB.pm \ NOTEDB/README \ NOTEDB/binary.pm \ @@ -176,23 +180,28 @@ TO_INST_PM = NOTEDB.pm \ NOTEDB/mysql.pm \ note.pod -PM_TO_BLIB = NOTEDB/mysql.pm \ - blib/lib/NOTEDB/mysql.pm \ +PM_TO_BLIB = NOTEDB/README \ + $(INST_LIB)/NOTEDB/README \ + NOTEDB/mysql.pm \ + $(INST_LIB)/NOTEDB/mysql.pm \ NOTEDB/dbm.pm \ - blib/lib/NOTEDB/dbm.pm \ - NOTEDB/README \ - blib/lib/NOTEDB/README \ + $(INST_LIB)/NOTEDB/dbm.pm \ NOTEDB/binary.pm \ - blib/lib/NOTEDB/binary.pm \ - note.pod \ - blib/lib/note.pod \ + $(INST_LIB)/NOTEDB/binary.pm \ NOTEDB.pm \ - blib/lib/NOTEDB.pm + $(INST_LIB)/NOTEDB.pm \ + note.pod \ + $(INST_LIB)/note.pod + + +# --- MakeMaker platform_constants section: +MM_Unix_VERSION = 1.42 +PERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc -Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc # --- MakeMaker tool_autosplit section: # Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto -AUTOSPLITFILE = $(PERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1) ;' +AUTOSPLITFILE = $(PERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0, 1, 1)' @@ -200,71 +209,52 @@ AUTOSPLITFILE = $(PERLRUN) -e 'use AutoSplit; autosplit($$ARGV[0], $$ARGV[1], 0 # --- MakeMaker tools_other section: - SHELL = /bin/sh CHMOD = chmod CP = cp -LD = cc MV = mv NOOP = $(SHELL) -c true +NOECHO = @ RM_F = rm -f RM_RF = rm -rf TEST_F = test -f TOUCH = touch UMASK_NULL = umask 0 DEV_NULL = > /dev/null 2>&1 - -# The following is a portable way to say mkdir -p -# To see which directories are created, change the if 0 to if 1 MKPATH = $(PERLRUN) "-MExtUtils::Command" -e mkpath - -# This helps us to minimize the effect of the .exists files A yet -# better solution would be to have a stable file in the perl -# distribution with a timestamp of zero. But this solution doesn't -# need any changes to the core distribution and works with older perls EQUALIZE_TIMESTAMP = $(PERLRUN) "-MExtUtils::Command" -e eqtime +ECHO = echo +ECHO_N = echo -n +UNINST = 0 +VERBINST = 0 +MOD_INSTALL = $(PERLRUN) -MExtUtils::Install -e 'install({@ARGV}, '\''$(VERBINST)'\'', 0, '\''$(UNINST)'\'');' +DOC_INSTALL = $(PERLRUN) "-MExtUtils::Command::MM" -e perllocal_install +UNINSTALL = $(PERLRUN) "-MExtUtils::Command::MM" -e uninstall +WARN_IF_OLD_PACKLIST = $(PERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist -# Here we warn users that an old packlist file was found somewhere, -# and that they should call some uninstall routine -WARN_IF_OLD_PACKLIST = $(PERL) -we 'exit unless -f $$ARGV[0];' \ --e 'print "WARNING: I have found an old package in\n";' \ --e 'print "\t$$ARGV[0].\n";' \ --e 'print "Please make sure the two installations are not conflicting\n";' -UNINST=0 -VERBINST=0 - -MOD_INSTALL = $(PERL) "-I$(INST_LIB)" "-I$(PERL_LIB)" "-MExtUtils::Install" \ --e "install({@ARGV},'$(VERBINST)',0,'$(UNINST)');" - -DOC_INSTALL = $(PERL) -e '$$\="\n\n";' \ --e 'print "=head2 ", scalar(localtime), ": C<", shift, ">", " L<", $$arg=shift, "|", $$arg, ">";' \ --e 'print "=over 4";' \ --e 'while (defined($$key = shift) and defined($$val = shift)){print "=item *";print "C<$$key: $$val>";}' \ --e 'print "=back";' - -UNINSTALL = $(PERLRUN) "-MExtUtils::Install" \ --e 'uninstall($$ARGV[0],1,1); print "\nUninstall is deprecated. Please check the";' \ --e 'print " packlist above carefully.\n There may be errors. Remove the";' \ --e 'print " appropriate files manually.\n Sorry for the inconveniences.\n"' +# --- MakeMaker makemakerdflt section: +makemakerdflt: all + $(NOECHO) $(NOOP) # --- MakeMaker dist section: -ZIPFLAGS = -r -TO_UNIX = @$(NOOP) TAR = tar -POSTOP = @$(NOOP) -ZIP = zip -DIST_DEFAULT = tardist -CI = ci -u -SHAR = shar -COMPRESS = gzip --best -DIST_CP = best -PREOP = @$(NOOP) TARFLAGS = cvf -DISTVNAME = $(DISTNAME)-$(VERSION) +ZIP = zip +ZIPFLAGS = -r +COMPRESS = gzip --best SUFFIX = .gz +SHAR = shar +PREOP = $(NOECHO) $(NOOP) +POSTOP = $(NOECHO) $(NOOP) +TO_UNIX = $(NOECHO) $(NOOP) +CI = ci -u RCS_LABEL = rcs -Nv$(VERSION_SYM): -q +DIST_CP = best +DIST_DEFAULT = tardist +DISTNAME = NOTEDB +DISTVNAME = NOTEDB-1.3 # --- MakeMaker macro section: @@ -296,6 +286,13 @@ PASTHRU = LIB="$(LIB)"\ PASTHRU_INC="$(PASTHRU_INC)" +# --- MakeMaker special_targets section: +.SUFFIXES: .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT) + +.PHONY: all config static dynamic test linkext manifest + + + # --- MakeMaker c_o section: @@ -306,52 +303,52 @@ PASTHRU = LIB="$(LIB)"\ # --- MakeMaker top_targets section: - all :: pure_all manifypods - @$(NOOP) + $(NOECHO) $(NOOP) + pure_all :: config pm_to_blib subdirs linkext - @$(NOOP) + $(NOECHO) $(NOOP) subdirs :: $(MYEXTLIB) - @$(NOOP) + $(NOECHO) $(NOOP) -config :: Makefile $(INST_LIBDIR)/.exists - @$(NOOP) +config :: $(FIRST_MAKEFILE) $(INST_LIBDIR)$(DIRFILESEP).exists + $(NOECHO) $(NOOP) -config :: $(INST_ARCHAUTODIR)/.exists - @$(NOOP) +config :: $(INST_ARCHAUTODIR)$(DIRFILESEP).exists + $(NOECHO) $(NOOP) -config :: $(INST_AUTODIR)/.exists - @$(NOOP) +config :: $(INST_AUTODIR)$(DIRFILESEP).exists + $(NOECHO) $(NOOP) -$(INST_AUTODIR)/.exists :: /usr/lib/perl/5.8.0/CORE/perl.h - @$(MKPATH) $(INST_AUTODIR) - @$(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.8.0/CORE/perl.h $(INST_AUTODIR)/.exists +$(INST_AUTODIR)/.exists :: /usr/lib/perl/5.8/CORE/perl.h + $(NOECHO) $(MKPATH) $(INST_AUTODIR) + $(NOECHO) $(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.8/CORE/perl.h $(INST_AUTODIR)/.exists - -@$(CHMOD) $(PERM_RWX) $(INST_AUTODIR) + -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_AUTODIR) -$(INST_LIBDIR)/.exists :: /usr/lib/perl/5.8.0/CORE/perl.h - @$(MKPATH) $(INST_LIBDIR) - @$(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.8.0/CORE/perl.h $(INST_LIBDIR)/.exists +$(INST_LIBDIR)/.exists :: /usr/lib/perl/5.8/CORE/perl.h + $(NOECHO) $(MKPATH) $(INST_LIBDIR) + $(NOECHO) $(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.8/CORE/perl.h $(INST_LIBDIR)/.exists - -@$(CHMOD) $(PERM_RWX) $(INST_LIBDIR) + -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_LIBDIR) -$(INST_ARCHAUTODIR)/.exists :: /usr/lib/perl/5.8.0/CORE/perl.h - @$(MKPATH) $(INST_ARCHAUTODIR) - @$(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.8.0/CORE/perl.h $(INST_ARCHAUTODIR)/.exists +$(INST_ARCHAUTODIR)/.exists :: /usr/lib/perl/5.8/CORE/perl.h + $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR) + $(NOECHO) $(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.8/CORE/perl.h $(INST_ARCHAUTODIR)/.exists - -@$(CHMOD) $(PERM_RWX) $(INST_ARCHAUTODIR) + -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_ARCHAUTODIR) -config :: $(INST_MAN3DIR)/.exists - @$(NOOP) +config :: $(INST_MAN3DIR)$(DIRFILESEP).exists + $(NOECHO) $(NOOP) -$(INST_MAN3DIR)/.exists :: /usr/lib/perl/5.8.0/CORE/perl.h - @$(MKPATH) $(INST_MAN3DIR) - @$(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.8.0/CORE/perl.h $(INST_MAN3DIR)/.exists +$(INST_MAN3DIR)/.exists :: /usr/lib/perl/5.8/CORE/perl.h + $(NOECHO) $(MKPATH) $(INST_MAN3DIR) + $(NOECHO) $(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.8/CORE/perl.h $(INST_MAN3DIR)/.exists - -@$(CHMOD) $(PERM_RWX) $(INST_MAN3DIR) + -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_MAN3DIR) help: perldoc ExtUtils::MakeMaker @@ -360,7 +357,7 @@ help: # --- MakeMaker linkext section: linkext :: $(LINKTYPE) - @$(NOOP) + $(NOECHO) $(NOOP) # --- MakeMaker dlsyms section: @@ -368,11 +365,8 @@ linkext :: $(LINKTYPE) # --- MakeMaker dynamic section: -## $(INST_PM) has been moved to the all: target. -## It remains here for awhile to allow for old usage: "make dynamic" -#dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT) $(INST_PM) -dynamic :: Makefile $(INST_DYNAMIC) $(INST_BOOT) - @$(NOOP) +dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT) + $(NOECHO) $(NOOP) # --- MakeMaker dynamic_bs section: @@ -387,88 +381,116 @@ BOOTSTRAP = ## $(INST_PM) has been moved to the all: target. ## It remains here for awhile to allow for old usage: "make static" -#static :: Makefile $(INST_STATIC) $(INST_PM) -static :: Makefile $(INST_STATIC) - @$(NOOP) +static :: $(FIRST_MAKEFILE) $(INST_STATIC) + $(NOECHO) $(NOOP) # --- MakeMaker static_lib section: # --- MakeMaker manifypods section: -POD2MAN_EXE = /usr/bin/pod2man -POD2MAN = $(PERL) -we '%m=@ARGV;for (keys %m){' \ --e 'next if -e $$m{$$_} && -M $$m{$$_} < -M $$_ && -M $$m{$$_} < -M "Makefile";' \ --e 'print "Manifying $$m{$$_}\n";' \ --e 'system(q[$(PERLRUN) $(POD2MAN_EXE) ].qq[$$_>$$m{$$_}])==0 or warn "Couldn\047t install $$m{$$_}\n";' \ --e 'chmod(oct($(PERM_RW)), $$m{$$_}) or warn "chmod $(PERM_RW) $$m{$$_}: $$!\n";}' -manifypods : pure_all NOTEDB/mysql.pm \ +POD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--" +POD2MAN = $(POD2MAN_EXE) + + +manifypods : pure_all \ + NOTEDB/mysql.pm \ + NOTEDB/dbm.pm \ + NOTEDB/binary.pm \ + note.pod \ + NOTEDB/mysql.pm \ NOTEDB/dbm.pm \ NOTEDB/binary.pm \ note.pod - @$(POD2MAN) \ - NOTEDB/mysql.pm \ - $(INST_MAN3DIR)/NOTEDB::mysql.$(MAN3EXT) \ - NOTEDB/dbm.pm \ - $(INST_MAN3DIR)/NOTEDB::dbm.$(MAN3EXT) \ - NOTEDB/binary.pm \ - $(INST_MAN3DIR)/NOTEDB::binary.$(MAN3EXT) \ - note.pod \ - $(INST_MAN3DIR)/note.$(MAN3EXT) + $(NOECHO) $(POD2MAN) --section=3 --perm_rw=$(PERM_RW)\ + NOTEDB/mysql.pm $(INST_MAN3DIR)/NOTEDB::mysql.$(MAN3EXT) \ + NOTEDB/dbm.pm $(INST_MAN3DIR)/NOTEDB::dbm.$(MAN3EXT) \ + NOTEDB/binary.pm $(INST_MAN3DIR)/NOTEDB::binary.$(MAN3EXT) \ + note.pod $(INST_MAN3DIR)/note.$(MAN3EXT) + + + # --- MakeMaker processPL section: # --- MakeMaker installbin section: -$(INST_SCRIPT)/.exists :: /usr/lib/perl/5.8.0/CORE/perl.h - @$(MKPATH) $(INST_SCRIPT) - @$(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.8.0/CORE/perl.h $(INST_SCRIPT)/.exists +$(INST_SCRIPT)/.exists :: /usr/lib/perl/5.8/CORE/perl.h + $(NOECHO) $(MKPATH) $(INST_SCRIPT) + $(NOECHO) $(EQUALIZE_TIMESTAMP) /usr/lib/perl/5.8/CORE/perl.h $(INST_SCRIPT)/.exists - -@$(CHMOD) $(PERM_RWX) $(INST_SCRIPT) + -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_SCRIPT) EXE_FILES = bin/note -FIXIN = $(PERLRUN) "-MExtUtils::MY" \ - -e "MY->fixin(shift)" +FIXIN = $(PERLRUN) "-MExtUtils::MY" -e "MY->fixin(shift)" pure_all :: $(INST_SCRIPT)/note - @$(NOOP) + $(NOECHO) $(NOOP) realclean :: - rm -f $(INST_SCRIPT)/note + $(RM_F) $(INST_SCRIPT)/note -$(INST_SCRIPT)/note: bin/note Makefile $(INST_SCRIPT)/.exists - @rm -f $(INST_SCRIPT)/note - cp bin/note $(INST_SCRIPT)/note +$(INST_SCRIPT)/note: bin/note $(FIRST_MAKEFILE) $(INST_SCRIPT)/.exists + $(NOECHO) $(RM_F) $(INST_SCRIPT)/note + $(CP) bin/note $(INST_SCRIPT)/note $(FIXIN) $(INST_SCRIPT)/note - -@$(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/note + -$(NOECHO) $(CHMOD) $(PERM_RWX) $(INST_SCRIPT)/note # --- MakeMaker subdirs section: # none +# --- MakeMaker clean_subdirs section: +clean_subdirs : + $(NOECHO) $(NOOP) + + # --- MakeMaker clean section: # Delete temporary files but do not touch installed files. We don't delete # the Makefile here so a later make realclean still has a makefile to use. -clean :: - -rm -rf ./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all perlmain.c tmon.out mon.out so_locations pm_to_blib *$(OBJ_EXT) *$(LIB_EXT) perl.exe perl perl$(EXE_EXT) $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def lib$(BASEEXT).def $(BASEEXT).exp $(BASEEXT).x core core.*perl.*.? *perl.core - -mv Makefile Makefile.old $(DEV_NULL) +clean :: clean_subdirs + -$(RM_RF) ./blib $(MAKE_APERL_FILE) $(INST_ARCHAUTODIR)/extralibs.all $(INST_ARCHAUTODIR)/extralibs.ld perlmain.c tmon.out mon.out so_locations pm_to_blib *$(OBJ_EXT) *$(LIB_EXT) perl.exe perl perl$(EXE_EXT) $(BOOTSTRAP) $(BASEEXT).bso $(BASEEXT).def lib$(BASEEXT).def $(BASEEXT).exp $(BASEEXT).x core core.*perl.*.? *perl.core core.[0-9] core.[0-9][0-9] core.[0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9][0-9] + -$(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL) + + +# --- MakeMaker realclean_subdirs section: +realclean_subdirs : + $(NOECHO) $(NOOP) # --- MakeMaker realclean section: # Delete temporary files (via clean) and also delete installed files -realclean purge :: clean - rm -rf $(INST_AUTODIR) $(INST_ARCHAUTODIR) - rm -rf $(DISTVNAME) - rm -f blib/lib/NOTEDB/mysql.pm blib/lib/NOTEDB/dbm.pm blib/lib/NOTEDB/README - rm -f blib/lib/NOTEDB/binary.pm blib/lib/note.pod blib/lib/NOTEDB.pm - rm -rf Makefile Makefile.old +realclean purge :: clean realclean_subdirs + $(RM_RF) $(INST_AUTODIR) $(INST_ARCHAUTODIR) + $(RM_RF) $(DISTVNAME) + $(RM_F) $(INST_LIB)/NOTEDB/mysql.pm $(INST_LIB)/NOTEDB/binary.pm $(MAKEFILE_OLD) $(INST_LIB)/NOTEDB.pm $(INST_LIB)/note.pod $(INST_LIB)/NOTEDB/README $(INST_LIB)/NOTEDB/dbm.pm $(FIRST_MAKEFILE) + + +# --- MakeMaker metafile section: +metafile : + $(NOECHO) $(ECHO) '# http://module-build.sourceforge.net/META-spec.html' > META.yml + $(NOECHO) $(ECHO) '#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#' >> META.yml + $(NOECHO) $(ECHO) 'name: NOTEDB' >> META.yml + $(NOECHO) $(ECHO) 'version: 1.3' >> META.yml + $(NOECHO) $(ECHO) 'version_from: NOTEDB.pm' >> META.yml + $(NOECHO) $(ECHO) 'installdirs: site' >> META.yml + $(NOECHO) $(ECHO) 'requires:' >> META.yml + $(NOECHO) $(ECHO) '' >> META.yml + $(NOECHO) $(ECHO) 'distribution_type: module' >> META.yml + $(NOECHO) $(ECHO) 'generated_by: ExtUtils::MakeMaker version 6.17' >> META.yml + + +# --- MakeMaker metafile_addtomanifest section: +metafile_addtomanifest: + $(NOECHO) $(PERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) } ' \ + -e ' or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"' # --- MakeMaker dist_basics section: @@ -491,13 +513,15 @@ veryclean : realclean # --- MakeMaker dist_core section: -dist : $(DIST_DEFAULT) - @$(PERL) -le 'print "Warning: Makefile possibly out of date with $$vf" if ' \ - -e '-e ($$vf="$(VERSION_FROM)") and -M $$vf < -M "Makefile";' +dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE) + $(NOECHO) $(PERLRUN) -l -e 'print '\''Warning: Makefile possibly out of date with $(VERSION_FROM)'\''' \ + -e ' if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' < -M '\''$(FIRST_MAKEFILE)'\'';' tardist : $(DISTVNAME).tar$(SUFFIX) + $(NOECHO) $(NOOP) -zipdist : $(DISTVNAME).zip +uutardist : $(DISTVNAME).tar$(SUFFIX) + uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu $(DISTVNAME).tar$(SUFFIX) : distdir $(PREOP) @@ -507,17 +531,15 @@ $(DISTVNAME).tar$(SUFFIX) : distdir $(COMPRESS) $(DISTVNAME).tar $(POSTOP) +zipdist : $(DISTVNAME).zip + $(NOECHO) $(NOOP) + $(DISTVNAME).zip : distdir $(PREOP) $(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME) $(RM_RF) $(DISTVNAME) $(POSTOP) -uutardist : $(DISTVNAME).tar$(SUFFIX) - uuencode $(DISTVNAME).tar$(SUFFIX) \ - $(DISTVNAME).tar$(SUFFIX) > \ - $(DISTVNAME).tar$(SUFFIX)_uu - shdist : distdir $(PREOP) $(SHAR) $(DISTVNAME) > $(DISTVNAME).shar @@ -525,8 +547,8 @@ shdist : distdir $(POSTOP) -# --- MakeMaker dist_dir section: -distdir : +# --- MakeMaker distdir section: +distdir : metafile metafile_addtomanifest $(RM_RF) $(DISTVNAME) $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \ -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');" @@ -545,9 +567,9 @@ disttest : distdir ci : $(PERLRUN) "-MExtUtils::Manifest=maniread" \ - -e "@all = keys %{ maniread() };" \ - -e 'print("Executing $(CI) @all\n"); system("$(CI) @all");' \ - -e 'print("Executing $(RCS_LABEL) ...\n"); system("$(RCS_LABEL) @all");' + -e "@all = keys %{ maniread() };" \ + -e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \ + -e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});" # --- MakeMaker install section: @@ -565,68 +587,57 @@ pure_install :: pure_$(INSTALLDIRS)_install doc_install :: doc_$(INSTALLDIRS)_install pure__install : pure_site_install - @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site + $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site doc__install : doc_site_install - @echo INSTALLDIRS not defined, defaulting to INSTALLDIRS=site + $(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site pure_perl_install :: - @umask 022; $(MOD_INSTALL) \ - read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \ - write $(INSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \ - $(INST_LIB) $(INSTALLPRIVLIB) \ - $(INST_ARCHLIB) $(INSTALLARCHLIB) \ - $(INST_BIN) $(INSTALLBIN) \ - $(INST_SCRIPT) $(INSTALLSCRIPT) \ - $(INST_MAN1DIR) $(INSTALLMAN1DIR) \ - $(INST_MAN3DIR) $(INSTALLMAN3DIR) - @$(WARN_IF_OLD_PACKLIST) \ + $(NOECHO) umask 022; $(MOD_INSTALL) \ + $(INST_LIB) $(DESTINSTALLPRIVLIB) \ + $(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \ + $(INST_BIN) $(DESTINSTALLBIN) \ + $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLMAN3DIR) + $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ $(SITEARCHEXP)/auto/$(FULLEXT) pure_site_install :: - @umask 02; $(MOD_INSTALL) \ + $(NOECHO) umask 02; $(MOD_INSTALL) \ read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \ - write $(INSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \ - $(INST_LIB) $(INSTALLSITELIB) \ - $(INST_ARCHLIB) $(INSTALLSITEARCH) \ - $(INST_BIN) $(INSTALLSITEBIN) \ - $(INST_SCRIPT) $(INSTALLSCRIPT) \ - $(INST_MAN1DIR) $(INSTALLSITEMAN1DIR) \ - $(INST_MAN3DIR) $(INSTALLSITEMAN3DIR) - @$(WARN_IF_OLD_PACKLIST) \ + write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \ + $(INST_LIB) $(DESTINSTALLSITELIB) \ + $(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \ + $(INST_BIN) $(DESTINSTALLSITEBIN) \ + $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR) + $(NOECHO) $(WARN_IF_OLD_PACKLIST) \ $(PERL_ARCHLIB)/auto/$(FULLEXT) pure_vendor_install :: - @umask 022; $(MOD_INSTALL) \ - $(INST_LIB) $(INSTALLVENDORLIB) \ - $(INST_ARCHLIB) $(INSTALLVENDORARCH) \ - $(INST_BIN) $(INSTALLVENDORBIN) \ - $(INST_SCRIPT) $(INSTALLSCRIPT) \ - $(INST_MAN1DIR) $(INSTALLVENDORMAN1DIR) \ - $(INST_MAN3DIR) $(INSTALLVENDORMAN3DIR) + $(NOECHO) umask 022; $(MOD_INSTALL) \ + $(INST_LIB) $(DESTINSTALLVENDORLIB) \ + $(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \ + $(INST_BIN) $(DESTINSTALLVENDORBIN) \ + $(INST_SCRIPT) $(DESTINSTALLSCRIPT) \ + $(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \ + $(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR) doc_perl_install :: - @echo Appending installation info to $(INSTALLARCHLIB)/perllocal.pod - -@umask 022; $(MKPATH) $(INSTALLARCHLIB) - -@umask 022; $(DOC_INSTALL) \ - "Module" "$(NAME)" \ - "installed into" "$(INSTALLPRIVLIB)" \ - LINKTYPE "$(LINKTYPE)" \ - VERSION "$(VERSION)" \ - EXE_FILES "$(EXE_FILES)" \ - >> $(INSTALLARCHLIB)/perllocal.pod doc_site_install :: - @echo Appending installation info to $(INSTALLSITEARCH)/perllocal.pod - -@umask 02; $(MKPATH) $(INSTALLSITEARCH) - -@umask 02; $(DOC_INSTALL) \ + $(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLSITEARCH)/perllocal.pod + -$(NOECHO) umask 02; $(MKPATH) $(DESTINSTALLSITEARCH) + -$(NOECHO) umask 02; $(DOC_INSTALL) \ "Module" "$(NAME)" \ "installed into" "$(INSTALLSITELIB)" \ LINKTYPE "$(LINKTYPE)" \ VERSION "$(VERSION)" \ EXE_FILES "$(EXE_FILES)" \ - >> $(INSTALLSITEARCH)/perllocal.pod + >> $(DESTINSTALLSITEARCH)/perllocal.pod doc_vendor_install :: @@ -634,16 +645,19 @@ doc_vendor_install :: uninstall :: uninstall_from_$(INSTALLDIRS)dirs uninstall_from_perldirs :: - @$(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist + $(NOECHO) $(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist uninstall_from_sitedirs :: - @$(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist + $(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist + +uninstall_from_vendordirs :: + $(NOECHO) $(UNINSTALL) $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist # --- MakeMaker force section: # Phony target to force checking subdirectories. FORCE: - @$(NOOP) + $(NOECHO) $(NOOP) # --- MakeMaker perldepend section: @@ -651,17 +665,17 @@ FORCE: # --- MakeMaker makefile section: -# We take a very conservative approach here, but it\'s worth it. +# We take a very conservative approach here, but it's worth it. # We move Makefile to Makefile.old here to avoid gnu make looping. -Makefile : Makefile.PL $(CONFIGDEP) - @echo "Makefile out-of-date with respect to $?" - @echo "Cleaning current config before rebuilding Makefile..." - -@$(RM_F) Makefile.old - -@$(MV) Makefile Makefile.old - -$(MAKE) -f Makefile.old clean $(DEV_NULL) || $(NOOP) +$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP) + $(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?" + $(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..." + $(NOECHO) $(RM_F) $(MAKEFILE_OLD) + $(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) + -$(MAKE) -f $(MAKEFILE_OLD) clean $(DEV_NULL) || $(NOOP) $(PERLRUN) Makefile.PL - @echo "==> Your Makefile has been rebuilt. <==" - @echo "==> Please rerun the make command. <==" + $(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <==" + $(NOECHO) $(ECHO) "==> Please rerun the make command. <==" false @@ -676,8 +690,8 @@ $(MAP_TARGET) :: static $(MAKE_APERL_FILE) $(MAKE) -f $(MAKE_APERL_FILE) $@ $(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) - @echo Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) - @$(PERLRUNINST) \ + $(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET) + $(NOECHO) $(PERLRUNINST) \ Makefile.PL DIR= \ MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \ MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= @@ -694,7 +708,7 @@ TESTDB_SW = -d testdb :: testdb_$(LINKTYPE) test :: $(TEST_TYPE) - @echo 'No tests defined for $(NAME) extension.' + $(NOECHO) $(ECHO) 'No tests defined for $(NAME) extension.' test_dynamic :: pure_all @@ -710,18 +724,29 @@ testdb_static :: testdb_dynamic # --- MakeMaker ppd section: # Creates a PPD (Perl Package Description) for a binary distribution. ppd: - @$(PERL) -e "print qq{\n\t$(DISTNAME)\n\t\n\t\n}" > $(DISTNAME).ppd - @$(PERL) -e "print qq{\t\n}" >> $(DISTNAME).ppd - @$(PERL) -e "print qq{\t\t\n\t\t\n\t\t\n\t\n\n}" >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) '' > $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' $(DISTNAME)' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd + $(NOECHO) $(ECHO) '' >> $(DISTNAME).ppd + # --- MakeMaker pm_to_blib section: pm_to_blib: $(TO_INST_PM) - @$(PERLRUNINST) "-MExtUtils::Install" \ - -e "pm_to_blib({qw{NOTEDB/README blib/lib/NOTEDB/README NOTEDB/dbm.pm blib/lib/NOTEDB/dbm.pm NOTEDB/mysql.pm blib/lib/NOTEDB/mysql.pm NOTEDB/binary.pm blib/lib/NOTEDB/binary.pm NOTEDB.pm blib/lib/NOTEDB.pm}},'$(INST_LIB)/auto','$(PM_FILTER)')" - @$(PERLRUNINST) "-MExtUtils::Install" \ - -e "pm_to_blib({qw{note.pod blib/lib/note.pod}},'$(INST_LIB)/auto','$(PM_FILTER)')" - @$(TOUCH) $@ + $(NOECHO) $(PERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, '\''$(INST_LIB)/auto'\'', '\''$(PM_FILTER)'\'')'\ + NOTEDB/README $(INST_LIB)/NOTEDB/README \ + NOTEDB/mysql.pm $(INST_LIB)/NOTEDB/mysql.pm \ + NOTEDB/dbm.pm $(INST_LIB)/NOTEDB/dbm.pm \ + NOTEDB/binary.pm $(INST_LIB)/NOTEDB/binary.pm \ + NOTEDB.pm $(INST_LIB)/NOTEDB.pm \ + note.pod $(INST_LIB)/note.pod + $(NOECHO) $(TOUCH) $@ # --- MakeMaker selfdocument section: diff --git a/NOTEDB/binary.pm b/NOTEDB/binary.pm index d56d4f0..20d7635 100644 --- a/NOTEDB/binary.pm +++ b/NOTEDB/binary.pm @@ -8,6 +8,7 @@ package NOTEDB; use strict; use Data::Dumper; use IO::Seekable; +use File::Spec; use NOTEDB; @@ -32,13 +33,15 @@ sub new exit(1); } - $self->{version} = "(NOTEDB::binary, 1.7)"; + $self->{version} = "(NOTEDB::binary, 1.8)"; $self->{NOTEDB} = $dbname; + my $TYPEDEF = "i a$MAX_NOTE a$MAX_TIME"; my $SIZEOF = length pack($TYPEDEF, () ); $self->{sizeof} = $SIZEOF; $self->{typedef} = $TYPEDEF; + $self->{maxnote} = $MAX_NOTE; return $self; } @@ -192,9 +195,11 @@ sub get_search -sub set_edit -{ +sub set_edit { my($this, $num, $note, $date) = @_; + + $this->warn_if_too_big($note, $num); + my $address = ($num -1 ) * $this->{sizeof}; open NOTE, "+<$this->{NOTEDB}" or die "could not open $this->{NOTEDB}\n"; @@ -214,9 +219,11 @@ sub set_edit } -sub set_new -{ +sub set_new { my($this, $num, $note, $date) = @_; + + $this->warn_if_too_big($note, $num); + open NOTE, "+<$this->{NOTEDB}" or die "could not open $this->{NOTEDB}\n"; flock NOTE, LOCK_EX; @@ -307,6 +314,7 @@ sub uen $T = pack("u", $_[0]); } chomp $T; + return $T; } @@ -326,6 +334,36 @@ sub ude } +sub warn_if_too_big { + my ($this, $note, $num) = @_; + + my $len = length($this->uen($note)); + + if ($len > $this->{maxnote}) { + # calculate the 30% uuencoding overhead + my $overhead = int(($this->{maxnote} / 100) * 28); + + # fetch what's left by driver + my $left = substr $note, $this->{maxnote} - $overhead; + + $left = "\n$left\n"; + $left =~ s/\n/\n> /gs; + + print STDERR "*** WARNING $this->{version} WARNING ***\n" + ."The driver encountered a string length problem with your\n" + ."note entry number $num. The entry is too long. Either shorten\n" + ."the entry or resize the database field for entries.\n\n" + ."The following data has been cut off the entry:\n" + ."\n$left\n\n"; + + my $copy = File::Spec->catfile($ENV{'HOME'}, "entry-$num.txt"); + open N, ">$copy" or die "Could not open $copy: $!\n"; + print N $note; + close N; + + print "*** Wrote the complete note entry number $num to file: $copy ***\n"; + } +} @@ -407,5 +445,4 @@ please see the section SYNOPSIS, it says it all. Thomas Linden . - =cut diff --git a/README b/README index 98eb801..73fd9c8 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -note 1.2.5 by Thomas Linden, 19/01/2004 +note 1.2.6 by Thomas Linden, 30/06/2004 ======================================= Introduction @@ -205,4 +205,4 @@ and I'll add you. Last changed ============ -19/01/2004 \ No newline at end of file +30/06/2004 \ No newline at end of file diff --git a/VERSION b/VERSION index e8ea05d..3c43790 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.2.4 +1.2.6 diff --git a/bin/note b/bin/note index 211e224..4f4d024 100755 --- a/bin/note +++ b/bin/note @@ -128,7 +128,7 @@ $TIME_COLOR = "blue"; $TOPIC_COLOR = "bold"; $TOPIC = 1; $TopicSep = '/'; -$version = "1.2.5"; +$version = "1.2.6"; if ($TOPIC) { $CurDepth = 1; # the current depth inside the topic "directory" structure... } @@ -797,7 +797,7 @@ sub del { ############################### EDIT ################################## sub edit { - my($keeptime, $date, $editor, $TEMP, $note, $t, $num, $match); + my($keeptime, $date, $editor, $TEMP, $note, $t, $num, $match, $backup); # edit a note $date = &getdate; ($note, $keeptime) = $db->get_single($number); @@ -816,6 +816,8 @@ sub edit { select STDOUT; $editor = &find_editor; + $backup = $note; + if ($editor) { system ($editor, $TEMP) and die "Could not execute $editor: $!\n"; } @@ -834,16 +836,21 @@ sub edit { unlink $TEMP || die $!; - if ($KEEP_TIMESTAMP eq "YES") { - $t = $keeptime; + if ($note ne $backup) { + if ($KEEP_TIMESTAMP eq "YES") { + $t = $keeptime; + } + else { + $t = $date; + } + # we got it, now save to db + $db->set_edit($number, $note, $t); + + print "note number $number has been changed.\n"; } else { - $t = $date; + print "note number $number has not changed, no save done.\n"; } - # we got it, now save to db - $db->set_edit($number, $note, $t); - - print "note number $number has been changed.\n"; } diff --git a/config/noterc b/config/noterc index 31492ba..9891cb9 100644 --- a/config/noterc +++ b/config/noterc @@ -1,4 +1,5 @@ -# 1.2.5 -*- sh -*- +# note 1.2.6 -*- sh -*- +# # This is a sample config for the note script # There are useful defaults set in note itself. # @@ -28,7 +29,10 @@ DbDriver binary + +# # backend specific settings for sql backend +# #DbHost localhost #DbPort #DbUser you @@ -38,44 +42,57 @@ DbDriver binary #FieldNumber number #FieldNote note #FieldDate date -# uncomment for using an encrypted password, generate it with note "--encrypt" +# uncomment for using an encrypted password, generate it +# with note "--encrypt" #encrypt_passwd 1 #### specific end ### + + +# # backend specific settings for binary(default) backend +# +# where to store the database (filename) NoteDb ~/.notedb +# # Define the maximum bytes fields can have in a # note-entry. Do not change MaxTimeByte to less than 64! - MaxNoteByte 4096 MaxTimeByte 64 #### specific end ### # backend specific settings for DBM backend -# this must be an existing directory! +# +# Directory where to store the dbm files #DbName /home/you/.notedbm #### specific end ### + + # You can use encryption with note, that means notes and # timestamps will be stored encrypted. This is supported # by every db-backend. # Set to 1 to turn it on. The Default is 0 (off) UseEncryption 0 + + # Specify the encryption protocol. The appropriate perl # module needs to be installed. Possible velues are # IDEA, DES or Blowfish, the default is IDEA. CryptMethod IDEA + # You can run note always in interactive mode by simply # typing "note". Set this option to 1 to turn it on. # The default is 1 (on). AlwaysInteractive 1 + # In interactive mode, note issues a list command if you # simply hit enter. By turning this on, it will issue a # longlist command instead if you hit just enter. @@ -90,11 +107,13 @@ DefaultLong 0 AlwaysEditor 0 + # uncomment and edit it, if you want to use another # editor than the default $EDITOR or as fallback vi. #PreferredEditor emacs + # If you dont prefer that note updates the timestamp of a # note after editing, turn this on. It will # keep the original timestamp if this option is set. @@ -102,12 +121,14 @@ AlwaysEditor 0 KeepTimeStamp 0 + # You can specify your own topic separator here. # the default topic separator is a normal slash: "/" # see README for details about topics! TopicSeparator / + # The maximum width for displaying a note, in CHARS. # Depends on your screen-size. You can set it to # "auto", if you wish that note should determine the @@ -115,29 +136,35 @@ TopicSeparator / MaxLen auto + # Set this to 0 if you dont want note to automatically # clear the screen after displaying something and after # exit (feature introduced in 1.2.1). AutoClear 1 + + # note can use colors for output, set this option to # 1, if you don't want it, or if your terminal does # not support it, set to 0. The default is 1 (on). UseColors 1 + # Color-definitions of the various items. Will only # take effect, if "UseColors" is turned on! -BorderColor BLACK -NumberColor blue -NoteColor green -TimeColor black -TopicColor BLACK +# # The following colors are available: # black, red, green, yellow, blue, magenta, cyan and white. # for bold color write it uppercase (BLACK will be bold black) # for underlined color append an underscore (blue_ will be underlined blue) # for inverted color append an "I" (greenI will be inverted green) +BorderColor BLACK +NumberColor blue +NoteColor green +TimeColor black +TopicColor BLACK + # Additional to colors, you can also do a little bit of formatting your @@ -147,6 +174,7 @@ TopicColor BLACK FormatText 1 + # You might specify your own directory for temporary files. # note needs to create some temp files during editing of notes. # You could protect this directory using the command: chmod 700 directory. diff --git a/note.pod b/note.pod index 795a125..c0c3a70 100644 --- a/note.pod +++ b/note.pod @@ -513,6 +513,6 @@ Thomas Linden =head1 VERSION -1.2.5 (19/01/2004) +1.2.6 (30/06/2004) =cut