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
c65ed784
Commit
c65ed784
authored
Mar 04, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmcs: add --skip-reqs support
parent
2946d4fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
33 deletions
+51
-33
rpmcs
bin/rpmcs
+51
-33
No files found.
bin/rpmcs
View file @
c65ed784
...
...
@@ -84,7 +84,47 @@ toalt_grprepl()
return
1
}
Usage
=
"Usage: rpmcs [specfile]
do_repls
()
{
local
i
=
$1
local
SPEC
=
$2
# TODO use perl -pe
echog
"fix build requires..."
ALLREPLRULES
=
""
for
n
in
`
print_buildreq
$i
`
;
do
toalt_pkgrepl
$n
||
continue
ALLREPLRULES
=
"
$ALLREPLRULES
s|(.*Req.*)
$REPLRULE1
|
\1
$REPLRULE2
|g"
[
-n
"
$VERBOSE
"
]
&&
echo
"Replace '
$REPLRULE1
' with '
$REPLRULE2
'"
done
echog
"fix package requires..."
ALLREPLRULES
=
""
for
n
in
`
print_pkgreq
$i
`
;
do
toalt_pkgrepl
$n
||
continue
ALLREPLRULES
=
"
$ALLREPLRULES
s|(.*Req.*)
$REPLRULE1
|
\1
$REPLRULE2
|g"
[
-n
"
$VERBOSE
"
]
&&
echo
"Replace '
$REPLRULE1
' with '
$REPLRULE2
'"
done
echog
"fix groups..."
for
n
in
`
print_grpreq
$i
`
;
do
toalt_grprepl
$n
||
continue
ALLREPLRULES
=
"
$ALLREPLRULES
s|(^Group.*)
$GRPREPLRULE1
|
\1
$GRPREPLRULE2
|g"
[
-n
"
$VERBOSE
"
]
&&
echo
"Replace '
$GRPREPLRULE1
' with '
$GRPREPLRULE2
'"
done
# Replace package names in source spec
sed
-r
-e
"
$ALLREPLRULES
"
<
$i
>
$SPEC
||
{
warning
"Error with replacement"
;
cat
$i
>
$SPEC
;
}
echo
echo
"Total used replacement rules:
$ALLREPLRULES
"
}
Usage
=
"Usage: rpmcs [--skip-reqs] [specfile]
spec file can be autodetected from git repo"
mygetopts
()
{
...
...
@@ -96,6 +136,7 @@ phelp()
echog
"
$Descr
"
echog
"
$Usage
"
echog
" specfile - spec file (copy will be saved as specfile~)"
echog
" --skip-reqs do not replace requires"
exit
0
}
...
...
@@ -107,6 +148,10 @@ fi
LISTRPMARGS
=
$@
}
if
[
"
$1
"
=
"--skip-reqs"
]
;
then
SKIPREQS
=
1
shift
fi
# If run without params, try autodetect spec
if
[
-z
"
$1
"
]
;
then
...
...
@@ -401,38 +446,11 @@ do
subst
"s|^ *%|%|g"
$i
echog
"DONE"
# TODO use perl -pe
echog
"fix build requires..."
ALLREPLRULES
=
""
for
n
in
`
print_buildreq
$i
`
;
do
toalt_pkgrepl
$n
||
continue
ALLREPLRULES
=
"
$ALLREPLRULES
s|(.*Req.*)
$REPLRULE1
|
\1
$REPLRULE2
|g"
[
-n
"
$VERBOSE
"
]
&&
echo
"Replace '
$REPLRULE1
' with '
$REPLRULE2
'"
done
echog
"fix package requires..."
ALLREPLRULES
=
""
for
n
in
`
print_pkgreq
$i
`
;
do
toalt_pkgrepl
$n
||
continue
ALLREPLRULES
=
"
$ALLREPLRULES
s|(.*Req.*)
$REPLRULE1
|
\1
$REPLRULE2
|g"
[
-n
"
$VERBOSE
"
]
&&
echo
"Replace '
$REPLRULE1
' with '
$REPLRULE2
'"
done
echog
"fix groups..."
for
n
in
`
print_grpreq
$i
`
;
do
toalt_grprepl
$n
||
continue
ALLREPLRULES
=
"
$ALLREPLRULES
s|(^Group.*)
$GRPREPLRULE1
|
\1
$GRPREPLRULE2
|g"
[
-n
"
$VERBOSE
"
]
&&
echo
"Replace '
$GRPREPLRULE1
' with '
$GRPREPLRULE2
'"
done
# Replace package names in source spec
sed
-r
-e
"
$ALLREPLRULES
"
<
$i
>
$SPEC
||
{
warning
"Error with replacement"
;
cat
$i
>
$SPEC
;
}
echo
echo
"Total used replacement rules:
$ALLREPLRULES
"
if
[
-z
"
$SKIPREQS
"
]
;
then
do_repls
$i
$SPEC
else
cat
$i
>
$SPEC
fi
# Restore changelog
cat
$SPEC
.tmpspecchangelog
>>
$SPEC
...
...
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