# # # patch "Makefile.PL" # from [780e217031de613e4ae3a26bbb179b06cac1ca21] # to [9dcd21edde9f9d8078acc4f19059b42f373e2713] # # patch "README" # from [cd0190a6d1bc7fa7ede3eb0ec38b1dd7c16643d6] # to [b8f68a1ac9f4ea14a95d97fb25f7ba9c77ca240b] # # patch "devl-install" # from [9eab9fbef6afe2871670f95146b26e721fcf10ea] # to [f64b7c8209f470f42b0c79022eb26792e82dd0b6] # # patch "lib/perl/Common.pm" # from [cd5d8e4b016961e3bd6ffd1af9655bd0fe792578] # to [000f95ec93c27d77d3994a47ad0f32a61c0635b5] # # patch "lib/perl/Preferences.pm" # from [9338c94dbc2d062b841e10bba76b5825587ed6cc] # to [03b4000a401723ce673839dce808ade8d4eaacca] # # patch "linux-installer" # from [e223405a4251e0e8d9ba13558bfd96c3ab9cb516] # to [2f2277a92390cf402ec0ce3d778f25984ca4a58e] # # patch "mtn-browse" # from [2cca409af357ff2a1290088afbea10d5f7813e1b] # to [1dafd8758fabc53bfcd3693cbc0d348fb6eba8ae] # ============================================================ --- Makefile.PL 780e217031de613e4ae3a26bbb179b06cac1ca21 +++ Makefile.PL 9dcd21edde9f9d8078acc4f19059b42f373e2713 @@ -4,15 +4,17 @@ my($dest_dir, use IO::File; my($dest_dir, + $file_comparison, $globs_file, - $help_viewer, + $html_viewer, $lib_dir, $makefile, $no_use_dists_mas, $prefix_dir); my %valid_options = (DESTDIR => \$dest_dir, + FILE_COMPARISON => \$file_comparison, GLOBS_FILE => \$globs_file, - HELP_VIEWER => \$help_viewer, + HTML_VIEWER => \$html_viewer, LIBDIR => \$lib_dir, NO_USE_DISTS_MAS => \$no_use_dists_mas, PREFIX => \$prefix_dir); @@ -35,8 +37,9 @@ foreach my $arg (@ARGV) "usage: perl Makefile.PL [PREFIX=] [DESTDIR=] " . "[LIBDIR=]\n" . " [GLOBS_FILE=] " - . "[HELP_VIEWER=]\n" - . " [NO_USE_DISTS_MAS=1]\n"); + . "[HTML_VIEWER=]\n" + . " [FILE_COMPARISON=] " + . "[NO_USE_DISTS_MAS=1]\n"); exit(1); } } @@ -59,8 +62,9 @@ DESTDIR="$dest_dir" if (! defined($makefile = IO::File->new("Makefile", "w"))); $makefile->print(<print("\t\$(INSTALLER)"); EOF ); $makefile->print("\t\$(INSTALLER)"); -$makefile->print(" --globs-file=\$(GLOBS_FILE)") if (defined($globs_file)); $makefile->print(" --destdir=\$(DESTDIR)") if (defined($dest_dir)); +$makefile->print(" --file-comparison=\$(FILE_COMPARISON)") + if (defined($file_comparison)); +$makefile->print(" --globs-file=\$(GLOBS_FILE)") if (defined($globs_file)); +$makefile->print(" --html-viewer=\$(HTML_VIEWER)") if (defined($html_viewer)); $makefile->print(" --libdir=\$(LIBDIR)") if (defined($lib_dir)); -$makefile->print(" --help-viewer=\$(HELP_VIEWER)") if (defined($help_viewer)); $makefile->print(" --no-use-dists-mas") if (defined($no_use_dists_mas) && $no_use_dists_mas != 0); $makefile->print(" --prefix=\$(PREFIX)") if (defined($prefix_dir)); ============================================================ --- README cd0190a6d1bc7fa7ede3eb0ec38b1dd7c16643d6 +++ README b8f68a1ac9f4ea14a95d97fb25f7ba9c77ca240b @@ -94,7 +94,8 @@ also be specified via Makefile.PL, meaning that the full list of arguments are: perl Makefile.PL PREFIX= DESTDIR= LIBDIR= \ - GLOBS_FILE= HELP_VIEWER= NO_USE_DISTS_MAS=1 + GLOBS_FILE= FILE_COMPARISON= \ + HELP_VIEWER= NO_USE_DISTS_MAS=1 For further information on what these options mean please run: ============================================================ --- devl-install 9eab9fbef6afe2871670f95146b26e721fcf10ea +++ devl-install f64b7c8209f470f42b0c79022eb26792e82dd0b6 @@ -149,7 +149,8 @@ use IO::File; while (defined($input = $infile->getline())) { my $orig = $input; - $input =~ s/address@hidden:HELP_VIEWER_CMD\@//g; + $input =~ s/address@hidden:FILE_COMPARE_CMD\@/kompare/g; + $input =~ s/address@hidden:HTML_VIEWER_CMD\@//g; $input =~ s/address@hidden:LIB_DIR\@/$lib_dir/g; $input =~ s/address@hidden:GLOBS_FILE\@/$globs_file/g; $input =~ s/address@hidden:PREFIX_DIR\@/$prefix_dir/g; ============================================================ --- lib/perl/Common.pm cd5d8e4b016961e3bd6ffd1af9655bd0fe792578 +++ lib/perl/Common.pm 000f95ec93c27d77d3994a47ad0f32a61c0635b5 @@ -71,6 +71,7 @@ sub display_help(;$); sub create_format_tags($); sub data_is_binary($); sub display_help(;$); +sub display_html($); sub file_glob_to_regexp($); sub generate_tmp_path($); sub get_branch_revisions($$$$$); @@ -1218,7 +1219,7 @@ sub handle_comboxentry_history($$;$) # Routine - display_help # # Description - Displays the specified help section either in Gnome's -# native help browser or the desktop's HTML viewer, depending +# native help browser or the specified HTML viewer, depending # upon installation settings. # # Data - $section - The help section to display. If undef is given @@ -1234,7 +1235,7 @@ sub display_help(;$) my $section = $_[0]; - if (HELP_VIEWER_CMD eq "") + if (HTML_VIEWER_CMD eq "") { # Simply let Gnome handle it using yelp. @@ -1252,8 +1253,7 @@ sub display_help(;$) else { - my($cmd, - $url); + my $url; # Use the specified HTML viewer to display the help section. @@ -1279,7 +1279,44 @@ sub display_help(;$) $dialog->destroy(); return; } - $cmd = HELP_VIEWER_CMD; + display_html($url); + + } + +} +# +############################################################################## +# +# Routine - display_html +# +# Description - Displays the specified HTML URL either in Gnome's native +# web browser or the specified HTML viewer, depending upon +# installation settings. +# +# Data - $url - The HTML URL that is to be displayed. +# +############################################################################## + + + +sub display_html($) +{ + + my $url = $_[0]; + + if (HTML_VIEWER_CMD eq "") + { + + # Simply let Gnome handle it. + + Gnome2::URL->show($url); + + } + else + { + + my $cmd = HTML_VIEWER_CMD; + if ($cmd =~ m/\{url\}/) { $cmd =~ s/\{url\}/$url/g; @@ -1322,7 +1359,7 @@ sub register_help_callbacks($@) my $wm = WindowManager->instance(); build_help_ref_to_url_map() - if (HELP_VIEWER_CMD ne "" && keys(%help_ref_to_url_map) == 0); + if (HTML_VIEWER_CMD ne "" && keys(%help_ref_to_url_map) == 0); foreach my $entry (@details) { @@ -1641,11 +1678,23 @@ sub build_help_ref_to_url_map() $prog, $tmp); - # Ask Gnome where the based help directory is. + # Ask Gnome where the based help directory is, failing that have an + # educated guess. - return unless (defined($prog = Gnome2::Program->get_program())); - ($dir_path) = $prog->locate_file("app-help", "mtn-browse.xml", FALSE); - $dir_path = dirname($dir_path); + if (HTML_VIEWER_CMD eq "" + && defined($prog = Gnome2::Program->get_program())) + { + ($dir_path) = $prog->locate_file("app-help", "mtn-browse.xml", FALSE); + $dir_path = dirname($dir_path); + } + else + { + $dir_path = File::Spec->catfile(PREFIX_DIR, + "share", + "gnome", + "help", + APPLICATION_NAME); + } # Work out the locale component, going from the most specific to the least. # If a specific locale directory isn't found then fall back onto the ============================================================ --- lib/perl/Preferences.pm 9338c94dbc2d062b841e10bba76b5825587ed6cc +++ lib/perl/Preferences.pm 03b4000a401723ce673839dce808ade8d4eaacca @@ -1615,7 +1615,8 @@ sub upgrade_preferences($) if ($preferences->{version} == 1) { $preferences->{coloured_diffs} = 1; - $preferences->{diffs_application} = "kompare '{file1}' '{file2}'"; + $preferences->{diffs_application} = + FILE_COMPARE_CMD . " '{file1}' '{file2}'"; $preferences->{version} = 2; } if ($preferences->{version} == 2) @@ -1709,7 +1710,7 @@ sub initialise_preferences() show_line_numbers => 0, static_lists => 0, list_search_as_re => 0, - diffs_application => "kompare '{file1}' '{file2}'", + diffs_application => FILE_COMPARE_CMD . " '{file1}' '{file2}'", fixed_font => "monospace 10", toolbar_settings => {hide_text => 0, fixed => 0}, ============================================================ --- linux-installer e223405a4251e0e8d9ba13558bfd96c3ab9cb516 +++ linux-installer 2f2277a92390cf402ec0ce3d778f25984ca4a58e @@ -79,9 +79,10 @@ use Installer; $dest_dir, $dir, $file, + $file_comparison, $globs_file, $help, - $help_viewer, + $html_viewer, $infile, $input, $installer, @@ -103,28 +104,30 @@ use Installer; $dep_level = 2; $dest_dir = ""; + $file_comparison = "kompare"; $globs_file = "/usr/share/mime/globs"; + $html_viewer = ""; $prefix_dir = "/usr"; $lib_dir = "/lib/mtn-browse"; - $help_viewer = ""; $use_dists_mas_lib = 1; # Process any command line options. $parser = Getopt::Long::Parser->new(); $parser->configure("bundling"); - if (! $parser->getoptions("confirm|c" => \$confirm, - "dep-level=i" => \$dep_level, - "destdir|d=s" => \$dest_dir, - "globs-file|g=s" => \$globs_file, - "help-viewer=s" => \$help_viewer, - "interactive|i" => \$interactive, - "libdir|l=s" => \$lib_dir, - "prefix|p=s" => \$prefix_dir, - "quiet|q" => \$quiet, - "use-dists-mas!" => \$use_dists_mas_lib, - "help|?" => \$help, - "man|m" => \$man)) + if (! $parser->getoptions("confirm|c" => \$confirm, + "dep-level=i" => \$dep_level, + "destdir|d=s" => \$dest_dir, + "file-comparison|f=s" => \$file_comparison, + "globs-file|g=s" => \$globs_file, + "html-viewer=s" => \$html_viewer, + "interactive|i" => \$interactive, + "libdir|l=s" => \$lib_dir, + "prefix|p=s" => \$prefix_dir, + "quiet|q" => \$quiet, + "use-dists-mas!" => \$use_dists_mas_lib, + "help|?" => \$help, + "man|m" => \$man)) { pod2usage(1); } @@ -245,26 +248,26 @@ use Installer; if ($interactive) { - print("Use Yelp or web browser to display help (HELP_VIEWER_CMD)? " - . "[Use Yelp]: "); + print("Program to use for file comparisons (FILE_COMPARE_CMD)? " + . "[" . $file_comparison . "]: "); chomp($input = ); ($input) = ($input =~ m/^\s*(.*)\s*$/); - $help_viewer = $input if ($input ne ""); + $file_comparison = $input if ($input ne ""); } - if ($help_viewer ne "") + if ($file_comparison ne "") { my $found; # Check full paths or scan $PATH for it. - if ($help_viewer =~ m/^\//) + if ($file_comparison =~ m/^\//) { - $found = 1 if (-x $help_viewer); + $found = 1 if (-x $file_comparison); } else { my $cmd; - $cmd = (split(/[[:blank:]]/, $help_viewer))[0]; + $cmd = (split(/[[:blank:]]/, $file_comparison))[0]; foreach my $dir (split(/:/, $ENV{PATH})) { if (-x "${dir}/$cmd") @@ -277,7 +280,7 @@ use Installer; if (! $found) { - print("Error: Program `" . $help_viewer + print("Error: Program `" . $file_comparison . "' cannot be found or is not executable.\n"); exit(1) if (! $interactive); next; @@ -286,6 +289,48 @@ use Installer; if ($interactive) { + print("Use Yelp or web browser to display help (HTML_VIEWER_CMD)? " + . "[" . (($html_viewer ne "") ? $html_viewer : "Use Yelp") + . "]: "); + chomp($input = ); + ($input) = ($input =~ m/^\s*(.*)\s*$/); + $html_viewer = $input if ($input ne ""); + } + if ($html_viewer ne "") + { + my $found; + + # Check full paths or scan $PATH for it. + + if ($html_viewer =~ m/^\//) + { + $found = 1 if (-x $html_viewer); + } + else + { + my $cmd; + $cmd = (split(/[[:blank:]]/, $html_viewer))[0]; + foreach my $dir (split(/:/, $ENV{PATH})) + { + if (-x "${dir}/$cmd") + { + $found = 1; + last; + } + } + } + + if (! $found) + { + print("Error: Program `" . $html_viewer + . "' cannot be found or is not executable.\n"); + exit(1) if (! $interactive); + next; + } + } + + if ($interactive) + { print("Use the Monotone::AutomateStdio (MAS) library that came " . "with this package? [Y]: "); chomp($input = ); @@ -302,13 +347,14 @@ use Installer; if ($confirm || $interactive || ! $quiet) { print("\nInstallation options are:\n"); - print("GLOBS_FILE = " . $globs_file . "\n"); - print("PREFIX_DIR = " . $prefix_dir . "\n"); - print("DEST_DIR = " . $dest_dir . "\n"); - print("LIB_DIR = /" . $lib_dir . "\n"); - print("HELP_VIEWER_CMD = " - . (($help_viewer ne "") ? $help_viewer : "Use Yelp") . "\n"); - print("Use my MAS = " . ($use_dists_mas_lib ? "Yes" : "No") + print("GLOBS_FILE = " . $globs_file . "\n"); + print("PREFIX_DIR = " . $prefix_dir . "\n"); + print("DEST_DIR = " . $dest_dir . "\n"); + print("LIB_DIR = /" . $lib_dir . "\n"); + print("FILE_COMPARE_CMD = " . $file_comparison . "\n"); + print("HTML_VIEWER_CMD = " + . (($html_viewer ne "") ? $html_viewer : "Use Yelp") . "\n"); + print("Use my MAS = " . ($use_dists_mas_lib ? "Yes" : "No") . "\n"); } if ($interactive) @@ -343,7 +389,8 @@ use Installer; if (! defined($outfile = IO::File->new("mtn-browse.out", "w"))); while (defined($input = $infile->getline())) { - $input =~ s/address@hidden:HELP_VIEWER_CMD\@/$help_viewer/g; + $input =~ s/address@hidden:FILE_COMPARE_CMD\@/$file_comparison/g; + $input =~ s/address@hidden:HTML_VIEWER_CMD\@/$html_viewer/g; $input =~ s/address@hidden:LIB_DIR\@/$lib_prefix_dir/g; $input =~ s/address@hidden:GLOBS_FILE\@/$globs_file/g; $input =~ s/address@hidden:PREFIX_DIR\@/$prefix_dir/g; @@ -434,7 +481,7 @@ use Installer; next if ($locale eq "." || $locale eq ".."); my($figures_dir, $img_file); - if ($help_viewer ne "") + if ($html_viewer ne "") { my($html_file, $subdir); @@ -517,8 +564,9 @@ linux-installer [options] --confirm -c Print out what will happen first --dep-level= LEVEL Specify type of dependency checking --destdir= -d DIR Specify temp installation location + --file-comparison -f PATH File comparison command --globs-file= -g FILE Location of MIME globs file - --help-viewer PATH Viewer used to display help files + --html-viewer PATH Viewer used to display help files --interactive -i Ask questions interactively --libdir= -l DIR Library dir relative to PREFIX_DIR --prefix= -p DIR Installation location @@ -554,26 +602,34 @@ maintainers. the PREFIX_DIR directory. This option is particularly useful for package maintainers. +=item B<--file-comparison=PATH or -f PATH> + +Specify the name of the command used for doing detailed, side by side, file +comparisons. This defaults to kompare. + =item B<--globs-file=FILE or -g FILE> Specify the location of the system's MIME globs file. The default is /usr/share/mime/globs. -=item B<--help-viewer> +=item B<--html-viewer> -Specify the the program used to display the HTML help pages. Normally Yelp -style help documentation is installed (in the form of XML files). Whilst Yelp -is the Gnome desktop's help system there are some installations where Yelp -itself is not available. In these situations one can specify the name of a web -browser that can be used to display the help documentation in the form of HTML -files (i.e. there is no need for the web browser to understand Yelp XML files). +Specify the the program used to display the HTML help pages and URLs. Normally +Yelp style help documentation is installed (in the form of XML files) and +Gnome's default help and web browser are used. Whilst Yelp is the Gnome +desktop's help system there are some installations where Yelp itself or parts +of Gnome are not available. In these situations one can specify the name of a +web browser that can be used to display the help documentation in the form of +HTML files (i.e. there is no need for the web browser to understand Yelp XML +files) and normal URLs. Specifying this switch has two effects. Firstly mtn-browse is configured to run -the specified web browser when it needs to display help documentation, and -secondly HTML documentation is installed in the place of the Yelp XML +the specified web browser when it needs to display help documentation or URLs, +and secondly HTML documentation is installed in the place of the Yelp XML documentation. -The default is to use Yelp and simply install the XML documentation files. +The default is to use Yelp, use Gnome's default web browser and install the XML +documentation files. =item B<--interactive or -i> ============================================================ --- mtn-browse 2cca409af357ff2a1290088afbea10d5f7813e1b +++ mtn-browse 1dafd8758fabc53bfcd3693cbc0d348fb6eba8ae @@ -44,10 +44,11 @@ BEGIN BEGIN { - use constant HELP_VIEWER_CMD => "@INST:HELP_VIEWER_CMD@"; - use constant LIB_DIR => "@INST:LIB_DIR@"; - use constant MIME_GLOB_FILE => "@INST:GLOBS_FILE@"; - use constant PREFIX_DIR => "@INST:PREFIX_DIR@"; + use constant FILE_COMPARE_CMD => "@INST:FILE_COMPARE_CMD@"; + use constant HTML_VIEWER_CMD => "@INST:HTML_VIEWER_CMD@"; + use constant LIB_DIR => "@INST:LIB_DIR@"; + use constant MIME_GLOB_FILE => "@INST:GLOBS_FILE@"; + use constant PREFIX_DIR => "@INST:PREFIX_DIR@"; } use locale; use strict; @@ -119,7 +120,7 @@ use constant UI_DIR => File::Spec->catfi use constant UI_DIR => File::Spec->catfile(PREFIX_DIR, "share", - "mtn-browse", + APPLICATION_NAME, "glade"); # The type of window that is going to be managed by this module. @@ -241,7 +242,9 @@ sub view_button_clicked_cb($$); eval { - $tmp_dir = tempdir("mtn-browse_XXXXXXXXXX", TMPDIR => 1, CLEANUP => 1); + $tmp_dir = tempdir(APPLICATION_NAME . "_XXXXXXXXXX", + TMPDIR => 1, + CLEANUP => 1); }; if ($@ ne "") { @@ -493,7 +496,7 @@ sub home_page_activate_cb($$) eval { - Gnome2::URL->show("http://www.coosoft.plus.com/software.html"); + display_html("http://www.coosoft.plus.com/software.html"); }; if ($@ ne "") { @@ -536,7 +539,7 @@ sub about_activate_cb($$) local $browser->{in_cb} = 1; $large_logo = Gtk2::Gdk::Pixbuf->new_from_file - (File::Spec->catfile(LIB_DIR, "ui", "mtn-browse-large.png")) + (File::Spec->catfile(UI_DIR, "mtn-browse-large.png")) if (! defined($large_logo)); Gnome2::About->new (APPLICATION_NAME,