Mailinglist Archive: opensuse-bugs (8048 mails)

< Previous Next >
[Bug 231452] osc commands should return exit status
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Wed, 7 Feb 2007 07:44:26 -0700 (MST)
  • Message-id: <20070207144426.8DA8CF8F@xxxxxxxxxxxxxxxxxxxxxx>
https://bugzilla.novell.com/show_bug.cgi?id=231452


poeml@xxxxxxxxxx changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED




------- Comment #1 from poeml@xxxxxxxxxx 2007-02-07 07:44 MST -------
I think it is difficult to come up with a meaningful exit code for the
status command, because there are many cases. But returning 1 instead of
0 for the diff command makes sense. It would behave like diffutils diff
itself, which shouldn't surprose anyone... even though svn diff does not
do this.

Index: osc/commandline.py
===================================================================
--- osc/commandline.py (revision 1092)
+++ osc/commandline.py (working copy)
@@ -286,6 +286,7 @@
args = parseargs(args)
pacs = findpacs(args)

+ found_difference = False
for p in pacs:
if p.todo == []:
for i in p.filenamelist:
@@ -300,8 +301,12 @@
d.append(get_source_file_diff(p.dir, filename, p.rev))
if d:
print ''.join(d)
+ found_difference = True

+ if found_difference:
+ sys.exit(1)

+

def repourls(args):
"""repourls: shows URLs on which to access the .repos files


--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

< Previous Next >
This Thread
  • No further messages