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
ceeed440
Commit
ceeed440
authored
Dec 01, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmgs: fix first line replacement
parent
4a7662b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
rpmgs
bin/rpmgs
+7
-1
No files found.
bin/rpmgs
View file @
ceeed440
...
...
@@ -113,6 +113,12 @@ download_any_tarball()
fatal
"Cannot retrieve
$GETSOURCE
"
}
__replace_first_line
()
{
# https://unix.stackexchange.com/questions/250603/replace-only-on-the-first-matching-line-with-sed
sed
-e
"1,/
$1
/s/
$1
/
$2
/"
}
# param: spec name number (f.i., url for Source-url)
function
source_ext
()
{
...
...
@@ -129,7 +135,7 @@ function source_ext()
NEWSOURCE
=
"
$(
echo
"
$NEWSOURCE
"
|
sed
-e
's|\&|\\&|g'
)
"
# TODO: move to separate function and rewrite
# TODO: use special field before %build
cat
$1
|
sed
-e
"s|^Summary:.*||1"
|
sed
-e
"s|^
\(
#
$SN
-
$2
:.*
\)
|Summary:
$NEWSOURCE
\n\1
|1
"
>
$TMPSPEC
cat
$1
|
__replace_first_line
"^Summary:.*"
""
|
sed
-e
"s|^
\(
#
$SN
-
$2
:.*
\)
|Summary:
$NEWSOURCE
\n\1
|
"
>
$TMPSPEC
# TODO: replace only first entry
#cat $1 | sed -e "s|^Summary:.*|Summary: $NEWSOURCE|1" > $TMPSPEC
GETSOURCEEXT
=
$(
eval_spec
"
$TMPSPEC
"
| get_var
"Summary"
)
...
...
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