-
Notifications
You must be signed in to change notification settings - Fork 87
import_srpm: check command rpm2cpio|cpio #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -28,6 +28,11 @@ def main(): | |||||
}[args.verbose] | ||||||
logging.basicConfig(format='[%(levelname)s] %(message)s', level=loglevel) | ||||||
|
||||||
try: | ||||||
call_process(['sh', '-c', 'command -v rpm2cpio']) | ||||||
except subprocess.CalledProcessError: | ||||||
parser.error("Command `rpm2cpio` missing") | ||||||
|
||||||
# check that the source RPM file exists | ||||||
if not os.path.isfile(args.source_rpm): | ||||||
parser.error("File %s does not exist." % args.source_rpm) | ||||||
|
@@ -76,7 +81,7 @@ def main(): | |||||
print(" extracting SRPM...") | ||||||
|
||||||
os.chdir('SOURCES') | ||||||
os.system('rpm2cpio "%s" | cpio -idmv' % source_rpm_abs) | ||||||
call_process(['sh', '-c', 'rpm2cpio "%s" | cpio -idmv' % source_rpm_abs]) | ||||||
tperard marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
otherwise it won't fail if rpm2cpio fails. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I didn't read your comment carefully enough. Too bad, I was liking your version better than mine, for its conciseness. It's probably better to go with #743 then. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you're calling |
||||||
os.chdir('..') | ||||||
os.system('mv SOURCES/*.spec SPECS/') | ||||||
|
||||||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just the same, but with just python 🙂