help-octave
[Top][All Lists]
Advanced

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

Pkg strange behavior


From: Thomas D. Dean
Subject: Pkg strange behavior
Date: Fri, 2 Jun 2017 23:45:49 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1

It is late, so my old eyes are most likely missing something.

I am using octave from the latest hg, built today.
GNU Octave, version 4.3.0+
Copyright (C) 2016 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

I typed in all the commands in my
__geographiclib_package_register__.m
and it worked.

octave:21> lat1 = -33.83; lon1 = 151.29;
octave:22> lat2 = -33.02; lon2 = -71.64;
octave:23> [s12g, azi1g] = gedistance(lat1, lon1, lat2, lon2);
octave:24> s12g
s12g =    1.1356e+07
octave:25> azi1g
azi1g =  144.16

which is what I expected.

But, octave can not find that file!

octave:27> pkg list
Package Name       | Version | Installation directory
-------------------+---------+-----------------------
          control  |   3.0.0 | /home/tomdean/octave/control-3.0.0
   data-smoothing  |   1.3.0 | /home/tomdean/octave/data-smoothing-1.3.0
          general  |   2.0.0 | /home/tomdean/octave/general-2.0.0
    geographiclib *|   1.0.0 | /home/tomdean/octave/geographiclib-1.0.0
         geometry  |   3.0.0 | /home/tomdean/octave/geometry-3.0.0
            image  |   2.6.1 | /home/tomdean/octave/image-2.6.1
image-acquisition  |   0.2.2 | /home/tomdean/octave/image-acquisition-0.2.2
         interval  |   2.1.0 | /home/tomdean/octave/interval-2.1.0
               io  |   2.4.7 | /home/tomdean/octave/io-2.4.7
   linear-algebra  |   2.2.2 | /home/tomdean/octave/linear-algebra-2.2.2
          mapping  |   1.2.1 | /home/tomdean/octave/mapping-1.2.1
    miscellaneous  |   1.2.1 | /home/tomdean/octave/miscellaneous-1.2.1
              ocs  |   0.1.5 | /home/tomdean/octave/ocs-0.1.5
           odebvp  |   1.0.6 | /home/tomdean/octave/odebvp-1.0.6
           odepkg  |   0.8.5 | /home/tomdean/octave/odepkg-0.8.5
            optim  |   1.5.2 | /home/tomdean/octave/optim-1.5.2
       quaternion  |   2.4.0 | /home/tomdean/octave/quaternion-2.4.0
           signal  |   1.3.2 | /home/tomdean/octave/signal-1.3.2
          specfun  |   1.1.0 | /home/tomdean/octave/specfun-1.1.0
       statistics  |   1.3.0 | /home/tomdean/octave/statistics-1.3.0
           struct  |  1.0.14 | /home/tomdean/octave/struct-1.0.14
         symbolic  |   2.5.0 | /home/tomdean/octave/symbolic-2.5.0
          tomdean  |   1.0.0 | /home/tomdean/octave/tomdean-1.0.0
octave:28> pkg unload geographiclib
error: '__geographiclib_package_register__' undefined near line 2 column 1
error: called from
    /home/tomdean/octave/geographiclib-1.0.0/PKG_DEL at line 2 column 1
    unload_packages at line 70 column 7
    pkg at line 417 column 7
octave:28> system('cat __geographiclib_package_register__.m')
## Copyright (C) 2017 Thomas Dean <address@hidden
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 3 of the
## License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, see
## <http:##www.gnu.org/licenses/>.

## -*- texinfo -*-
## @deftypefn {} {} __geographicliblib_package_register__ ()
## Undocumented internal function of geographicliblib package.
## @end deftypefn

## PKG_ADD: __geographiclib_package_register__ (1);
## PKG_DEL: __geographiclib_package_register__ (-1);

function subdir_paths = __geographiclib_package_register__ (loading = 0)

  subdirlist = {"geographiclib", "geographiclib-legacy"};
  ## Get full path, with luck we can retreive the package name from here
base_pkg_path = fileparts (make_absolute_filename (mfilename ("fullpath")));

  subdir_paths = fullfile (base_pkg_path, subdirlist);
  if (loading > 0)
    addpath (subdir_paths{:});
  elseif (loading < 0)
    rmpath (subdir_paths{:});
  endif

endfunction
ans = 0
octave:29> pwd
ans = /home/tomdean/octave/geographiclib-1.0.0
octave:30> ls -l
total 1
-rw-r--r-- 1 tomdean tomdean    0 Jun  2 22:57 COPYING
-rw-r--r-- 1 tomdean tomdean  259 Jun  2 22:59 DESCRIPTION
-rw-r--r-- 1 tomdean tomdean 1104 Jun  2 23:13 INDEX
-rw-r--r-- 1 tomdean tomdean   41 Jun  2 23:19 PKG_ADD
-rw-r--r-- 1 tomdean tomdean   42 Jun  2 23:19 PKG_DEL
-rwxr-xr-x 1 tomdean tomdean 1440 Jun 2 23:17 __geographiclib_package_register__.m
drwxr-xr-x 3 tomdean tomdean 4096 Jun  2 23:09 geographiclib
drwxr-xr-x 2 tomdean tomdean 4096 Jun  2 23:09 geographiclib-legacy
drwxr-xr-x 2 tomdean tomdean 4096 Jun  2 22:46 packinfo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]