Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Adam Mercer
Koji Packager
Commits
d639fbeb
Verified
Commit
d639fbeb
authored
May 09, 2019
by
Adam Mercer
Browse files
check that the specified source rpm exists
parent
64c11501
Changes
1
Hide whitespace changes
Inline
Side-by-side
koji-packager
View file @
d639fbeb
...
...
@@ -22,6 +22,8 @@
#
import
argparse
import
pathlib
import
sys
#
# metadata
...
...
@@ -37,12 +39,17 @@ def parse_options():
# define option parser
parser
=
argparse
.
ArgumentParser
(
description
=
'Build RPMs using Koji'
)
parser
.
add_argument
(
'--version'
,
action
=
'version'
,
version
=
__version__
)
parser
.
add_argument
(
'source-rpm'
,
nargs
=
1
,
help
=
'Source RPM to build with Koji'
)
parser
.
add_argument
(
'srpm'
,
nargs
=
1
,
help
=
'Source RPM to build with Koji'
)
# parse options
args
=
parser
.
parse_args
()
# check that source-rpm exists
srpm
=
pathlib
.
Path
(
args
.
srpm
[
0
])
if
not
srpm
.
is_file
():
print
(
'File %s does not exist.'
%
args
.
srpm
[
0
])
sys
.
exit
(
1
)
return
args
#
...
...
@@ -51,7 +58,7 @@ def parse_options():
def
main
():
args
=
parse_options
()
print
(
args
)
print
(
'source-rpm = %s'
%
args
.
srpm
[
0
]
)
#
# main program entry point
...
...
Write
Preview
Supports
Markdown
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