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
6789042a
Commit
6789042a
authored
Apr 08, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite get_tardir_from_rules
parent
82688879
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
9 deletions
+32
-9
common
share/eterbuild/functions/common
+23
-5
get_tarballname.sh
tests/get_tarballname.sh
+9
-4
No files found.
share/eterbuild/functions/common
View file @
6789042a
...
...
@@ -298,13 +298,31 @@ is_gear()
get_gear_rules
$@
>
/dev/null
}
print_gear_rules
()
{
is_gear
||
fatal
"Can't get rules"
cat
$(
get_gear_rules
)
|
sed
-e
"s|@name@|
$BASENAME
|g"
|
sed
-e
"s|@version@|
$VERSION
|g"
|
sed
-e
"s|@release@|
$RELEASE
|g"
}
# args: tar_format, packaging_name
# uses: version
get_tardir_from_rules
()
{
local
rules
=
$(
get_gear_rules
)
assert_var rules
local dir
=
$(
grep
"tar.*: "
$rules
|
sed
-e
"s|tar.*: *||g
s| .*||g"
)
[
"
$dir
"
=
"."
]
||
[
-z
"
$dir
"
]
&&
return
1
local tar
=
"
$1
"
local
packname
=
"
$(
basename
"
$2
"
.
$tar
)
"
local dir
dir
=
$(
print_gear_rules |
grep
"
$tar
*:"
|
grep
"name=
$packname
"
|
sed
-e
"s|
$tar
*: *||g"
|
sed
-e
"s| .*||g"
)
if
[
-z
"
$dir
"
]
;
then
if
!
print_gear_rules |
grep
"
$tar
*:"
|
grep
-q
"name="
;
then
dir
=
$(
print_gear_rules |
grep
"
$tar
*:"
|
sed
-e
"s|
$tar
*: *||g"
|
sed
-e
"s| .*||g"
)
$(
print_gear_rules |
grep
"
$tar
*:"
)
"
else
fatal "
no
$tar
rules found
in
$(
get_gear_rules
)
between
fi
fi
if
[
"
$dir
"
=
"."
]
||
[
-z
"
$dir
"
]
||
echo
"
$dir
"
|
grep
-q
":"
;
then
return
1
fi
realpath
"
$(
get_root_git_dir
)
/
$dir
"
}
...
...
tests/get_tarballname.sh
View file @
6789042a
...
...
@@ -61,7 +61,13 @@ check_get_version python-larch
rm
-f
$SPEC
echo
"Tarball"
get_tardir_from_rules
||
echo
"No tarball"
[
-s
$SPEC
]
||
SPEC
=
"
$1
"
echo
"DONE"
\ No newline at end of file
build_rpms_name
$SPEC
echo
"Tarball from rules"
#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.gz
||
echo
"No tarball"
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