Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-qtype_stack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-qtype_stack
Commits
ab3e7b57
Commit
ab3e7b57
authored
1 year ago
by
Matti Harjula
Browse files
Options
Downloads
Patches
Plain Diff
Small fixes to the new version number extraction script.
parent
e271fc86
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cli/getversionstring.php
+17
-9
17 additions, 9 deletions
cli/getversionstring.php
with
17 additions
and
9 deletions
cli/getversionstring.php
+
17
−
9
View file @
ab3e7b57
...
@@ -59,18 +59,18 @@ if ($unrecognized) {
...
@@ -59,18 +59,18 @@ if ($unrecognized) {
}
}
if
(
$options
[
'help'
])
{
if
(
$options
[
'help'
])
{
echo
"This script extracts version numbers from various sources in the code
echo
"This script extracts version numbers from various sources in the code
.
t
he numbers it provides are as follows:
T
he numbers it provides are as follows:
- 'pluginversion', the version number, the date one, of the plugin from version.php.
- 'pluginversion', the version number, the date one, of the plugin from version.php.
- 'pluginname', the version number, the human one, of the plugin from version.php.
- 'pluginname', the version number, the human one, of the plugin from version.php.
- 'stackmaxima', the version nu
b
mer at the end of stackmaxima.mac.
- 'stackmaxima', the version num
b
er at the end of stackmaxima.mac.
- 'maximas', the supported Maximas from settings.php.
- 'maximas', the supported Maximas from settings.php.
- 'requiredmoodle', the minimum Moodle version.
- 'requiredmoodle', the minimum Moodle version
from version.php
.
With the additional option --only one can query for only one of these.
With the additional option
'
--only
'
one can query for only one of these.
e.g. '--only=pluginname'. By default outputs
all
in the order used in that
table in
e.g. '--only=pluginname'. By default outputs
selected ones
in the order used in that
the docs.
table in
the docs.
"
;
"
;
exit
(
0
);
exit
(
0
);
}
}
...
@@ -85,10 +85,11 @@ if (!preg_match('~stackmaximaversion:(\d{10})~',
...
@@ -85,10 +85,11 @@ if (!preg_match('~stackmaximaversion:(\d{10})~',
$stackmaxima
=
$matches
[
1
];
$stackmaxima
=
$matches
[
1
];
$pluginversion
=
$plugin
->
version
;
$pluginversion
=
$plugin
->
version
;
$requiredmoodle
=
$plugin
->
requires
;
$requiredmoodle
=
$plugin
->
requires
;
$pluginname
=
explode
(
' '
,
$plugin
->
release
)[
0
];
$pluginname
=
explode
(
' '
,
trim
(
$plugin
->
release
)
)
[
0
];
$maximas
=
implode
(
', '
,
$settings
->
maximaversions
);
$maximas
=
implode
(
', '
,
$settings
->
maximaversions
);
if
(
$stackmaxima
!=
$pluginversion
)
{
if
(
$stackmaxima
!=
$pluginversion
)
{
echo
"
$stackmaxima
!=
$pluginversion
\n
"
;
throw
new
coding_exception
(
'Maxima libraries version number not matching plugin version number.'
);
throw
new
coding_exception
(
'Maxima libraries version number not matching plugin version number.'
);
}
}
...
@@ -97,7 +98,7 @@ switch($options['only']) {
...
@@ -97,7 +98,7 @@ switch($options['only']) {
echo
"
$pluginname
|
$pluginversion
|
$maximas
\n
"
;
echo
"
$pluginname
|
$pluginversion
|
$maximas
\n
"
;
break
;
break
;
case
'stackmaxima'
:
case
'stackmaxima'
:
echo
"stackmaxima
\n
"
;
echo
"
$
stackmaxima
\n
"
;
break
;
break
;
case
'maximas'
:
case
'maximas'
:
echo
"
$maximas
\n
"
;
echo
"
$maximas
\n
"
;
...
@@ -111,4 +112,11 @@ switch($options['only']) {
...
@@ -111,4 +112,11 @@ switch($options['only']) {
case
'requiredmoodle'
:
case
'requiredmoodle'
:
echo
"
$requiredmoodle
\n
"
;
echo
"
$requiredmoodle
\n
"
;
break
;
break
;
default
:
echo
"Unknown option for '--only', the options are:
- 'pluginversion', the version number, the date one, of the plugin from version.php.
- 'pluginname', the version number, the human one, of the plugin from version.php.
- 'stackmaxima', the version number at the end of stackmaxima.mac.
- 'maximas', the supported Maximas from settings.php.
- 'requiredmoodle', the minimum Moodle version from version.php.
\n\n
"
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment