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
950f0efb
You need to sign in or sign up before continuing.
Commit
950f0efb
authored
Jul 22, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve test for get_tardir_from_rules and fix improve get_tardir_from_rules
parent
e47e0cf1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
13 deletions
+37
-13
gear
share/eterbuild/functions/gear
+6
-4
get_tarballname.sh
tests/get_tarballname.sh
+31
-9
No files found.
share/eterbuild/functions/gear
View file @
950f0efb
...
@@ -50,10 +50,12 @@ get_tardir_from_rules()
...
@@ -50,10 +50,12 @@ get_tardir_from_rules()
local tar
=
"
$1
"
local tar
=
"
$1
"
local
packname
=
"
$(
basename
"
$2
"
.
$tar
)
"
local
packname
=
"
$(
basename
"
$2
"
.
$tar
)
"
local dir
local dir
if
print_gear_rules |
grep
"
$tar
*:"
|
grep
-q
-v
"name="
;
then
assert_var
tar
packname
dir
=
$(
print_gear_rules |
grep
"
$tar
*:"
|
sed
-e
"s|
$tar
*: *||g"
|
sed
-e
"s| .*||g"
|
head
-n1
)
# firstly try get dir by name=
else
dir
=
$(
print_gear_rules |
grep
"
$tar
*:"
|
grep
"name=
$packname
"
|
sed
-e
"s|
$tar
*: *||g"
|
sed
-e
"s| .*||g"
|
head
-n1
)
dir
=
$(
print_gear_rules |
grep
"
$tar
*:"
|
grep
"name=
$packname
"
|
sed
-e
"s|
$tar
*: *||g"
|
sed
-e
"s| .*||g"
|
head
-n1
)
# if can't get by name, use first rule without name=
if
[
-z
"
$dir
"
]
;
then
dir
=
$(
print_gear_rules |
grep
"
$tar
*:"
|
grep
-v
"name="
|
sed
-e
"s|
$tar
*: *||g"
|
sed
-e
"s| .*||g"
|
head
-n1
)
fi
fi
if
[
-z
"
$dir
"
]
;
then
if
[
-z
"
$dir
"
]
;
then
...
...
tests/get_tarballname.sh
View file @
950f0efb
...
@@ -23,10 +23,15 @@ Get version test
...
@@ -23,10 +23,15 @@ Get version test
EOF
EOF
}
}
check
()
{
[
"
$2
"
!=
"
$3
"
]
&&
echo
"FATAL with '
$1
': result '
$2
' do not match with '
$3
'"
||
echo
"OK for '
$1
' with '
$2
'"
}
check_get_version
()
check_get_version
()
{
{
RES
=
$1
RES
=
$1
RESGET
=
`
get_tarballname
$SPEC
`
RESGET
=
`
get_tarballname
$SPEC
`
[
"
$RES
"
!=
"
$RESGET
"
]
&&
echo
"FATAL with 'get_tarballname': result '
$RES
' do not match with '
$RESGET
'"
||
echo
"OK for 'get_tarballname' with '
$RESGET
'"
[
"
$RES
"
!=
"
$RESGET
"
]
&&
echo
"FATAL with 'get_tarballname': result '
$RES
' do not match with '
$RESGET
'"
||
echo
"OK for 'get_tarballname' with '
$RESGET
'"
}
}
...
@@ -55,19 +60,36 @@ echo "Source path $SOURCEPATH: "
...
@@ -55,19 +60,36 @@ echo "Source path $SOURCEPATH: "
gen_spec
gen_spec
get_etersoft_srpm_path
$SPEC
get_etersoft_srpm_path
$SPEC
echo
"TODO"
subst
"s|Source:.*|Source: http://fp.ru/python-larch_1.20131130.orig.tar.gz|g"
$SPEC
subst
"s|Source:.*|Source: http://fp.ru/python-larch_1.20131130.orig.tar.gz|g"
$SPEC
check_get_version python-larch
check_get_version python-larch
subst
"s|Source:.*|Source0: http://fp.ru/python-larch_1.20131130.orig.tar.gz|g"
$SPEC
check_get_version python-larch
rm
-f
$SPEC
[
-n
"
$1
"
]
&&
SPEC
=
"
$1
"
[
-s
$SPEC
]
||
SPEC
=
"
$1
"
build_rpms_name
$SPEC
build_rpms_name
$SPEC
echo
"Tarball from rules"
#
echo "Tarball from rules"
#get_tardir_from_rules tar wine-staging-2.4.0.tar || echo "No tarball"
#get_tardir_from_rules tar wine-staging-2.4.0.tar || echo "No tarball"
get_tardir_from_rules
tar
||
echo
"No tarball"
#get_tardir_from_rules tar || echo "No tarball"
get_tardir_from_rules tar.gz
||
echo
"No tarball"
#get_tardir_from_rules tar.gz || echo "No tarball"
echo
"Test ostree"
# TODO: fake .gear
cd
/home/lav/Projects/git-alt/containers/ostree
SPEC
=
ostree.spec
build_rpms_name
$SPEC
check_tarball
()
{
local
TARBALL
=
"
$1
"
local
TARDIR
=
$(
get_tardir_from_rules
"
$(
get_ext
$TARBALL
)
"
$(
basename
"
$TARBALL
"
))
check
"
$1
"
"
$(
basename
$TARDIR
)
"
"
$2
"
}
check_tarball ostree-2017.8.tar ostree
check_tarball libglnx.tar libglnx
check_tarball bsdiff.tar bsdiff
# TODO: в rules может задаваться другой name архива
echo
"DONE"
echo
"DONE"
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