# HG changeset patch # User Carlo de Falco # Date 1331920474 -3600 # Node ID aad7ad0e15c1860adf44d42c7e6fd531edd1d0a6 # Parent 29aabe9b37a2e1de0fcc90ff950a556491c5ee54 maint: Remove redundant private function from the package manager. * pkg/private/isautoload.m: remove file. * pkg/private/install.m: remove calls to isautoload. diff --git a/scripts/pkg/module.mk b/scripts/pkg/module.mk --- a/scripts/pkg/module.mk +++ b/scripts/pkg/module.mk @@ -23,7 +23,6 @@ pkg/private/install.m \ pkg/private/installed_packages.m \ pkg/private/is_architecture_dependent.m \ - pkg/private/isautoload.m \ pkg/private/issuperuser.m \ pkg/private/list_forge_packages.m \ pkg/private/load_package_dirs.m \ diff --git a/scripts/pkg/private/get_forge_pkg.m b/scripts/pkg/private/get_forge_pkg.m --- a/scripts/pkg/private/get_forge_pkg.m +++ b/scripts/pkg/private/get_forge_pkg.m @@ -1,3 +1,4 @@ +## Copyright (C) 2005-2012 S�ren Hauberg ## Copyright (C) 2010-2012 VZLU Prague, a.s. ## ## This file is part of Octave. diff --git a/scripts/pkg/private/install.m b/scripts/pkg/private/install.m --- a/scripts/pkg/private/install.m +++ b/scripts/pkg/private/install.m @@ -259,12 +259,25 @@ ## If the package requested that it is autoloaded, or the installer ## requested that it is, then mark the package as autoloaded. + str_true = {"true", "on", "yes", "1"}; for i = length (descriptions):-1:1 - if (autoload > 0 || (autoload == 0 && isautoload (descriptions(i)))) + + desc_autoload = false; + if (isfield (descriptions{i}, "autoload")) + a = descriptions{i}.autoload; + desc_autoload = ((isnumeric (a) && a > 0) + || (ischar (a) + && any (strcmpi (a, str_true)))); + endif + + if (autoload > 0 || desc_autoload) fclose (fopen (fullfile (descriptions{i}.dir, "packinfo", ".autoload"), "wt")); descriptions{i}.autoload = 1; + else + descriptions{i}.autoload = 0; endif + endfor ## Add the packages to the package list. @@ -309,7 +322,7 @@ if (length (descriptions) > 0) idx = []; for i = 1:length (descriptions) - if (isautoload (descriptions(i))) + if (descriptions{i}.autoload > 0) nm = descriptions{i}.name; for j = 1:length (installed_pkgs_lst) if (strcmp (nm, installed_pkgs_lst{j}.name)) diff --git a/scripts/pkg/private/isautoload.m b/scripts/pkg/private/isautoload.m deleted file mode 100644 --- a/scripts/pkg/private/isautoload.m +++ /dev/null @@ -1,38 +0,0 @@ -## Copyright (C) 2005-2012 S�ren Hauberg -## Copyright (C) 2010 VZLU Prague, a.s. -## -## This file is part of Octave. -## -## Octave 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. -## -## Octave 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 Octave; see the file COPYING. If not, see -## . - -## -*- texinfo -*- -## @deftypefn {Function File} {@var{auto} =} isautoload (@var{desc}) -## Undocumented internal function. -## @end deftypefn - -function auto = isautoload (desc) - auto = false; - if (isfield (desc{1}, "autoload")) - a = desc{1}.autoload; - if ((isnumeric (a) && a > 0) - || (ischar (a) && (strcmpi (a, "true") - || strcmpi (a, "on") - || strcmpi (a, "yes") - || strcmpi (a, "1")))) - auto = true; - endif - endif -endfunction -