Mercurial > hg > octave-lyh
diff scripts/pkg/pkg.m @ 14858:a82fcd612c8f
pkg.m: Check if the prefix directory can be created; don't fail silently
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Thu, 12 Jul 2012 10:58:42 -0400 |
parents | 7371e127c351 |
children | e027f98403c3 |
line wrap: on
line diff
--- a/scripts/pkg/pkg.m +++ b/scripts/pkg/pkg.m @@ -424,7 +424,10 @@ try prefix = absolute_pathname (prefix); catch - mkdir (prefix); + [status, msg, msgid] = mkdir (prefix); + if (status == 0) + error("cannot create prefix %s: %s", prefix, msg); + endif warning ("creating the directory %s\n", prefix); prefix = absolute_pathname (prefix); end_try_catch @@ -436,7 +439,10 @@ try archprefix = absolute_pathname (archprefix); catch - mkdir (archprefix); + [status, msg, msgid] = mkdir (archprefix); + if (status == 0) + error("cannot create prefix %s: %s", prefix, msg); + endif warning ("creating the directory %s\n", archprefix); archprefix = absolute_pathname (archprefix); end_try_catch