mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 18:46:17 +01:00
- don't exit when there's nothing to do for a package (instead simply return)
- there's no need to catch SystemExit's when creating a new package or committing something
This commit is contained in:
parent
25ab4d7af6
commit
3e0ba6285b
11
osc/core.py
11
osc/core.py
@ -497,12 +497,8 @@ class Project:
|
|||||||
else:
|
else:
|
||||||
p = Package(os.path.join(self.dir, pac))
|
p = Package(os.path.join(self.dir, pac))
|
||||||
p.todo = files
|
p.todo = files
|
||||||
#print statfrmt('Sending', os.path.normpath(os.path.join(p.dir, os.pardir, pac)))
|
|
||||||
print statfrmt('Sending', os.path.normpath(p.dir))
|
print statfrmt('Sending', os.path.normpath(p.dir))
|
||||||
try:
|
|
||||||
p.commit(msg)
|
p.commit(msg)
|
||||||
except SystemExit:
|
|
||||||
pass
|
|
||||||
self.set_state(pac, ' ')
|
self.set_state(pac, ' ')
|
||||||
os.chdir(olddir)
|
os.chdir(olddir)
|
||||||
|
|
||||||
@ -521,8 +517,6 @@ class Project:
|
|||||||
os.rmdir(p.dir)
|
os.rmdir(p.dir)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
except SystemExit:
|
|
||||||
pass
|
|
||||||
except OSError:
|
except OSError:
|
||||||
pac_dir = os.path.join(self.dir, pac)
|
pac_dir = os.path.join(self.dir, pac)
|
||||||
#print statfrmt('Deleting', getTransActPath(os.path.join(self.dir, pac)))
|
#print statfrmt('Deleting', getTransActPath(os.path.join(self.dir, pac)))
|
||||||
@ -555,12 +549,9 @@ class Project:
|
|||||||
'name': pac,
|
'name': pac,
|
||||||
'user': user}),
|
'user': user}),
|
||||||
apiurl=apiurl)
|
apiurl=apiurl)
|
||||||
try:
|
|
||||||
p = Package(pac_path)
|
p = Package(pac_path)
|
||||||
p.todo = files
|
p.todo = files
|
||||||
p.commit(msg)
|
p.commit(msg)
|
||||||
except SystemExit:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
r = []
|
r = []
|
||||||
@ -700,7 +691,7 @@ class Package:
|
|||||||
|
|
||||||
if not self.todo_send and not self.todo_delete:
|
if not self.todo_send and not self.todo_delete:
|
||||||
print 'nothing to do for package %s' % self.name
|
print 'nothing to do for package %s' % self.name
|
||||||
sys.exit(1)
|
return 1
|
||||||
|
|
||||||
if self.islink() and self.isexpanded():
|
if self.islink() and self.isexpanded():
|
||||||
# resolve the link into the upload revision
|
# resolve the link into the upload revision
|
||||||
|
Loading…
Reference in New Issue
Block a user