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
b00c40cd
Commit
b00c40cd
authored
17 years ago
by
Ger van Diepen
Browse files
Options
Downloads
Patches
Plain Diff
bug 1144:
Support options majorexact and minorexact Check if used packages have a version
parent
1ff9d31c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
autoconf_share/rub1
+73
-63
73 additions, 63 deletions
autoconf_share/rub1
with
73 additions
and
63 deletions
autoconf_share/rub1
+
73
−
63
View file @
b00c40cd
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
# (is used for super-package like LCS)
# (is used for super-package like LCS)
# 2 = configure.in nor lofarconf.in needs to be present
# 2 = configure.in nor lofarconf.in needs to be present
# (is used for autoconf_share)
# (is used for autoconf_share)
# verstype version type (e, m, l, t, tag)
# verstype version type (e, m, l, t,
me, mme,
tag)
# version version of package to check out
# version version of package to check out
# cutag tag of package to checkout/update (blank = no tag)
# cutag tag of package to checkout/update (blank = no tag)
# checkout 1 = do actual checkout/update if not done yet
# checkout 1 = do actual checkout/update if not done yet
...
@@ -72,12 +72,29 @@ fi
...
@@ -72,12 +72,29 @@ fi
# Keep current working directory.
# Keep current working directory.
curwd
=
`
pwd
`
curwd
=
`
pwd
`
# The package name in a version is the first and last part of the package name.
pkgnmvers
=
`
echo
$pkgname
|
sed
-e
's%/.*%%'
`
if
[
"
$pkgnmvers
"
!=
"
$pkgname
"
]
;
then
pkgnmvers
=
"
$pkgnmvers
-
`
echo
$pkgname
|
sed
-e
's%.*/%%'
`
"
fi
# Always use a specific tag if given.
# Always use a specific tag if given.
# Set version to blank for types t and l.
# Set version to blank for types t and l.
# Remember if an explicit version is given.
versgiven
=
0
if
[
"
$cutag
"
!=
""
]
;
then
if
[
"
$cutag
"
!=
""
]
;
then
getvers
=
$cutag
getvers
=
$cutag
elif
[
$verstype
=
t
-o
$verstype
=
l
]
;
then
elif
[
$verstype
=
t
-o
$verstype
=
l
]
;
then
getvers
=
getvers
=
elif
[
"
$getvers
"
!=
""
]
;
then
# Use the given version where . is subsituted by _.
getvers
=
`
echo
$getvers
|
sed
-e
's/\./_/g'
`
# If needed (i.e. if only numeric), prepend by package name.
evers
=
`
echo
$getvers
|
sed
-e
's/[0-9_]*//g'
`
if
[
"
$evers
"
=
""
]
;
then
getvers
=
$pkgnmvers
-
$getvers
fi
versgiven
=
1
fi
fi
# See if this package was already updated. Take the last line.
# See if this package was already updated. Take the last line.
...
@@ -107,8 +124,7 @@ if [ "$pkgline" = "" ]; then
...
@@ -107,8 +124,7 @@ if [ "$pkgline" = "" ]; then
# Remove the part '-release-branch' leaving the CVS tag name.
# Remove the part '-release-branch' leaving the CVS tag name.
getvers
=
`
cvs log
$pkgname
/configure.in 2>&1 |
grep
release-branch |
head
-1
|
sed
-e
's/[ \t]*\(.*\)-release-branch.*/\1/'
`
getvers
=
`
cvs log
$pkgname
/configure.in 2>&1 |
grep
release-branch |
head
-1
|
sed
-e
's/[ \t]*\(.*\)-release-branch.*/\1/'
`
else
else
pkgnm1
=
`
echo
$pkgname
|
sed
-e
's%/%-%g'
`
getvers
=
`
svn list
$svnurl
/tags 2>&1 |
grep
$pkgnmvers
|
grep
release-root |
tail
-1
|
sed
-e
's/[ \t]*\(.*\)-release-root.*/\1/'
`
getvers
=
`
svn list
$svnurl
/tags 2>&1 |
grep
$pkgnm1
|
grep
release-root |
tail
-1
|
sed
-e
's/[ \t]*\(.*\)-release-root.*/\1/'
`
fi
fi
fi
fi
...
@@ -131,15 +147,31 @@ else
...
@@ -131,15 +147,31 @@ else
echo
"Error: package
$pkgname
is used with different versions (
$getvers
and
$curvers
)"
echo
"Error: package
$pkgname
is used with different versions (
$getvers
and
$curvers
)"
exit
1
exit
1
fi
fi
elif
[
$verstype
=
m
]
;
then
elif
[
$verstype
=
m
-o
$verstype
=
me
-o
$verstype
=
mme
]
;
then
# Use the maximum of the two versions.
# Use the maximum of the two versions.
if
[
"
$curvers
"
!=
""
]
;
then
if
[
"
$curvers
"
!=
""
]
;
then
if
[
"
$curvers
"
!=
"
$getvers
"
]
;
then
if
[
"
$curvers
"
!=
"
$getvers
"
]
;
then
echo
"warning: version
$curvers
and
$getvers
needed of package
$pkgname
; using highest"
# Remove the package name from the tags.
# Compare the versions by removing the package name from the tags.
# Find maximum version.
v1
=
`
echo
$getvers
|
sed
-e
's/.*-\([0-9_]\)$/\1/'
`
v1
=
`
echo
$getvers
|
sed
-e
's/.*-\([0-9_]\)$/\1/'
`
v2
=
`
echo
$curvers
|
sed
-e
's/.*-\([0-9_]\)$/\1/'
`
v2
=
`
echo
$curvers
|
sed
-e
's/.*-\([0-9_]\)$/\1/'
`
if
[
$verstype
=
me
-o
$verstype
=
mme
]
;
then
# Check if major version is equal.
res
=
`
echo
"
$v1
$v2
"
|
awk
'{ la1=split($1,a1,"_"); la2=split($2,a2,"_"); res=0; if (a1[1]!=a2[1]) {res=1;} print res; }'
`
if
[
$res
!=
0
]
;
then
echo
"Error: package
$pkgname
is used with different major versions (
$getvers
and
$curvers
)"
exit
1
fi
if
[
$verstype
=
mme
]
;
then
# Check if major version is equal.
res
=
`
echo
"
$v1
$v2
"
|
awk
'{ la1=split($1,a1,"_"); la2=split($2,a2,"_"); res=0; if (a1[2]!=a2[2]) {res=1;} print res; }'
`
if
[
$res
!=
0
]
;
then
echo
"Error: package
$pkgname
is used with different major.minor versions (
$getvers
and
$curvers
)"
exit
1
fi
fi
fi
echo
"warning: version
$curvers
and
$getvers
needed of package
$pkgname
; using highest"
# Find maximum version.
res
=
`
echo
"
$v1
$v2
"
|
awk
'{ la1=split($1,a1,"_"); la2=split($2,a2,"_"); if (la1<la2) la1=la2; res=$1; for (i=1; i<=la1; i++) {if (a1[i]>a2[i]) {break;} else if (a1[i]<a2[i]) { res=$2; break;}} print res; }'
`
res
=
`
echo
"
$v1
$v2
"
|
awk
'{ la1=split($1,a1,"_"); la2=split($2,a2,"_"); if (la1<la2) la1=la2; res=$1; for (i=1; i<=la1; i++) {if (a1[i]>a2[i]) {break;} else if (a1[i]<a2[i]) { res=$2; break;}} print res; }'
`
if
[
"
$res
"
=
"
$v2
"
]
;
then
if
[
"
$res
"
=
"
$v2
"
]
;
then
# Current version is the highest, so no need to update.
# Current version is the highest, so no need to update.
...
@@ -257,14 +289,20 @@ if [ "$pkgline" = "" -o "$getvers" != "$curvers" ]; then
...
@@ -257,14 +289,20 @@ if [ "$pkgline" = "" -o "$getvers" != "$curvers" ]; then
fi
fi
fi
fi
# Find all packages used to get correct build order.
# Find all packages used.
if
[
-f
$pgkname
/
$pkgname
.spec.in
]
;
then
# The packages can be given in a configure.in, .spec or lofarconf.in file.
if
[
-f
$pkgname
/configure.in
]
;
then
if
[
-f
$pkgname
/lofarconf.in
-o
-f
$pkgname
/lofarconf.in.private
]
;
then
echo
"error: lofarconf.in cannot be used with a configure.in"
exit
1
fi
# Find them by looking in the configure.in file.
pkgs
=
`
grep
"^[
\t
]*lofar_
\(\(
PACKAGE
\)\|\(
INTERNAL
\)\)
[
\t
]*(.*)"
$pkgname
/configure.in |
sed
-e
"s/.*lofar_
\(
PACKAGE
\)\|\(
INTERNAL
\)
//"
-e
"s/ //g"
-e
"s/.*(//"
-e
"s/).*//"
|
awk
-F
,
'{print $1"="$3}'
`
elif
[
-f
$pgkname
/
$pkgname
.spec.in
]
;
then
if
[
-f
$pkgname
/lofarconf.in
-o
-f
$pkgname
/lofarconf.in.private
]
;
then
if
[
-f
$pkgname
/lofarconf.in
-o
-f
$pkgname
/lofarconf.in.private
]
;
then
echo
"error: lofarconf.in cannot be used with a .spec.in"
echo
"error: lofarconf.in cannot be used with a .spec.in"
exit
1
exit
1
fi
fi
# Add (leaf) package to the file to get correct build order.
echo
"
$pkgname
#-v
$getvers
"
>>
allpkg.tmp
# Do it recursively for packages used by this package.
# Do it recursively for packages used by this package.
# Find them by looking at the Requires tag in the .spec.in file.
# Find them by looking at the Requires tag in the .spec.in file.
pkgs
=
`
egrep
-i
" *requires:"
$pkgname
/
$pkgname
.spec.in |
sed
-e
's/ *requires: *//ig'
`
pkgs
=
`
egrep
-i
" *requires:"
$pkgname
/
$pkgname
.spec.in |
sed
-e
's/ *requires: *//ig'
`
...
@@ -275,40 +313,6 @@ if [ -f $pgkname/$pkgname.spec.in ]; then
...
@@ -275,40 +313,6 @@ if [ -f $pgkname/$pkgname.spec.in ]; then
fi
fi
# Normalize the string.
# Normalize the string.
pkgs
=
`
echo
$pkg1
|
sed
's/ *== */=/g'
|
sed
's/ //g'
|
sed
's/,/ /g'
`
pkgs
=
`
echo
$pkg1
|
sed
's/ *== */=/g'
|
sed
's/ //g'
|
sed
's/,/ /g'
`
for
pkg
in
$pkgs
do
# Extract package name and version.
# Before = is the package name.
nm
=
`
echo
$pkg
|
sed
-e
"s/=.*//"
`
# Possible part after = is the version.
# Replace a . in the version by _.
vers
=
`
echo
$pkg
|
awk
-F
=
'{ print $2 }'
|
sed
-e
's/\./_/g'
`
# Check out the package.
$0
$nm
0
"
$verstype
"
"
$vers
"
"
$cutag
"
$checkout
$recur
"
$usesvn
"
"
$command
"
||
exit
1
done
elif
[
-f
$pkgname
/configure.in
]
;
then
if
[
-f
$pkgname
/lofarconf.in
-o
-f
$pkgname
/lofarconf.in.private
]
;
then
echo
"error: lofarconf.in cannot be used with a configure.in"
exit
1
fi
# Add (leaf) package to the file to get correct build order.
echo
"
$pkgname
#-v
$getvers
"
>>
allpkg.tmp
if
[
$recur
!=
0
]
;
then
# Do it recursively for packages used by this package.
# Find them by looking in the configure.in file.
pkgs
=
`
grep
"^[
\t
]*lofar_
\(\(
PACKAGE
\)\|\(
INTERNAL
\)\)
[
\t
]*(.*)"
$pkgname
/configure.in |
sed
-e
's/ //g'
`
for
pkg
in
$pkgs
do
# Extract package name and tag.
nma
=
`
echo
$pkg
|
sed
-e
"s/.*lofar_
\(
PACKAGE
\)\|\(
INTERNAL
\)
//"
-e
"s/ //g"
-e
"s/.*(//"
-e
"s/).*//"
`
# First name is the package.
nm
=
`
echo
$nma
|
sed
-e
"s/,.*//"
`
# Possible third name is the version. Replace possible . by _.
vers
=
`
echo
$nma
|
awk
-F
,
'{ print $3 }'
|
sed
-e
's/\./_/g'
`
# Check out the package.
$0
$nm
0
"
$verstype
"
"
$vers
"
"
$cutag
"
$checkout
$recur
"
$usesvn
"
"
$command
"
||
exit
1
done
fi
else
else
# Do it for all packages in a possible lofarconf.in.
# Do it for all packages in a possible lofarconf.in.
fnam
=
fnam
=
...
@@ -320,23 +324,29 @@ else
...
@@ -320,23 +324,29 @@ else
if
[
"
$fnam
"
!=
""
]
;
then
if
[
"
$fnam
"
!=
""
]
;
then
# Get the packages out of the lofarconf.in file. They can optionally be
# Get the packages out of the lofarconf.in file. They can optionally be
# followed by a version as #-vversion. Remove other comments.
# followed by a version as #-vversion. Remove other comments.
pkgs
=
`
awk
'{print $1 $2;}'
$pkgname
/
$fnam
|
sed
-e
's/^ *#.*//'
-e
's/#$//'
-e
's/#-$//'
-e
's/#[^-].*$//'
-e
's/#-[^v].*//'
`
# Add pkgname if not starting with a slash.
for
PKG
in
$pkgs
pkgs
=
`
awk
'{print $1 $2;}'
$pkgname
/
$fnam
|
sed
-e
's/^ *#.*//'
-e
's/#-v/=/'
-e
's/#.*//'
-e
's/ //g'
-e
"s%^
\(
[^/]
\)
%
$pkgname
/
\1
%"
`
do
# Get version number (if given).
pkg
=
`
echo
$PKG
|
sed
-e
's%#-v.*%%'
`
if
[
"
$pkg
"
!=
"
$PKG
"
]
;
then
vers
=
`
echo
$PKG
|
sed
-e
's%.*#-v%%'
`
fi
# If pkg starts with a slash, it is relative to LOFAR root.
pkgnm
=
$pkgname
/
$pkg
case
$pkg
in
/
*
)
pkgnm
=
`
echo
$pkg
|
sed
's%^/%%'
`
;;
esac
vers
=
# Check out the package.
$0
$pkgnm
1
"
$verstype
"
"
$vers
"
"
$cutag
"
$checkout
$recur
"
$usesvn
"
"
$command
"
||
exit
1
done
fi
fi
fi
fi
# Add (leaf) package to the file to get correct build order.
echo
"
$pkgname
#-v
$getvers
"
>>
allpkg.tmp
# Check out all packages as needed.
if
[
$recur
!=
0
]
;
then
for
pkg
in
$pkgs
do
# Extract package name and version.
# Remove possible leading slash from package name.
pkgnm
=
`
echo
$pkg
|
awk
-F
=
'{print $1}'
|
sed
-e
's%^/%%'
`
# Replace a . in the version by _.
vers
=
`
echo
$pkg
|
awk
-F
=
'{print $2}'
|
sed
-e
's/\./_/g'
`
# If the parent package has a version, this one must have one as well.
# The only exception is package LCS/Tools.
if
[
$versgiven
=
1
-a
"
$vers
"
=
""
-a
"
$pkgnm
"
!=
"LCS/Tools"
]
;
then
echo
"Package
$pkgnm
used by
$pkgname
-
$getvers
must have a version as well"
exit
2
fi
# Check out the package.
$0
$pkgnm
0
"
$verstype
"
"
$vers
"
"
$cutag
"
$checkout
$recur
"
$usesvn
"
"
$command
"
||
exit
1
done
fi
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