Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
716d7c46
Commit
716d7c46
authored
17 years ago
by
Ger van Diepen
Browse files
Options
Downloads
Patches
Plain Diff
bug 468:
Add support for a single program version
parent
1dc8fc54
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LCS/Common/include/Common/Version.h
+24
-3
24 additions, 3 deletions
LCS/Common/include/Common/Version.h
LCS/Common/src/Version.cc
+7
-3
7 additions, 3 deletions
LCS/Common/src/Version.cc
with
31 additions
and
6 deletions
LCS/Common/include/Common/Version.h
+
24
−
3
View file @
716d7c46
...
@@ -35,8 +35,11 @@ namespace LOFAR {
...
@@ -35,8 +35,11 @@ namespace LOFAR {
{
{
public:
public:
// Add package/version to vector if not existing yet.
// Add package/version to vector if not existing yet.
static
void
fillVersion
(
const
std
::
string
&
package
,
// It returns false if the version differs from the main version.
static
bool
fillVersion
(
const
std
::
string
&
package
,
const
std
::
string
&
version
,
const
std
::
string
&
version
,
const
std
::
string
&
versionSuffix
,
const
std
::
string
&
mainVersion
,
std
::
vector
<
std
::
string
>&
v
);
std
::
vector
<
std
::
string
>&
v
);
// Show the package or application name and the versions of the packages
// Show the package or application name and the versions of the packages
...
@@ -49,8 +52,26 @@ namespace LOFAR {
...
@@ -49,8 +52,26 @@ namespace LOFAR {
std
::
ostream
&
os
)
std
::
ostream
&
os
)
{
{
std
::
vector
<
std
::
string
>
v
;
std
::
vector
<
std
::
string
>
v
;
T
::
fillVersion
(
v
);
bool
sameVers
=
T
::
fillVersion
(
T
::
getVersion
(),
v
);
os
<<
name
<<
": versions "
<<
v
<<
endl
;
os
<<
name
<<
": main version = "
<<
T
::
getVersion
();
if
(
!
sameVers
)
os
<<
'*'
;
os
<<
endl
;
os
<<
" packages: "
<<
v
<<
endl
;
}
// Get the main version and the individual package versions being used.
// It returns false if a package version differs from the main version.
// Use like:
// @code
// std::string mainVersion;
// std::vector<std::string> packageVersions;
// Version::get<BlobVersion> (mainVersion, packageVersions);
// @endcode
template
<
typename
T
>
static
bool
get
(
std
::
string
&
mainVersion
,
std
::
vector
<
std
::
string
>&
pkgVers
)
{
mainVersion
=
T
::
getVersion
();
return
T
::
fillVersion
(
mainVersion
,
pkgVers
);
}
}
};
};
...
...
This diff is collapsed.
Click to expand it.
LCS/Common/src/Version.cc
+
7
−
3
View file @
716d7c46
...
@@ -24,11 +24,14 @@
...
@@ -24,11 +24,14 @@
namespace
LOFAR
{
namespace
LOFAR
{
void
Version
::
fillVersion
(
const
std
::
string
&
package
,
bool
Version
::
fillVersion
(
const
std
::
string
&
package
,
const
std
::
string
&
version
,
const
std
::
string
&
version
,
const
std
::
string
&
versionSuffix
,
const
std
::
string
&
mainVersion
,
std
::
vector
<
std
::
string
>&
v
)
std
::
vector
<
std
::
string
>&
v
)
{
{
std
::
string
pv
=
package
+
'/'
+
version
;
bool
sameVers
=
(
version
==
mainVersion
);
std
::
string
pv
=
package
+
'/'
+
version
+
versionSuffix
;
// Only insert if not existing yet.
// Only insert if not existing yet.
// Later you might remove the existing one, so the dependencies are
// Later you might remove the existing one, so the dependencies are
// shown in a somewhat better way.
// shown in a somewhat better way.
...
@@ -36,10 +39,11 @@ namespace LOFAR {
...
@@ -36,10 +39,11 @@ namespace LOFAR {
iter
!=
v
.
end
();
iter
!=
v
.
end
();
++
iter
)
{
++
iter
)
{
if
(
*
iter
==
pv
)
{
if
(
*
iter
==
pv
)
{
return
;
return
sameVers
;
}
}
}
}
v
.
push_back
(
pv
);
v
.
push_back
(
pv
);
return
sameVers
;
}
}
}
}
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