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
e5d8e68a
Commit
e5d8e68a
authored
Oct 18, 2011
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmcs: add -h, --help support
parent
80c0d018
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
8 deletions
+26
-8
rpmcs
bin/rpmcs
+26
-8
No files found.
bin/rpmcs
View file @
e5d8e68a
...
@@ -82,21 +82,39 @@ toalt_grprepl()
...
@@ -82,21 +82,39 @@ toalt_grprepl()
return
1
return
1
}
}
Usage
=
"Usage: rpmcs [specfile]
spec file can be autodetected from git repo"
mygetopts
()
{
Descr
=
"rpmcs - cleanup spec (like cleanup_spec command)"
phelp
()
{
# TODO: improve description
echog
"
$Descr
"
echog
"
$Usage
"
echog
" specfile - spec file (copy will be saved as specfile~)"
exit
0
}
if
[
"
$1
"
=
"-h"
]
||
[
"
$1
"
=
"--help"
]
;
then
phelp
fi
# pass other options to RPM:
LISTRPMARGS
=
$@
}
# If run without params, try autodetect spec
# If run without params, try autodetect spec
if
[
-z
"
$1
"
]
;
then
if
[
-z
"
$1
"
]
;
then
LISTNAMES
=
$(
get_gear_spec
)
LISTNAMES
=
$(
get_gear_spec
)
[
-n
"
$LISTNAMES
"
]
&&
echo
"Using autodetected spec
$LISTNAMES
..."
[
-n
"
$LISTNAMES
"
]
&&
echo
"Using autodetected spec
$LISTNAMES
..."
else
else
parse_cmd_pre
"
$@
"
parse_cmd_pre
"
$@
"
mygetopts
$LISTARGS
fi
fi
if
[
"
$1
"
=
"-h"
]
;
then
echog
"rpmcs spec - cleanup spec (like cleanup_spec command), adapted to ALT"
exit
0
fi
for
i
in
$LISTNAMES
for
i
in
$LISTNAMES
do
do
if
[
-z
${
i
/*rpm/
}
]
;
then
if
[
-z
${
i
/*rpm/
}
]
;
then
...
@@ -104,7 +122,7 @@ do
...
@@ -104,7 +122,7 @@ do
fi
fi
# Make backup copy
# Make backup copy
cp
-f
$i
${
i
}
~
cp
-f
$i
${
i
}
~
||
fatal
"Cannot find spec file '
$i
'"
# Unneeded on ALT
# Unneeded on ALT
subst
"s|^Prefix:.*
$|
|"
$i
subst
"s|^Prefix:.*
$|
|"
$i
...
...
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