Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
korinf
etersoft-build-utils
Commits
1f2b1a0e
Commit
1f2b1a0e
authored
Dec 10, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
major fix inc_release and inc_subrelease
parent
81bb7d6c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
9 deletions
+46
-9
spec
share/eterbuild/functions/spec
+18
-2
get_release.sh
tests/get_release.sh
+2
-0
increment_release.sh
tests/increment_release.sh
+26
-7
No files found.
share/eterbuild/functions/spec
View file @
1f2b1a0e
...
...
@@ -105,21 +105,37 @@ reset_release()
}
# inc 2 release to 3
# textMAJOR.middle.MINOR
inc_release
()
{
local
BASERELEASE
=
$(
get_numrelease
"
$1
"
)
local
MAJOR
=
`
echo
"
$BASERELEASE
"
|
sed
-e
"s|
\.
.*||"
`
set_release
"
$1
"
$(
get_txtrelease
"
$1
"
)$((
$MAJOR
+
1
))
local
MINOR
=
`
echo
"
$BASERELEASE
"
|
sed
-e
"s|.*
\.
||"
`
local
m
=
$(
echo
"
$BASERELEASE
"
|
sed
-e
"s|
$MAJOR
\.\(
.*
\)\.
$MINOR
|
\1
|"
)
[
"
$m
"
=
"
$BASERELEASE
"
]
&&
m
=
''
local
am
=
''
# keep minor part
[
-z
"
$m
"
]
&&
rhas
"
$MINOR
"
"[a-zA-Z]"
&&
am
=
".
$MINOR
"
# keep middle part
[
-n
"
$m
"
]
&&
am
=
".
$m
"
set_release
"
$1
"
"
$(
get_txtrelease
"
$1
"
)$((
$MAJOR
+
1
))
$am
"
}
# inc 2.x to 2.(x+1) or 2 to 2.1
# textMAJOR.middle.MINOR
inc_subrelease
()
{
local
BASERELEASE
=
$(
get_numrelease
$1
)
local
MAJOR
=
`
echo
"
$BASERELEASE
"
|
sed
-e
"s|
\.
.*||"
`
local
MINOR
=
`
echo
"
$BASERELEASE
"
|
sed
-e
"s|.*
\.
||"
`
[
"
$MINOR
"
=
"
$BASERELEASE
"
]
&&
MINOR
=
"0"
set_release
"
$1
"
"
$(
get_txtrelease
$1
)${
MAJOR
}
.
$((
$MINOR
+
1
))
"
local
m
=
$(
echo
"
$BASERELEASE
"
|
sed
-e
"s|
$MAJOR
\.\(
.*
\)\.
$MINOR
|
\1
|"
)
local
am
=
''
# keep minor part
rhas
"
$MINOR
"
"[a-zA-Z]"
&&
am
=
".
$MINOR
"
&&
MINOR
=
"0"
# keep middle part
[
-n
"
$m
"
]
&&
[
"
$m
"
!=
"
$BASERELEASE
"
]
&&
am
=
".
$m
"
set_release
"
$1
"
"
$(
get_txtrelease
$1
)${
MAJOR
}
$am
.
$((
$MINOR
+
1
))
"
}
reset_subrelease
()
...
...
tests/get_release.sh
View file @
1f2b1a0e
...
...
@@ -120,6 +120,8 @@ get_mn_fromspec
check MAJOR 27.5
$MAJOR
check MINOR 2
$MINOR
BASERELEASE
=
alt3.git20130916.2
# from rpmbh:
# General rule: alwars alt(N-1).MM.(N)
set_release
$SPECNAME
$(
get_txtrelease
$SPECNAME
)$(
decrement_release
$BASERELEASE
)
.
$MDISTR
.
$BASERELEASE
tests/increment_release.sh
View file @
1f2b1a0e
...
...
@@ -5,7 +5,7 @@ load_mod spec
check
()
{
[
"
$2
"
!=
"
$3
"
]
&&
echo
"FATAL with '
$1
': result '
$3
' do not match with '
$2
'"
||
echo
"OK for '
$1
' with '
$2
'"
[
"
$2
"
!=
"
$3
"
]
&&
echo
"FATAL with '
$1
$TESTREL
': result '
$3
' do not match with '
$2
'"
||
echo
"OK for '
$1
$TESTREL
' with '
$2
'"
}
...
...
@@ -39,23 +39,42 @@ check inc_subrelease "alt6.3" `inc_subrelease ""`
# FIXME: strange behaviour
TESTREL
=
alt6.r5001
check inc_subrelease
"alt6.r5001"
`
inc_subrelease
""
`
check inc_release
"alt7.r5001"
`
inc_release
""
`
check inc_subrelease
"alt6.r5001.1"
`
inc_subrelease
""
`
TESTREL
=
alt5
check inc_release
"alt6"
`
inc_release
""
`
check inc_subrelease
"alt5.1"
`
inc_subrelease
""
`
TESTREL
=
alt6.2
check inc_release
"alt7"
`
inc_release
""
`
check inc_subrelease
"alt6.3"
`
inc_subrelease
""
`
TESTVER
=
1.5.7
check inc_version
"1.5.8"
`
inc_version
""
`
#
TESTVER=1.5.7
#
check inc_version "1.5.8" `inc_version ""`
TESTREL
=
alt6.eter51
check inc_release
"alt6.eter52"
`
inc_release
""
`
check inc_release
"alt7.eter51"
`
inc_release
""
`
check inc_subrelease
"alt6.eter51.1"
`
inc_subrelease
""
`
TESTREL
=
alt5.14f23
check inc_release
"alt6"
`
inc_release
""
`
check inc_release
"alt6
.14f23
"
`
inc_release
""
`
TESTREL
=
alt4.ff
check inc_release
"alt5"
`
inc_release
""
`
check inc_release
"alt5.ff"
`
inc_release
""
`
TESTREL
=
alt3.git20110916
check inc_release
"alt4.git20110916"
`
inc_release
""
`
check inc_subrelease
"alt3.git20110916.1"
`
inc_subrelease
""
`
TESTREL
=
alt3.git20130916.2
check inc_release
"alt4.git20130916"
`
inc_release
""
`
check inc_subrelease
"alt3.git20130916.3"
`
inc_subrelease
""
`
TESTREL
=
alt2.M80P.3
check inc_release
"alt3.M80P"
`
inc_release
""
`
check inc_subrelease
"alt2.M80P.4"
`
inc_subrelease
""
`
TESTREL
=
alt3.git20110916
check inc_release
"alt4.git20110916"
`
inc_release
""
`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment