# HG changeset patch # User Carlo de Falco # Date 1331916183 -3600 # Node ID 2725e744cfa92871419ee4c476168219e0c4691a # Parent 29aabe9b37a2e1de0fcc90ff950a556491c5ee54 maint: Remove redundant private function from the package manager. * pkg/private/isautoload.m: remove file. * pkg/private/install.m: remove call to isautoload. diff -r 29aabe9b37a2 -r 2725e744cfa9 scripts/pkg/module.mk --- a/scripts/pkg/module.mk Thu Mar 15 20:03:01 2012 -0700 +++ b/scripts/pkg/module.mk Fri Mar 16 17:43:03 2012 +0100 @@ -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 -r 29aabe9b37a2 -r 2725e744cfa9 scripts/pkg/private/get_forge_pkg.m --- a/scripts/pkg/private/get_forge_pkg.m Thu Mar 15 20:03:01 2012 -0700 +++ b/scripts/pkg/private/get_forge_pkg.m Fri Mar 16 17:43:03 2012 +0100 @@ -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 -r 29aabe9b37a2 -r 2725e744cfa9 scripts/pkg/private/install.m --- a/scripts/pkg/private/install.m Thu Mar 15 20:03:01 2012 -0700 +++ b/scripts/pkg/private/install.m Fri Mar 16 17:43:03 2012 +0100 @@ -259,12 +259,23 @@ ## 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; endif + endfor ## Add the packages to the package list. diff -r 29aabe9b37a2 -r 2725e744cfa9 scripts/pkg/private/isautoload.m --- a/scripts/pkg/private/isautoload.m Thu Mar 15 20:03:01 2012 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -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} address@hidden =} 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 -