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
d5b62a51
Commit
d5b62a51
authored
Feb 21, 2010
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce get_type_by_current_branch, use it for branch detecting
add test for get current type from branch
parent
1ca09e66
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
20 deletions
+53
-20
alt
share/eterbuild/functions/alt
+26
-18
common
share/eterbuild/functions/common
+5
-2
test_gear.sh
tests/test_gear.sh
+22
-0
No files found.
share/eterbuild/functions/alt
View file @
d5b62a51
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain
# Public domain
load_mod git
is_alt
()
is_alt
()
{
{
test
-f
/etc/altlinux-release
test
-f
/etc/altlinux-release
...
@@ -12,6 +14,7 @@ is_alt()
...
@@ -12,6 +14,7 @@ is_alt()
# Internal
# Internal
set_target_type
()
set_target_type
()
{
{
# check for M51 and so on
if
echo
$1
|
grep
"^M[0-9][0-9]$"
>
/dev/null
;
then
if
echo
$1
|
grep
"^M[0-9][0-9]$"
>
/dev/null
;
then
MENV
=
$1
MENV
=
$1
return
0
return
0
...
@@ -25,25 +28,30 @@ set_target_type()
...
@@ -25,25 +28,30 @@ set_target_type()
return
1
;
return
1
;
}
}
set_incoming
()
get_type_by_git_branch_name
()
{
{
INCOMING
=
"Sisyphus"
if
[
"
$1
"
=
"p5"
]
;
then
test
-z
"
$1
"
&&
return
echo
"M50"
case
"
$1
"
in
return
(
"DD"
)
fi
INCOMING
=
"Daedalus"
;;
# like 5.1
(
"SS"
)
if
echo
$1
|
grep
-q
"^[0-9].[0-9]$"
;
then
INCOMING
=
"Sisyphus"
get_altdistr_mod
$1
;;
return
*
)
fi
if
[
-n
"
$UPDATES
"
]
;
then
INCOMING
=
"updates/
`
get_altdistr_version
$1
`
"
# like M50
else
if
echo
$1
|
grep
-q
"^M[0-9][0-9]$"
;
then
INCOMING
=
"backports/
`
get_altdistr_version
$1
`
"
get_altdistr_mod
${
1
/^M/
}
fi
return
;;
fi
esac
}
get_type_by_current_branch
()
{
local
BRANCH
=
$(
get_current_branch
)
get_type_by_git_branch_name
$BRANCH
}
}
set_binaryrepo
()
set_binaryrepo
()
...
...
share/eterbuild/functions/common
View file @
d5b62a51
...
@@ -167,9 +167,12 @@ fi
...
@@ -167,9 +167,12 @@ fi
[
"
$1
"
=
"--help"
]
&&
mygetopts
-h
[
"
$1
"
=
"--help"
]
&&
mygetopts
-h
# Sisyphus by default
#
Build for
Sisyphus by default
MENV
=
SS
MENV
=
SS
set_target_type
$(
basename
`
pwd
`
)
if
is_gear
;
then
# Set target according to current branch
set_target_type
$(
get_type_by_current_branch
)
fi
LISTNAMES
=
LISTNAMES
=
LISTARGS
=
LISTARGS
=
...
...
tests/test_gear.sh
0 → 100755
View file @
d5b62a51
#!/bin/sh
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod git alt
check
()
{
[
"
$2
"
!=
"
$3
"
]
&&
echo
"FATAL with '
$1
': result '
$3
' do not match with '
$2
'"
||
echo
"OK for '
$1
' with '
$2
'"
}
echo
"Current git branch:
$(
get_current_branch
)
"
check 1 M40
$(
get_type_by_git_branch_name 4.0
)
check 1 M40
$(
get_type_by_git_branch_name M40
)
check 1 M50
$(
get_type_by_git_branch_name p5
)
check 1 M50
$(
get_type_by_git_branch_name M50
)
check 1 M50
$(
get_type_by_git_branch_name 5.0
)
check 1 M51
$(
get_type_by_git_branch_name M51
)
check 1 M51
$(
get_type_by_git_branch_name 5.1
)
check 1
""
$(
get_type_by_git_branch_name master
)
check 1
""
$(
get_type_by_git_branch_name sisyphus
)
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