debian/0000755000000000000000000000000012265215001007160 5ustar debian/watch0000644000000000000000000000014012265214147010216 0ustar version=2 http://koala.ilog.fr/ftp/pub/browser-history/browser-history-(.*)\.tgz debian uupdate debian/KoalaLogo-small-transp.gif0000644000000000000000000000134312265214147014145 0ustar GIF89aGWsU]Gőͪ}ywe!,GW@I8Q` ܆x#YbtsK{` @PGѐɨa,lgZ)Rznp7es njt%w?yz 'tQT-PINUY"J>a[G2F^5g;rqmrd!|l~j+'+5ZV`'1'z,OZ#)$L00x W9QAFyI҅{$KT..]vt dz #b'1Y 8u;׀PX#5곝P-Э55r(k1A#vlPeٚhνͿx[aD1ay[*yO ʅ- ̗91ŝ_"dMoJ5]BQ6Em_][sG&io Jr!SrC^ \J3UWJ{3ϲV{w'ѭs Gd }!GQH\Z$A.| 2h̃ATXOf]8A>š^YY}21Q9k-nu;6U@Xʰ$L6)E%%I k݅W^DR鵢!g~M8o#'8@D;debian/browser-history-search.cgi0000644000000000000000000000555112265214147014311 0ustar #!/usr/bin/perl -Tw use strict; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); # The original version of this script was written in Bourne shell by Karl M. # Hegbloom . Colin Watson rewrote # it in Perl. # This requires either `cgiwrap' or `suexec' so it runs as the user whose # browser-history is to be grepped. Place it in # ~/public_html/cgi-bin/browser-history-search.cgi, and access it with the # URL: http://localhost/cgi-bin/cgiwrap/~yourid/browser-history-search.cgi # or, using `suexec', # http://localhost/~yourid/cgi-bin/browser-history-search.cgi # Note that anyone who knows this is here can use it to search your # browser-history. I think that using `suexec', with a handler type for # `.cgi' files, it may be possible to place this in a basic-auth protected # location. I'll leave that as an exercise. my $me = 'browser-history-search.cgi'; # relative URL print header(-type => 'text/html'); my $zcat = '/bin/zcat'; print "Can't find zcat on this system\n", exit unless -x $zcat; # Untaint $HOME. my $HOME = defined($ENV{HOME}) ? $ENV{HOME} : $ENV{LOGDIR}; unless (defined $HOME) { print "Neither \$HOME nor \$LOGDIR is defined; consider using a CGI " . "wrapper.\n"; exit; } unless ($HOME =~ m#(^/(?:[^/]*[^/.][^/]*(?:/|$))*$)#) { print 'Insecure $' . (defined($ENV{HOME}) ? 'HOME' : 'LOGDIR') . ": $HOME\n"; exit; } $HOME = $1; local *HISTORY; # Open a history file, whether gzipped or not. sub open_history ($) { my $history = shift; if ($history =~ /\.gz$/) { my $pid = open HISTORY, '-|'; croak "Couldn't fork: $!" unless defined $pid; unless ($pid) { exec $zcat, '-S', '', '-f', $history or croak "Couldn't exec $zcat: $!"; } } else { unless (open HISTORY, $history) { carp "Couldn't open $history: $!"; next; } } return \*HISTORY; } my $match = param('match'); if ($match) { print < Search results by browser-history

Search results by browser-history

Search again

EOF chdir "$HOME/.browser-history"; local *HISTORIES; opendir HISTORIES, '.'; while (defined(my $history = readdir HISTORIES)) { next unless $history =~ /\.html(?:\.gz)?$/; my $histfile = open_history $history; while (<$histfile>) { last if /^$/; } while (<$histfile>) { if (/$match/) { s/^
/
/; print; } } close $histfile or carp "Couldn't close history file: $!"; } print < EOF } else { print < Browser History Search

Browser History Search

Enter a Perl regular expression to search your browser-history and display the results:

EOF } debian/rules0000755000000000000000000000122312265214147010250 0ustar #! /usr/bin/make -f %: dh $@ DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) CROSS := else CROSS := CC=$(DEB_HOST_GNU_TYPE)-gcc endif FLAGS := CFLAGS='$(shell dpkg-buildflags --get CPPFLAGS) $(shell dpkg-buildflags --get CFLAGS) -Wall' \ LDFLAGS='$(shell dpkg-buildflags --get LDFLAGS)' override_dh_auto_build: ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) $(MAKE) $(CROSS) $(FLAGS) else $(MAKE) debug $(CROSS) $(FLAGS) endif override_dh_installchangelogs: dh_installchangelogs debian/changelog-upstream.html debian/install0000644000000000000000000000003012265214147010554 0ustar browser-history usr/bin debian/doc-base0000644000000000000000000000060212265214147010570 0ustar Document: browser-history Title: Browser-history Manual Author: Colas Nahaboo Abstract: Documentation for browser-history, a daemon that tracks which URLs you look at and logs them on a local WWW page. Section: Network/Web Browsing Format: html Index: /usr/share/doc/browser-history/browser-history.html Files: /usr/share/doc/browser-history/browser-history.html debian/examples0000644000000000000000000000004212265214147010727 0ustar debian/browser-history-search.cgi debian/.git-dpm0000644000000000000000000000043112265214147010532 0ustar # see git-dpm(1) from git-dpm package 22ba98fa15a217b42c9256d8f4d322c2642e9cde 22ba98fa15a217b42c9256d8f4d322c2642e9cde 7e27ecc5a20bc74f45b785c9f3d72980a2a9ef1d 7e27ecc5a20bc74f45b785c9f3d72980a2a9ef1d browser-history_2.8.orig.tar.gz d9533df252facac01a942fd936b3ad3176249cc8 19593 debian/copyright0000644000000000000000000000364112265214147011131 0ustar This package was debianized by Karl M. Hegbloom on Wed, 17 Sep 1997 20:17:02 -0700, and is now maintained by Colin Watson . It was downloaded from http://koala.ilog.fr/ftp/pub/browser-history/ The RCS Id in the copy I downloaded was: $Id: browser-history.c,v 2.8 2000/07/25 15:46:26 colas Exp $ Copyright: Copyright Colas Nahaboo 1996, http://www.inria.fr/koala/colas. See http://www.inria.fr/koala/colas/browser-history The X distribution license: you can do everything with this code (selling it, modifying it), except suing me or using my name in your advertisements, or expecting any kind of support or guarantee. A copy of the X distribution license follows: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of Colas Nahaboo shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Colas Nahaboo. debian/changelog-upstream.html0000644000000000000000000000620112265214147013644 0ustar browser-history changelog

News

History of changes, both to the browser-history program and to this page:
v2.8 - 24-Jul-2000
  • bugfix: since 2.6, internal links of default generated headers were false
v2.7 - 20-Jul-2000
  • new X property LAST_POS on the browser-history window to give last valid position in log file
  • summary of use less terse
v2.6 - 08-Jun-2000
  • If a file "header.html" exists in ~/.browser-history, use it as a header to start new history-log files with. Patch contributed by Philippe Le Hégaret
  • Day names have <a> marquers on them to allow jumping directly to them from the header. Patch contributed by Philippe Le Hégaret
v2.5 - 06-Aug-1999
  • In log, links to the previous weeks are now relative (were absolute). Patch contributed by Bert Bos
  • All years in dates (in logs and in previous week filenames) are now on 4 digits. This was a Y2K bug! :-) Patch contributed by Bert Bos
  • Some users edited the netscape binary to remove the leading Netscape: in window names... I had to adapt to it.
v2.4 - 24-Aug-97
Log entries are now on the same line, to ease grep searches in files.
v2.3 - 14-Feb-97
bugfix: on creating a new file on sundays, one some OSes (SunOs4+NFS), the list of previous histories was empty. Problem detected and fixed by Hubert CANON
v2.2 - 03-Oct-96
built-in support of the last Amaya version (new official editor+browser of the web consortium)
v2.1 - 13-Sep-96
you can add support to your browser without recompiling or restarting browser-history, see Supported browsers
new option -Version, prints version and exits.
v1.18 - 25-Jun-96
Past weeks stored most recent first instead of oldest first at top of history file.
v1.17 - 30-May-96
Works on SunOS and on pure BSD system, where you must add the compilation flag -DBSD or type "make bsd".
new option -DontGrab for debug.
v1.16 - 28-May-96
Works even if gzip is not installed, and gzip location settable by the new -gzip option
v1.14 - 28-May-96
No need anymore for a crontab-run shell script to add day names and week cleanups to the log.
Web page installed.
v1.6 - 03-May-96
Directory name changed to "~/.browser-history", was "~/.netscape-history" before...
v1.4 - 15-Feb-96
Arena implements supports too.
v1.1 - 01-Feb-96
First version, netscape only.
debian/docs0000644000000000000000000000007612265214147010050 0ustar README browser-history.html debian/KoalaLogo-small-transp.gif debian/browser-history.10000644000000000000000000001457012265214147012445 0ustar .TH BROWSER\-HISTORY 1 local .SH NAME browser\-history \- external history of web browsers, such as netscape .SH SYNOPSIS .B browser\-history .RB [ " options " ] .SH DESCRIPTION .I Browser\-History is a client-side X daemon maintaining a browser-independent global history of all the web sites you visited. Its usage is very simple, just put the following line in your .xinitrc or your X start-up script: .RS .B browser\-history & .RE And open the file .B ~/.browser\-history/history\-log.html and bookmark it. Browser\-history came from the will to overcome a Netscape bug: there was no global history, and if you close a window, its whole history is lost. For people browsing lots of sites, having a possibility to track back where one has been before means that you don't have to put everything in your bookmarks file. If you are not sure if a site may be worth remembering, don't add it in your bookmarks. If you need it later, just browse your history files. Later, it came to our minds that this also could be a valuable add-on to people writing experimental browsers, so they dont have to add this functionality to their browser itself. Browser\-history is a small and efficient daemon. Real user services could be built on top of the log files it maintains for more possibilities (graphical representation, advanced search options, collective histories). It can be seen as a quick-and-dirty hack wrt to the general solution of using a personal proxy to provide this history and housekeeping facilities. But in the meantime, it is easy to use and it works. .SH IMPLEMENTATION .PP .I Browser\-History spies your web browser and logs in ~/.browser\-history/history\-log.html all the URLs you went through. You can then browse the log under Netscape or other browsers via the URL: .B file:~/.browser\-history/history\-log.html (replace the ~ by your home directory). It tracks automagically all already present browser windows, and all new ones created in the future. This program has no user interface. It just appends information to a log file in html format so you can browse it through a web browser. If more that one hour has passed since last entry, it draws an horizontal lines, and adds H1 headers to delimit new days. Each week (Sunday mornings), it archives the week history, compresses it by gzip (that you must have in your path), and starts a new history with links to the older ones. To make room you can just remove the obsolete history files. You can search files for string XXX in shell via: .RS zgrep XXX ~/.browser\-history/* .RE This version (2.6) works with Netscape, Arena and Amaya. URLs can be excluded from logging by putting them, one per line in the file .B ~/.browser\-history/history\-log.exclude , then, if an URL begins with a line from this file, it is not logged. In this file, empty lines or lines beginning by # are comments This file is read once at startup, and re-read when receiving the signal 1. e.g: .RS # We exclude local files file: # Exclude search engines... http://home.netscape.com http://guide.infoseek.com .RE When browser\-history is run, it looks if another one is running, and by default it kills the previous one if it is an older version. Otherwise, it the new one is the same version number or older, it just aborts. .SH OPTIONS .PP All options can be given by their first letter: you can specify either \-verbose or \-v, but you cannot group options, e.g. you must say .B \-v \-k , but not .B \-vk .TP .BI \-display " display_name" Specifies X display, otherwise contents of $DISPLAY is used .TP .BI \-verbose outputs information on what it is doing. useful for debug. .TP .BI \-Version prints version number and exit. .TP .BI \-logdir " directory" which directory to store files into? defaults to ~/.browser\-history .TP .BI \-gzip " gzip_filename" the complete path to the .B gzip compressor. Defaults to "gzip". E.g: .RS \-gzip /usr/gnu/bin/gzip .RE .TP .BI \-seconds " delay" if two entries are made are more than \fI delay\fR seconds apart, an horizontal rule will separate them, else just a simple line break. Defaults to one hour (3600). .TP .BI \-replace If there is an already running browser\-history on the display, aborts. Default is to replace it only if the version is older than ours. .TP .BI \-noreplace If there is an already running browser\-history on the display, aborts. Default is to replace it only if the version is older than ours. .TP .BI \-kill If there is an already running browser\-history on the display, kills it, then terminates immediately in all cases. .TP .BI \-DontGrab Never Grab the X Server, which might cause deadlocks while debugging, when browser\-history or gdb tries to print on the grabbed xterm or emacs. .TP .BI \-checkpoint Cause the currently running instance of browser\-history to save a list of all the URLs and their titles that are currently being viewed by a browser\-history compatible browser to the normal history file as a "checkpoint". .SH LOG FILE FORMAT .PP A log file can have some decorative HTML to represent days, but each entry has the form: (on a single line since version 2.4) .RS .nf \fIseparator\fR \fIname\fR \fIURL\fR \fIYYYY/MM/DD\-HH:MN:SS\fR \fIwindowid\fR .fi .RE where the following items are: .RS .nf \fIseparator\fR: either
or
\fIname\fR: the name of the document (window title) \fIURL\fR: its URL \fIYYYY/MM/DD\-HH:MN:SS\fR: year, month number, day number, hour, minutes, seconds. (2-digit numbers) \fIwindowid\fR: the X window ID of the browser window, in hexadecimal .fi .RE .PP .B Note: Before version 2.4, the 4 sub-parts were separated by newlines, but since 2.4, they are only blank-separated to ease searching for URL in log files via "grep". .PP .B Note: Before version 2.5, the year was stored in 2 digits. Now it is stored in 4 (or more :-) digits, to fix this Y2K bug .SH HOME .PP The latest version of .B browser\-history can be found at: .RS .B http://koala.ilog.fr/ftp/pub/browser\-history/ .RE and its WWW home page, with full technical documentation is at: .RS .B http://www.inria.fr/koala/colas/browser\-history .RE .SH AUTHOR .PP Colas Nahaboo, .B http://www.inria.fr/koala/colas .SH COPYRIGHT .PP .I browser\-history bears the same license as the X Window System: you can do everything with this code (selling it, modifying it), except suing me or using my name in your advertisements, or expecting any kind of support or guarantee. debian/source/0000755000000000000000000000000012265214147010472 5ustar debian/source/format0000644000000000000000000000001412265214147011700 0ustar 3.0 (quilt) debian/source/include-binaries0000644000000000000000000000004212265214147013626 0ustar debian/KoalaLogo-small-transp.gif debian/patches/0000755000000000000000000000000012265214236010620 5ustar debian/patches/checkpoint.patch0000644000000000000000000002172612265214147014001 0ustar From e8085783d5639b93dbc7a9222d0a9134bc168fd6 Mon Sep 17 00:00:00 2001 From: J C Lawrence Date: Tue, 14 Jan 2014 10:34:00 +0000 Subject: Add -checkpoint option The following patch when applied to the 2.4 Debian sources (note that the current release of browser-history is 2.8) adds the following feature: If "browser-history -c" is run, the currently running instance of browser-history will save a list of all the URLs and their titles that are currently being viewed by a browser-history compatible browser (eg Netscape, Amaya, etc) to the normal history file as a "Checkpoint". I wrote this specifically as I tend to have many netscape windows open at a time (20 - 30 is about average) and I tend to preserve state and context within those windows (what I'm interested in, what I want to get back to, etc). Now, by hanging "browser-history -c" off a root menu item, or a window manager's GUI button I can checkpoint the exact list of sites I'm currently viewing so I can later easily restore that context later (eg machine crash due to the 2.4.0-test* kernels I'm running). I'll be updating this patch to the current v2.8 release and sending it to the author as well. Origin: other, http://lists.svlug.org/archives/svlug/2000-September/026797.html Patch-Name: checkpoint.patch --- browser-history.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++++-- browser-history.html | 5 +++ 2 files changed, 125 insertions(+), 4 deletions(-) diff --git a/browser-history.c b/browser-history.c index af229cf..e500e79 100644 --- a/browser-history.c +++ b/browser-history.c @@ -7,6 +7,7 @@ /* Copyright Colas Nahaboo 1996, http://www.inria.fr/koala/colas. * See http://www.inria.fr/koala/colas/browser-history */ +/* Checkpoint patch by J C Lawrence, 2000. */ char *RCS_ID = "$Id: browser-history.c,v 2.8 2000/07/25 15:46:26 colas Exp $"; static char VERSION[8]; /* Compile with: @@ -137,13 +138,16 @@ long delay = 3600L; /* if more seconds,
*/ int tag_mode = 0; /* if another browser-history exists: -1 aborts, 1 kills it, 0 kills unless we are an older version - 2 kills and exit */ + 2 kills and exit + 3 sends SIGUSR1 unless we are an older + version */ int dontgrab = 0; /* for debug */ char *displayname = 0; /* the display name */ Display *dpy; /* the display */ int verbose = 0; /* verbose mode? */ int must_reinit = 0; /* do we need to re-read init files? */ +int checkpoint = 0; /* do we need to checkpoint all URLs? */ Browser_win browser_windows; /* the list of existing N wins */ int browser_windows_size = 0; /* its size */ @@ -203,14 +207,18 @@ int index_of_win(Window win); int URL_already_present(char *name, char *url); void record_URL(int number, char *name, char *url); void reinit_handler(); +void checkpoint_handler(); int verboseXHandler(Display *dpy, XErrorEvent *error); int terseXHandler(Display *dpy, XErrorEvent *error); int is_browser_window(Window win); int decode_ARENA_LOCATION(char *full_name, char **namep, char **urlp); void init_log_file(int first, FILE *fd); +void checkpoint_header(char *datestring, struct tm *times); +void checkpoint_footer(char *datestring, struct tm *times); long add_log_entry(char *name, char *url, unsigned int win, char *datestring, struct tm *times, int separator); void reinit(); +void checkpointURLs(); Window create_tag_window(int mode, int version, char *machine, int pid); char *date2string(struct tm *times); void update_tag_window(Window w, char *name, char *url, unsigned int win, @@ -257,6 +265,8 @@ mainloop() XNextEvent(dpy, &event); if (must_reinit) /* signal 1 was sent */ reinit(); + if (checkpoint) /* signal SIGUSR1 was sent */ + checkpointURLs(); switch (event.type) { case PropertyNotify: /* prop change on tracked window */ @@ -368,6 +378,9 @@ initialize(int argc, char**argv) case 'D': /* -DontGrab */ dontgrab = 1; continue; + case 'c': /* -checkpoint */ + tag_mode = 3; + continue; } } usage(); /* default: unknown option */ @@ -394,6 +407,17 @@ initialize(int argc, char**argv) sigaction(SIGHUP, &action, 0); } + { /* trap signal SIGUSR1, make it checkpoint */ + struct sigaction action; + sigaction(SIGUSR1, 0, &action); +#ifdef SA_RESTART + action.sa_flags |= SA_RESTART; + /* else if no SA_RESTART (SUNs) suppose the default behavior is Ok... */ +#endif + action.sa_handler = checkpoint_handler; + sigaction(SIGUSR1, &action, 0); + } + /* init X */ dpy = XOpenDisplay (displayname); if (!dpy) { @@ -475,6 +499,30 @@ reinit() must_reinit = 0; } +/* Checkpoint all windows */ + +void checkpointURLs () +{ + char *datestring; + struct tm *times; + time_t seconds; + int ndx; + + time(&seconds); + times = localtime(&seconds); + datestring = date2string(times); + + checkpoint_header(datestring, times); + for (ndx = 0; ndx < browser_windows_size; ndx++) { + add_URL(ndx); + } + checkpoint_footer(datestring, times); + + /* Done */ + + checkpoint = 0; +} + int not_excluded_URL(char *url) { @@ -560,6 +608,51 @@ init_log_file(int first, FILE *fd) fflush(fd); } +void checkpoint_header(char *datestring, struct tm *times) +{ + FILE *fd = fopen (logfilepath, "a"); + if (!fd) { /* cannot open? try to make dir */ + char logdir[1024]; + sprintf(logdir, "%s/%s", homedir, logreldir); + mkdir(logdir, 0700); + fd = fopen(logfilepath, "a"); /* retry now */ + } + if (!fd) { /* cannot do anything */ + P(E, "Warning: could not open %s!\n", logfilepath); + return; + } + if (ftell(fd) == 0) { /* init file if empty */ + init_log_file(1, fd); + last_times = *times; + } + + fprintf(fd, "
\n"); + fprintf(fd, "

Currently viewed URLs (checkpoint):

\n"); + fclose(fd); +} + +void checkpoint_footer(char *datestring, struct tm *times) +{ + FILE *fd = fopen(logfilepath, "a"); + if (!fd) { /* cannot open? try to make dir */ + char logdir[1024]; + sprintf(logdir, "%s/%s", homedir, logreldir); + mkdir(logdir, 0700); + fd = fopen(logfilepath, "a"); /* retry now */ + } + if (!fd) { /* cannot do anything */ + P(E, "Warning: could not open %s!\n", logfilepath); + return; + } + if (ftell(fd) == 0) { /* init file if empty */ + init_log_file(1, fd); + last_times = *times; + } + + fprintf(fd, "
\n"); + fclose(fd); +} + long /* current filepos in file, or -1 */ add_log_entry(char *name, char *url, unsigned int win, char *datestring, struct tm *times, int separator) @@ -662,6 +755,11 @@ reinit_handler(int sig, void *sip, void *uap) must_reinit = 1; } +void checkpoint_handler(int sig, void *sip, void *uap) +{ + checkpoint = 1; +} + int terseXHandler(Display *dpy, XErrorEvent *error) {return 0;} @@ -870,7 +968,7 @@ add_URL(int number) } else return; /* unknown browser */ if (url != nilstring && not_excluded_URL(url) - && !URL_already_present(name, url)) { + && (!URL_already_present(name, url) || checkpoint)) { char *datestring; time(&seconds); times = localtime(&seconds); @@ -982,23 +1080,41 @@ create_tag_window(int mode, int version, char *machine, int pid) } if (mode == 2) exit(0); - if (mode == 0) { /* check version */ + if (mode == 0 || mode == 3) { /* check version */ int old_version; + pid_t old_pid; + char *pid_str; + result = XGetWindowProperty(dpy, w, PROCESS, 0, 63, 0, XA_STRING, &actual_type, &actual_format, &nitems, &bytes_after_return, &property); old_version = atoi(strchr(property, '=') + 1); + + /* Get PID of other process. The PID is in the 4th string */ + /* e.g. VERSION=1009\0DATE=96/05/16-09:17:08\0 */ + /* MACHINE=koala\0PID=4345\0 */ + + pid_str = property; + pid_str += strlen(pid_str) + 1; /* DATE */ + pid_str += strlen(pid_str) + 1; /* MACHINE */ + pid_str += strlen(pid_str) + 1; /* PID */ + old_pid = atoi(strchr(pid_str, '=') + 1); + XFree(property); if (version > old_version) { if (verbose) P(E, "killing previous version (%d.%d) of browser-history\n", old_version/1000, old_version%1000); XKillClient(dpy, w); - } else { + } else if (mode == 0) { XUngrabServer(dpy); if (verbose) P(E, "same or more recent version (%d.%d) of browser-history running, aborting\n", old_version/1000, old_version%1000); exit(0); + } else { + /* checkpoint */ + kill(old_pid, SIGUSR1); + exit(0); } } diff --git a/browser-history.html b/browser-history.html index 9d480ba..b5cec2f 100644 --- a/browser-history.html +++ b/browser-history.html @@ -266,6 +266,11 @@ files. deadlocks while debugging, when browser-history or gdb tries to print on the grabbed xterm or emacs. +
-checkpoint
Cause the currently running instance of + browser-history to save a list of all the URLs and their titles that are + currently being viewed by a browser-history compatible browser to the + normal history file as a "checkpoint". +

Specifications of the log files

debian/patches/permissions.patch0000644000000000000000000000144412265214147014220 0ustar From 72afba25f64047475dce590607a71f42da363233 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 14 Jan 2014 10:34:05 +0000 Subject: Create ~/.browser-history with mode 700 - umask, not mode 777 - umask Patch-Name: permissions.patch --- browser-history.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser-history.c b/browser-history.c index feac023..8ebe4c9 100644 --- a/browser-history.c +++ b/browser-history.c @@ -537,7 +537,7 @@ init_excludefile() if (!fd) { /* cannot open? try to make dir */ char logdir[1024]; sprintf(logdir, "%s/%s", homedir, logreldir); - mkdir(logdir, 0777); + mkdir(logdir, 0700); fd = fopen(excludefilepath, "a"); /* retry now */ } if (fd && ftell(fd) == 0) { /* exclude file is empty, fill it */ debian/patches/stdlib.patch0000644000000000000000000000542712265214147013133 0ustar From 2a9f7c35a5837413a158d53a0982adae425065c6 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 14 Jan 2014 10:34:01 +0000 Subject: Remove/update declarations conflicting with The incorrect memory allocation prototypes may have broken on some 64-bit systems. Patch-Name: stdlib.patch --- browser-history.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/browser-history.c b/browser-history.c index e500e79..b1303ed 100644 --- a/browser-history.c +++ b/browser-history.c @@ -8,6 +8,8 @@ * See http://www.inria.fr/koala/colas/browser-history */ /* Checkpoint patch by J C Lawrence, 2000. */ +/* Modifications for Debian GNU/Linux distribution by Karl M. Hegbloom, 1997, + * and Colin Watson, 2001. */ char *RCS_ID = "$Id: browser-history.c,v 2.8 2000/07/25 15:46:26 colas Exp $"; static char VERSION[8]; /* Compile with: @@ -17,6 +19,7 @@ static char VERSION[8]; #define _POSIX_SOURCE /* for solaris (sigaction) */ #define __USE_FIXED_PROTOTYPES__ /* for sunos (stdio.h) */ +#include #include #include #include @@ -178,18 +181,11 @@ char *monthname[] = { "August", "September", "October", "November", "December"}; /******************************************************************* imports */ -extern char *malloc(int bytes); /* WARNING: Dont use these! */ -extern char *realloc(void *ptr, int bytes); -extern void free(void *ptr); - extern Window XmuClientWindow (Display *dpy, Window win); -extern char *getenv(const char *); extern char *strdup(const char *); #define streq !strcmp /* extern char *strchr(const char *s, int c); */ -extern int atoi(char *s); extern int gethostname(char *name, size_t len); -extern int system(char *command); /********************************************************** forward declares */ void initialize(int argc, char **argv); @@ -229,8 +225,8 @@ void init_last_entry(); FILE *add_log_day(FILE *fd, struct tm *times); /* Use these to prevent abortion in case of memory full situations */ -char *Malloc(int bytes); -char *Realloc(void *ptr, int bytes); +char *Malloc(size_t bytes); +char *Realloc(void *ptr, size_t bytes); char *Strdup(char *); #define Free(x) free(x) /* for coherence */ @@ -1195,9 +1191,9 @@ decode_ARENA_LOCATION(char *full_name, char **namep, char **urlp) while(!(retvalue = original args)) sleep(10); \ return (ret_type) retvalue;} -GUARD_FUNCTION(malloc, Malloc, char *, (int bytes), (bytes)) +GUARD_FUNCTION(malloc, Malloc, char *, (size_t bytes), (bytes)) -GUARD_FUNCTION(realloc, Realloc, char *, (void *ptr, int bytes), (ptr, bytes)) +GUARD_FUNCTION(realloc, Realloc, char *, (void *ptr, size_t bytes), (ptr, bytes)) GUARD_FUNCTION(strdup, Strdup, char *, (char *string), (string)) debian/patches/window-handle-comments.patch0000644000000000000000000000156312265214147016232 0ustar From 3b2b3cd2f5975318a09df7846a9c7cfe71bb0141 Mon Sep 17 00:00:00 2001 From: "Karl M. Hegbloom" Date: Tue, 14 Jan 2014 10:34:03 +0000 Subject: Use comments around browser window handles rather than tags This means that they are hidden but still greppable. Patch-Name: window-handle-comments.patch --- browser-history.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser-history.c b/browser-history.c index 0c33f78..feac023 100644 --- a/browser-history.c +++ b/browser-history.c @@ -677,7 +677,7 @@ add_log_entry(char *name, char *url, unsigned int win, fd = add_log_day(fd, times); if (fd) { fprintf(fd, - "%s %s %s %s 0x%x\n", + "%s %s %s %s \n", separator ? "
" : "
", name, url, url, datestring, win); fflush(fd); debian/patches/valid-html.patch0000644000000000000000000000232712265214147013707 0ustar From 04af60672cf05792d820c56986d78284278025cd Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 14 Jan 2014 10:34:04 +0000 Subject: Make browser-history.html valid HTML Patch-Name: valid-html.patch --- browser-history.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/browser-history.html b/browser-history.html index b5cec2f..c168833 100644 --- a/browser-history.html +++ b/browser-history.html @@ -1,10 +1,11 @@ + browser-history web page -

The browser-history web page

+

The browser-history web page

This page describes the utility browser-history, a client-side X daemon maintaining a browser-independent global history of all the web @@ -463,3 +464,5 @@ History of changes, both to the browser-history program and to this page:


Back to table of contents + + debian/patches/typos.patch0000644000000000000000000000302212265214147013015 0ustar From 13a9490cef19c14bca54fe3a4e943a3e835b3756 Mon Sep 17 00:00:00 2001 From: A Costa Date: Tue, 14 Jan 2014 10:34:07 +0000 Subject: Fix typos in browser-history.html Bug-Debian: http://bugs.debian.org/304317 Patch-Name: typos.patch --- browser-history.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser-history.html b/browser-history.html index c168833..82ce2be 100644 --- a/browser-history.html +++ b/browser-history.html @@ -38,7 +38,7 @@ global history, and if you close a window, its whole history is lost. For people browsing lots of sites, having a possibility to track back where one has been before means that you dont have to put everything in your - bookmarks file. If you are not sure if a site may be worth remebering, + bookmarks file. If you are not sure if a site may be worth remembering, don't add it in your bookmarks. If you need it later, just browse your history files. @@ -154,7 +154,7 @@ directory)

browser-history tracks automagically all already present browser windows, and all new ones created in the future. This program has no user -interface. It just appens information to a log file in html format so you can +interface. It just appends information to a log file in html format so you can browse it through a web browser. If more that one hour has passed since last entry, it draws an horizontal lines, and adds H1 headers to delimit new days. Each week (sunday mornings), it archives the week history, compresses it debian/patches/series0000644000000000000000000000027312265214147012040 0ustar compiler-options.patch force-clean.patch checkpoint.patch stdlib.patch excludes.patch window-handle-comments.patch valid-html.patch permissions.patch typos.patch makefile-variables.patch debian/patches/makefile-variables.patch0000644000000000000000000000400312265214147015362 0ustar From 22ba98fa15a217b42c9256d8f4d322c2642e9cde Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 14 Jan 2014 10:34:08 +0000 Subject: Allow overriding compiler and build flags Patch-Name: makefile-variables.patch --- Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index d65c44f..5315759 100644 --- a/Makefile +++ b/Makefile @@ -8,30 +8,34 @@ #SGI: cc +CC := gcc +CFLAGS := -O2 -g -Wall +LDFLAGS := + browser-history: browser-history.c - gcc -ansi -O2 -g -Wall -I/usr/X11R6/include browser-history.c \ - -o browser-history -L/usr/X11R6/lib -lXmu -lX11 + $(CC) -ansi $(CFLAGS) -I/usr/X11R6/include browser-history.c \ + -o browser-history -L/usr/X11R6/lib -lXmu -lX11 $(LDFLAGS) all: - gcc -ansi -O2 -g -Wall -I/usr/X11R6/include browser-history.c \ - -o browser-history -L/usr/X11R6/lib -lXmu -lX11 + $(CC) -ansi $(CFLAGS) -I/usr/X11R6/include browser-history.c \ + -o browser-history -L/usr/X11R6/lib -lXmu -lX11 $(LDFLAGS) cc: cc -I/usr/X11R6/include -ansi -O -o browser-history browser-history.c \ -L/usr/X11R6/lib -lXmu -lX11 bsd: - gcc -I/usr/X11R6/include -ansi -O -Wall -DBSD browser-history.c -o browser-history \ + $(CC) -I/usr/X11R6/include -ansi -O -Wall -DBSD browser-history.c -o browser-history \ -L/usr/X11R6/lib -lXmu -lX11 solaris: - gcc -I/usr/X11R6/include -ansi -O -Wall browser-history.c -o browser-history \ + $(CC) -I/usr/X11R6/include -ansi -O -Wall browser-history.c -o browser-history \ -R/usr/X11R6/lib \ -L/usr/X11R6/lib -lXmu -lX11 -ldl -lsocket -lnsl debug : - gcc -I/usr/X11R6/include -DDEBUG -ansi -g -Wall browser-history.c -o browser-history \ - -L/usr/X11R6/lib -lXmu -lX11 + $(CC) -I/usr/X11R6/include -DDEBUG -ansi -g -Wall browser-history.c -o browser-history \ + -L/usr/X11R6/lib -lXmu -lX11 $(LDFLAGS) tar: cd ..;tar cfvz browser-history/browser-history.tgz `cat browser-history/FILES_DIST` debian/patches/compiler-options.patch0000644000000000000000000000153012265214147015144 0ustar From a944bc5ec40f8c0fa620880780585c685584e68c Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 14 Jan 2014 10:33:58 +0000 Subject: Adjust compiler options to Debian standards Patch-Name: compiler-options.patch --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 35869c4..44ea5be 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,10 @@ browser-history: browser-history.c - gcc -ansi -O -Wall -I/usr/X11R6/include browser-history.c \ + gcc -ansi -O2 -g -Wall -I/usr/X11R6/include browser-history.c \ -o browser-history -L/usr/X11R6/lib -lXmu -lX11 all: - gcc -ansi -O -Wall -I/usr/X11R6/include browser-history.c + gcc -ansi -O2 -g -Wall -I/usr/X11R6/include browser-history.c \ -o browser-history -L/usr/X11R6/lib -lXmu -lX11 cc: debian/patches/excludes.patch0000644000000000000000000000205112265214147013454 0ustar From ea53a02c4f05f9258f6aba9ea59a779e7ba5e7c5 Mon Sep 17 00:00:00 2001 From: "Karl M. Hegbloom" Date: Tue, 14 Jan 2014 10:34:02 +0000 Subject: Add a few more entries to the excludes list Patch-Name: excludes.patch --- browser-history.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/browser-history.c b/browser-history.c index b1303ed..0c33f78 100644 --- a/browser-history.c +++ b/browser-history.c @@ -547,10 +547,15 @@ init_excludefile() P(fd, "# by browser-history\n\n"); P(fd, "# First, we exclude file accesses:\n"); P(fd, "file:\n\n"); + P(fd, "# and the Navigator 4.04 about screens:\n"); + P(fd, "about:\n\n"); P(fd, "# Then, we exclude common search engines...\n"); P(fd, "http://home.netscape.com\n"); P(fd, "http://guide.infoseek.com\n"); - P(fd, "http://altavista.digital.com\n"); + P(fd, "http://altavista.digital.com\n"); + P(fd, "http://www.yahoo.com\n"); + P(fd, "http://yahoo.com\n"); + P(fd, "http://www.google.com\n"); } if (fd) { /* cannot do anything */ fclose(fd); debian/patches/force-clean.patch0000644000000000000000000000101212265214147014012 0ustar From b51232f5c93b88b5594934bb5d5f73c8ae6b862f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 14 Jan 2014 10:33:59 +0000 Subject: Force removal of browser-history on clean Patch-Name: force-clean.patch --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 44ea5be..d65c44f 100644 --- a/Makefile +++ b/Makefile @@ -39,4 +39,4 @@ shar: fshar < FILES | gzip > browser-history.shar.gz clean: - rm browser-history + rm -f browser-history debian/compat0000644000000000000000000000000212265214147010370 0ustar 7 debian/control0000644000000000000000000000300012265214566010573 0ustar Source: browser-history Section: web Priority: optional Maintainer: Colin Watson Build-Depends: dpkg (>= 1.16.1~), debhelper (>= 7.0.50), x11proto-core-dev, libx11-dev, libxmu-dev Standards-Version: 3.9.5 Vcs-Git: git://anonscm.debian.org/users/cjwatson/browser-history.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=users/cjwatson/browser-history.git Package: browser-history Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: cgiwrap | apache | apache-ssl, perl-modules | libcgi-pm-perl Description: User daemon that tracks URLs looked at and logs them Browser-history came from the will to overcome a Netscape bug: there is no global history, and if you close a window, its whole history is lost. For people browsing lots of sites, having the possibility of backtracking to where one has been before means that you don't have to put everything in your bookmarks file. If you are not sure if a site may be worth remembering, don't add it in your bookmarks. If you need it later, just browse your history files. . It works with: Netscape Navigator, Arena, and Amaya. Support for `browser-history' can easily be added to other browsers, provided you can program and have the browser sources. . A manual page and simple documentation will be installed in /usr/share/doc/browser-history/browser-history.html, along with a simple CGI interface to grep the history log and display the result. The optional CGI program requires `cgiwrap' or Apache configured with `suexec'. debian/changelog0000644000000000000000000002032212265215001011031 0ustar browser-history (2.8-16) unstable; urgency=medium * Switch to git; add Vcs-* fields. * Policy version 3.9.5: no changes required. -- Colin Watson Tue, 14 Jan 2014 11:05:36 +0000 browser-history (2.8-15) unstable; urgency=low * Honour 'dpkg-buildflags --get CPPFLAGS' (thanks, Simon Ruderich; closes: #667926). -- Colin Watson Sun, 08 Apr 2012 09:28:51 +0100 browser-history (2.8-14) unstable; urgency=low * Allow cross-compiling, using dpkg-buildflags along the way. -- Colin Watson Mon, 02 Apr 2012 12:30:38 +0100 browser-history (2.8-13) unstable; urgency=low * Convert to source format 3.0 (quilt). * Policy version 3.8.4: no changes required. -- Colin Watson Wed, 17 Feb 2010 01:28:40 +0000 browser-history (2.8-12) unstable; urgency=low * Upgrade to debhelper v7. * Policy version 3.8.2: no changes required. -- Colin Watson Fri, 14 Aug 2009 22:47:20 +0100 browser-history (2.8-11) unstable; urgency=low * Update DEB_BUILD_OPTIONS parsing code from policy 3.8.0. * Build-depend on x11proto-core-dev rather than x-dev (thanks, Lintian; closes: #515366). -- Colin Watson Sun, 15 Feb 2009 20:08:32 +0000 browser-history (2.8-10) unstable; urgency=low * Fix debian/watch to stop prepending "history-" to the real upstream version number. * Use debhelper v5. * Change doc-base section to new hierarchy (now Network/Web Browsing). * Don't ignore errors from 'make clean' other than the Makefile not existing. * Use 'rm -f' in 'make clean'. * Policy version 3.7.3: no changes required. -- Colin Watson Tue, 01 Apr 2008 12:54:45 +0100 browser-history (2.8-9) unstable; urgency=low * Fix typos in browser-history(1) and browser-history.html (thanks, A Costa; closes: #304317). * #include for exit(). * Remove/update declarations conflicting with ; the incorrect memory allocation prototypes may have broken on some 64-bit systems. -- Colin Watson Tue, 12 Apr 2005 12:48:08 +0100 browser-history (2.8-8) unstable; urgency=low * Upgrade to debian/watch format version 2. -- Colin Watson Fri, 18 Feb 2005 00:32:33 +0000 browser-history (2.8-7) unstable; urgency=low * Build-depend on x-dev, libx11-dev, and libxmu-dev rather than the transitional xlibs-dev package. * Policy version 3.6.1: no changes required. -- Colin Watson Fri, 26 Nov 2004 13:35:18 +0000 browser-history (2.8-6) unstable; urgency=low * debian/copyright, debian/watch: Update download URLs. * Clean up browser-history(1): fix overly long line length and dash/hyphen confusion. * debian/control: Tweak short description to keep lintian happy. * Policy version 3.6.0: no changes required. * Remove Emacs local variables from this changelog. -- Colin Watson Tue, 19 Aug 2003 01:18:36 +0100 browser-history (2.8-5) unstable; urgency=low * Policy version 3.5.7: - Drop DEB_BUILD_OPTIONS=debug; support noopt instead. * The binary-indep rule doesn't need to build anything. -- Colin Watson Sat, 7 Sep 2002 20:10:10 +0100 browser-history (2.8-4) unstable; urgency=low * Policy version 3.5.1: no changes required. * Use debhelper v3. * perl-modules contains CGI.pm now, so suggest it as well as libcgi-pm-perl. * Update maintainer address in copyright file and browser-history-search.cgi. -- Colin Watson Sat, 17 Feb 2001 12:18:23 +0000 browser-history (2.8-3) unstable; urgency=low * New maintainer address. Thanks to Oliver Bolzer for his sponsorship until now. * Standards-Version: 3.5.0: no changes required. * Make sure the i386 build is linked against xlibs. -- Colin Watson Thu, 8 Feb 2001 15:50:57 +0000 browser-history (2.8-2) unstable; urgency=low * New maintainer (closes: #68162). * Build-depend on sharutils (we use uudecode). * Standards-Version: 3.2.1: support DEB_BUILD_OPTIONS. * Build with debhelper v2, and turn off DH_VERBOSE. * debian/rules: Various cleanups. * Build with -O2 rather than -O. * Upgraded to optional. It's actually that already in the override file. * Install upstream changelog, extracted from browser-history.html. * Get rid of *_spi entries in our diff to the above that look suspiciously like duplicates of Debian changelog entries. * Don't change browser-history.c's RCS ID, and back out the patch that worked around this by filling in the version number directly. * /usr/doc -> /usr/share/doc in a few bits of documentation. * debian/control: We don't actually work with Mozilla at the moment (bugs have been filed), but Amaya works fine. * Use doc-base rather than having a menu file with needs=dwww. * debian/watch: New-style syntax. * Removed add-log-mailing-address variable from this changelog. * debian/copyright: Updated. * General cosmetic fixes. * Create ~/.browser-history with mode 700 - umask, not mode 777 - umask. * Added Google to the default list of excluded URLs. * CGI shell scripts scare me. Rewrote browser-history-search.cgi in taint-mode Perl. This needs libcgi-pm-perl (now suggested). Installed this as an example rather than directly in the documentation directory. * Updated and applied a patch from J C Lawrence to make the -checkpoint option save a list of all URLs currently being viewed to the history file. This is useful for saving state before visiting, say, a Java-heavy page. The original patch is in debian/checkpoint.patch. -- Colin Watson Sat, 13 Jan 2001 22:01:56 +0000 browser-history (2.8-1) unstable; urgency=medium * New upstream release. (closes: #65173) * This version fixes the Y2K bug. (closes: #56238) * This version compiles with current libc. (closes: #58491) * Set the maintainer to Debian QA because Karl M. Hegbloom has already orphaned the package. * Removed the call to "dh_du" from debian/rules. (closes: #51487) * /usr/doc -> /usr/share/doc * /usr/man -> /usr/share/man * Corrected the section in debian/control from www to web. * Included new upstream debian/browser-history.1 . * Removedthe old ChangeLog.local. * Added build dependencies. * Standards-Version: 3.1.1 -- Adrian Bunk Sat, 11 Nov 2000 23:40:01 +0100 browser-history (2.4-7) frozen unstable; urgency=low * Use `dpkg-buildpackage -sa' to get source upload. -- Karl M. Hegbloom Wed, 22 Apr 1998 07:07:05 -0700 browser-history (2.4-6) frozen; urgency=low * Upload to frozen * Fix grammar in description, and tell of what browsers it works with. (#18879,#19908) -- Karl M. Hegbloom Wed, 8 Apr 1998 06:45:41 -0700 browser-history (2.4-5) unstable; urgency=low * browser-history.c (init_excludefile): Add yahoo and the `about' URL to the excludes list * Added a simple CGI script that can be used along with `cgiwrap' or `suexec' to zgrep the history log and display the result. -- Karl M. Hegbloom Mon, 29 Dec 1997 04:54:24 -0800 browser-history (2.4-4) unstable; urgency=low * Changed history log format slightly - use comments around browser window handles, rather than tags, so they are hidden but still greppable. * Modified the version string to reflect that this is the Debian version. * Changed my address to the debian.org mailbox. * Re-wrote debian/rules using debhelper. * Imported to CVS - ro pserver access available on request. -- Karl M. Hegbloom Sat, 20 Dec 1997 12:08:27 -0800 browser-history (2.4-3) unstable; urgency=low * Recompile with xlib6g * Fix package description to mention man page. -- Karl M. Hegbloom Wed, 24 Sep 1997 08:40:22 -0700 browser-history (2.4-2) unstable; urgency=low * Added a manual page provided by the program's author. -- Karl M. Hegbloom Mon, 22 Sep 1997 08:07:56 -0700 browser-history (2.4-1) unstable; urgency=low * Initial Release. -- Karl M. Hegbloom Wed, 17 Sep 1997 20:17:02 -0700 debian/dirs0000644000000000000000000000001012265214147010045 0ustar usr/bin debian/manpages0000644000000000000000000000003112265214147010702 0ustar debian/browser-history.1