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
7c7081a6
Commit
7c7081a6
authored
Sep 16, 2010
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmcs: implement group replacing
parent
c23c6003
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
0 deletions
+42
-0
rpmcs
bin/rpmcs
+36
-0
repl
share/eterbuild/functions/repl
+6
-0
No files found.
bin/rpmcs
View file @
7c7081a6
...
...
@@ -35,6 +35,7 @@ toalt_pkgrepl()
s/| /|/g"
for
i
in
$PKGREPLBASE
/pkgrepl.fedora
$PKGREPLBASE
/pkgrepl.
*
;
do
#echo $i - $1
test
-r
"
$i
"
||
continue
REPLRULE
=
`
grep
-v
"^#"
"
$i
"
2>/dev/null |
grep
--
"
$1
\$
"
|
sed
-e
"
$WARULES
"
|
sed
-e
"s/^
\(
.*
\)
|
\(
.*
\)\$
/
\2
|
\1
/g"
|
head
-n1
`
# For broken rule
echo
$REPLRULE
|
grep
"^|"
>
/dev/null
&&
REPLRULE
=
""
...
...
@@ -51,6 +52,34 @@ toalt_pkgrepl()
return
1
}
# TODO: down handle spaces correctly
# Get replacement rule for some group in $1 to ALT
toalt_grprepl
()
{
local
i REPLRULE WARULES
WARULES
=
"s/^ //g
s/
\$
//g
s/ |/|/g
s/| /|/g"
GRPREPLBASE
=
$PKGREPLBASE
/../grprepl
for
i
in
$GRPREPLBASE
/grprepl.fedora
$GRPREPLBASE
/grprepl.rpm
$GRPREPLBASE
/grprepl.
*
;
do
test
-r
"
$i
"
||
continue
REPLRULE
=
`
grep
-v
"^#"
"
$i
"
2>/dev/null |
grep
--
"
$1
\$
"
|
sed
-e
"
$WARULES
"
|
sed
-e
"s/^
\(
.*
\)
|
\(
.*
\)\$
/
\2
|
\1
/g"
|
head
-n1
`
# For broken rule
echo
$REPLRULE
|
grep
"^|"
>
/dev/null
&&
REPLRULE
=
""
echo
$REPLRULE
|
grep
"|
\$
"
>
/dev/null
&&
REPLRULE
=
""
if
[
-n
"
$REPLRULE
"
]
;
then
GRPREPLRULE1
=
`
echo
$REPLRULE
|
cut
-d
"|"
-f1
|
sed
-e
"s|
\+
|
\\\\\+
|g"
`
GRPREPLRULE2
=
`
echo
$REPLRULE
|
cut
-d
"|"
-f2
|
sed
-e
"s|
\+
|
\\\\\+
|g"
`
return
0
else
GRPREPLRULE1
=
GRPREPLRULE2
=
fi
done
return
1
}
parse_cmd_pre
"
$@
"
...
...
@@ -330,6 +359,13 @@ do
#echo REPLRULE: $REPLRULE
done
echog
-n
"fix groups..."
for
n
in
`
print_grpreq
$i
`
;
do
toalt_grprepl
$n
&&
ALLREPLRULES
=
"
$ALLREPLRULES
s|(^Group.*)
$GRPREPLRULE1
|
\1
$GRPREPLRULE2
|g"
&&
test
-n
"
$VERBOSE
"
&&
echo
"Replace '
$GRPREPLRULE1
' with '
$GRPREPLRULE2
'"
#echo REPLRULE: $REPLRULE
done
#echo ALL: $ALLREPLRULES
# Replace package names in source spec
...
...
share/eterbuild/functions/repl
View file @
7c7081a6
...
...
@@ -65,6 +65,12 @@ print_pkgreq()
eval_spec
${
1
}
|
grep
"^Requires"
|
sed
-e
"s|^.*:||g"
| clean_pkgreq
}
# Print list of all groups
print_grpreq
()
{
eval_spec
${
1
}
|
grep
"^Group"
|
sed
-e
"s|^.*:||g"
|
sort
-u
| filter_strip_spaces
}
# internal
print_replbased_list
()
{
...
...
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