# HG changeset patch # User dbateman # Date 1181860436 0 # Node ID 9b4c16beea1c3685871430630b9a034352151d8e # Parent a25173d58101f719542de263c7e771feed2fb4eb [project @ 2007-06-14 22:33:56 by dbateman] diff -r a25173d58101 -r 9b4c16beea1c scripts/pkg/pkg.m --- a/scripts/pkg/pkg.m Thu Jun 14 21:10:48 2007 +0000 +++ b/scripts/pkg/pkg.m Thu Jun 14 22:33:56 2007 +0000 @@ -215,7 +215,7 @@ case "-local" global_install = false; if (! user_prefix) - prefix = fullfile ("~", "octave"); + prefix = tilde_expand (fullfile ("~", "octave")); endif case "-global" global_install = true; @@ -297,7 +297,13 @@ elseif (length (files) == 0 && nargout == 1) local_packages = local_list; elseif (length (files) == 1 && nargout == 0 && ischar (files{1})) - local_list = absolute_pathname (files{1}); + try + local_list = absolute_pathname (files{1}); + catch + ## Force file to be created + fclose (fopen (files{1}, 'wt')); + local_list = absolute_pathname (files{1}); + end_try_catch else error ("you must specify a local_list file, or request an output argument"); endif @@ -308,7 +314,13 @@ elseif (length (files) == 0 && nargout == 1) local_packages = global_list; elseif (length (files) == 1 && nargout == 0 && ischar (files{1})) - global_list = absolute_pathname (files{1}); + try + global_list = absolute_pathname (files{1}); + catch + ## Force file to be created + fclose (fopen (files{1}, 'wt')); + global_list = absolute_pathname (files{1}); + end_try_catch else error ("you must specify a global_list file, or request an output argument"); endif @@ -853,7 +865,11 @@ function pth = absolute_pathname (pth) [status, msg, msgid] = fileattrib(pth); - pth = msg.Name; + if (status != 1) + error ("could not find the file or path %s", pth); + else + pth = msg.Name; + endif endfunction function repackage (builddir, buildlist)