[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Pkg-octave-devel] [RFC] patch octave to help users install auxiliary packages



* Thomas Weber <tweber@debian.org> [2013-08-06 00:17]:

Upstream is the wrong level for this sort of patch - after a while, you have detection code for Debian/Ubuntu/Fedora/Redhat/OpenSuse/TopDistroWatchDistributionOfTheMonth/...

Agreed.

What about a distribution-agnostic approach? This is exemplified in the simple-minded patch attached below. The distro-specific barking file would be put somewhere in the path by the package maintainers, without the need of patching upstream files. A possible barking file for Debian is also attached below.

Rafael

P.S.: I hope you do not take seriously the name that I chose for the distro-specific function, even though my proposal *_is_* serious.



diff -r 1c2f14a7935d scripts/help/doc.m
--- a/scripts/help/doc.m	Mon Aug 05 15:54:56 2013 -0700
+++ b/scripts/help/doc.m	Tue Aug 06 12:11:15 2013 +0200
@@ -81,6 +81,16 @@
         info_file_name = info_file ();
       endif
 
+      [stat_info, err] = stat (info_file_name);
+
+      if (err < 0)
+          if exist ("bark_according_to_distro") == 2
+              bark_according_to_distro ("no-octave-info");
+          else
+              error ("doc: info file not found'");
+          endif
+      endif
+
       ## FIXME -- don't change the order of the arguments below because
       ## the info-emacs-info script currently expects --directory DIR as
       ## the third and fourth arguments.  Someone should fix that.
diff -r 1c2f14a7935d scripts/miscellaneous/mkoctfile.m
--- a/scripts/miscellaneous/mkoctfile.m	Mon Aug 05 15:54:56 2013 -0700
+++ b/scripts/miscellaneous/mkoctfile.m	Tue Aug 06 12:11:15 2013 +0200
@@ -162,6 +162,9 @@
   if (sys == 127)
     warning ("unable to find mkoctfile in expected location: '%s'",
              shell_script);
+    if exist ("bark_according_to_distro") == 2
+        bark_according_to_distro ("no-mkoctfile");
+    endif
 
     warning ("mkoctfile exited with failure status");
   endif
function bark_according_to_distro (code)

    if strcmp (code, "no-octave-info")
        error ("doc: info file not found, please install the Debian package 'octave-info'");
    elseif strcmp (code, "no-mkoctfile")
        warning ("mkoctfile: please install the Debian package 'liboctave-dev'");
    endif

endfunction

Reply to: