mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-23 02:32:13 +01:00
Allow using directories as mv targets
Otherwise osc would crash because the target directory would be in use (in case of ".".)
This commit is contained in:
parent
f9a718f662
commit
1d3805f30e
@ -7638,6 +7638,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
if not tgt_pkg:
|
||||
raise oscerr.NoWorkingCopy("Error: \"%s\" does not point to an osc working copy." % os.path.abspath(dest))
|
||||
|
||||
if os.path.isfile(source) and os.path.isdir(dest):
|
||||
dest = os.path.join(dest, os.path.basename(source))
|
||||
os.rename(source, dest)
|
||||
try:
|
||||
tgt_pkg[0].addfile(os.path.basename(dest))
|
||||
|
Loading…
x
Reference in New Issue
Block a user