Skip to content

Commit

Permalink
applied ian's fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekziade committed Feb 29, 2012
1 parent e8497d7 commit 73c1ffc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions mopytools/build_rpms.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ def build_external_deps_rpms(channel, options):
# we have a requirement file, we can go ahead and feed pypi2rpm with it
with open(req_file) as f:
for line in f.readlines():
line = line.strip()
if not line or line.startswith('#'):
continue
project, version = split_version(line)
build_rpm(project=project, dist_dir=options.dist_dir,
version=version, index=options.index,
Expand Down
14 changes: 8 additions & 6 deletions mopytools/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def __timer(*args, **kw):
return _timer


def run(command, timeout=300, verbose=False):
def run(command, timeout=300, verbose=False, allow_exit=False):
err_output = []
out_output = []

Expand All @@ -210,10 +210,12 @@ def _run():
code = sb.returncode

if code != 0:
print("%r failed with code %d" % (command, code))
print(stdout)
print(stderr)
sys.exit(code)
if not allow_exit or verbose:
print("%r failed with code %d" % (command, code))
print(stdout)
print(stderr)
if not allow_exit:
sys.exit(code)
elif verbose:
print(stdout)
print(stderr)
Expand All @@ -234,7 +236,7 @@ def envname(name):

def has_changes(timeout=5, verbose=False):
if is_git():
code, out, err = run('git diff --exit-code', timeout, verbose)
code, out, err = run('git diff --exit-code', timeout, verbose, allow_exit=True)
return code == 1
else:
code, out, err = run('hg diff', timeout, verbose)
Expand Down

0 comments on commit 73c1ffc

Please sign in to comment.