Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
e3-require
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Lindh Olsson
e3-require
Commits
a6ab90b8
Commit
a6ab90b8
authored
4 years ago
by
Simon Rose
Browse files
Options
Downloads
Patches
Plain Diff
Updated formatting to be more standard
parent
dd5d5877
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
require-ess/src/require.c
+8
-1
8 additions, 1 deletion
require-ess/src/require.c
require-ess/src/version.c
+16
-8
16 additions, 8 deletions
require-ess/src/version.c
with
25 additions
and
9 deletions
CHANGELOG.md
+
1
−
0
View file @
a6ab90b8
...
...
@@ -20,6 +20,7 @@
*
Fixed issue with module name checking which caused modules to fail to build on certain linux distributions
*
Exact module version is fetched correctly at build-time to ensure that new releases do not affect upstream dependencies
*
Issue involving priority between some test versions fixed
*
`make patch`
when there are no patch files will no longer return an error code.
## Other changes
*
Removed
`require`
as a submodule and merged it into
`e3-require`
.
...
...
This diff is collapsed.
Click to expand it.
require-ess/src/require.c
+
8
−
1
View file @
a6ab90b8
...
...
@@ -823,18 +823,25 @@ static int compareDigit(int found, int requested, const char *name)
return
MATCH
;
}
static
int
compareNumericVersion
(
semver_t
*
sv_found
,
semver_t
*
sv_request
,
int
already_matched
)
{
static
int
compareNumericVersion
(
semver_t
*
sv_found
,
semver_t
*
sv_request
,
int
already_matched
)
{
int
match
;
match
=
compareDigit
(
sv_found
->
major
,
sv_request
->
major
,
"major"
);
if
(
match
!=
MATCH
)
{
return
match
;
}
match
=
compareDigit
(
sv_found
->
minor
,
sv_request
->
minor
,
"minor"
);
if
(
match
!=
MATCH
)
{
return
match
;
}
match
=
compareDigit
(
sv_found
->
patch
,
sv_request
->
patch
,
"patch"
);
if
(
match
!=
MATCH
)
{
return
match
;
}
if
(
sv_request
->
build
==
-
1
)
{
...
...
This diff is collapsed.
Click to expand it.
require-ess/src/version.c
+
16
−
8
View file @
a6ab90b8
...
...
@@ -4,12 +4,14 @@
#include
<stdio.h>
#include
"version.h"
void
cleanup_semver
(
semver_t
*
s
)
{
void
cleanup_semver
(
semver_t
*
s
)
{
free
(
s
->
version_str
);
free
(
s
);
}
static
void
init_semver
(
const
char
*
version
,
semver_t
*
s
)
{
static
void
init_semver
(
const
char
*
version
,
semver_t
*
s
)
{
s
->
version_str
=
calloc
(
strlen
(
version
)
+
1
,
sizeof
(
char
));
strcpy
(
s
->
version_str
,
version
);
s
->
test_str
=
""
;
...
...
@@ -20,7 +22,8 @@ static void init_semver(const char *version, semver_t *s) {
s
->
build
=
-
1
;
}
static
void
fetch_part
(
char
*
version_str
,
regmatch_t
*
groups
,
unsigned
int
ix
,
int
*
part
)
{
static
void
fetch_part
(
char
*
version_str
,
const
regmatch_t
*
groups
,
unsigned
int
ix
,
int
*
part
)
{
char
tmp
;
tmp
=
version_str
[
groups
[
ix
].
rm_eo
];
...
...
@@ -29,7 +32,8 @@ static void fetch_part(char *version_str, regmatch_t *groups, unsigned int ix, i
version_str
[
groups
[
ix
].
rm_eo
]
=
tmp
;
}
int
parse_semver
(
const
char
*
version
,
semver_t
*
s
)
{
int
parse_semver
(
const
char
*
version
,
semver_t
*
s
)
{
static
const
char
*
version_regex
=
"^(([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+)(
\\
+([0-9]+))?)?(.*)$"
;
static
const
unsigned
int
max_regex_groups
=
7
+
1
;
static
const
unsigned
int
major_ix
=
2
;
...
...
@@ -43,19 +47,23 @@ int parse_semver(const char *version, semver_t *s) {
init_semver
(
version
,
s
);
if
(
s
->
version_str
==
NULL
||
s
->
version_str
[
0
]
==
0
)
{
if
(
s
->
version_str
==
NULL
||
s
->
version_str
[
0
]
==
0
)
{
return
1
;
}
if
(
regcomp
(
&
compiled
,
version_regex
,
REG_EXTENDED
))
{
if
(
regcomp
(
&
compiled
,
version_regex
,
REG_EXTENDED
))
{
return
1
;
}
if
(
regexec
(
&
compiled
,
s
->
version_str
,
max_regex_groups
,
groups
,
0
)
==
0
)
{
if
(
regexec
(
&
compiled
,
s
->
version_str
,
max_regex_groups
,
groups
,
0
)
==
0
)
{
fetch_part
(
s
->
version_str
,
groups
,
major_ix
,
&
s
->
major
);
fetch_part
(
s
->
version_str
,
groups
,
minor_ix
,
&
s
->
minor
);
fetch_part
(
s
->
version_str
,
groups
,
patch_ix
,
&
s
->
patch
);
if
(
groups
[
build_ix
].
rm_so
!=
(
size_t
)
-
1
)
{
if
(
groups
[
build_ix
].
rm_so
!=
(
regoff_t
)
-
1
)
{
fetch_part
(
s
->
version_str
,
groups
,
build_ix
,
&
s
->
build
);
}
s
->
test_str
=
s
->
version_str
+
groups
[
test_ix
].
rm_so
;
...
...
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