Skip to content

Commit

Permalink
fix dumb dupe-defn breakage in custom ver.m, looks like a bad git mer…
Browse files Browse the repository at this point in the history
…ge resolution

This straight up broke ver() in the resulting app build.
  • Loading branch information
apjanke committed Jan 31, 2024
1 parent 97b0b7b commit 6488c03
Showing 1 changed file with 4 additions and 64 deletions.
68 changes: 4 additions & 64 deletions Mcode/ver.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
## describing Octave and each installed package. The structure includes the
## following fields.
##
## NOTE: This version of @{code} has been customized by Octave.app, and is not
## identical to the version in core Octave.
##
## @table @code
## @item Name
## Package name.
Expand All @@ -55,70 +58,7 @@
## @end deftypefn

## Author: William Poetra Yoga Hadisoeseno <williampoetra@gmail.com>

function retval = ver (package = "")

if (nargin > 1)
print_usage ();
endif

if (nargout == 0)
hg_id = __octave_config_info__ ("hg_id");

[unm, err] = uname ();

if (err)
os_string = "unknown";
else
os_string = sprintf ("%s %s %s %s",
unm.sysname, unm.release, unm.version, unm.machine);
endif

hbar(1:70) = "-";
desc = {hbar
["GNU Octave Version: " OCTAVE_VERSION " (hg id: " hg_id ")"]
["Octave.app Version: " octave_app_release]
["GNU Octave License: " license]
["Operating System: " os_string]
hbar};

printf ("%s\n", desc{:});

if (isempty (package))
pkg ("list");
elseif (strcmpi (package, "Octave"))
## Nothing to do, Octave version was already reported
else
pkg ("list", package);
endif
else
## Get the installed packages
if (isempty (package))
lst = pkg ("list");
## Start with the version info for Octave
retval = struct ("Name", "Octave", "Version", version,
"Release", [],
"Date", __octave_config_info__ ("release_date"));
for i = 1:numel (lst)
retval(end+1) = struct ("Name", lst{i}.name, "Version", lst{i}.version,
"Release", [], "Date", lst{i}.date);
endfor
elseif (strcmpi (package, "Octave"))
retval = struct ("Name", "Octave", "Version", version,
"Release", [], "Date", []);
else
lst = pkg ("list", package);
if (isempty (lst))
retval = struct ("Name", {}, "Version", {},
"Release", {}, "Date", {});
else
retval = struct ("Name", lst{1}.name, "Version", lst{1}.version,
"Release", [], "Date", lst{1}.date);
endif
endif
endif

endfunction
## Author: Andrew Janke <floss@apjanke.net>

function v = ver (package = "")

Expand Down

0 comments on commit 6488c03

Please sign in to comment.