1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-28 10:46:15 +01:00

- fixed make_diff in order to avoid errors when committing a new package (created with mkpac)

This commit is contained in:
Marcus Hüwe 2008-06-10 22:32:53 +00:00
parent bce87c182d
commit da101858ee

View File

@ -2081,6 +2081,7 @@ def make_diff(wc, revision):
diff_hdr = 'Index: %s\n' diff_hdr = 'Index: %s\n'
diff_hdr += '===================================================================\n' diff_hdr += '===================================================================\n'
diff = [] diff = []
olddir = os.getcwd()
if not revision: if not revision:
# normal diff # normal diff
if wc.todo: if wc.todo:
@ -2105,7 +2106,6 @@ def make_diff(wc, revision):
elif state == 'D': elif state == 'D':
removed_files.append(file) removed_files.append(file)
else: else:
olddir = os.getcwd()
tmpdir = tempfile.mkdtemp(revision, wc.name, '/tmp') tmpdir = tempfile.mkdtemp(revision, wc.name, '/tmp')
os.chdir(tmpdir) os.chdir(tmpdir)
init_package_dir(wc.apiurl, wc.prjname, wc.name, tmpdir, revision) init_package_dir(wc.apiurl, wc.prjname, wc.name, tmpdir, revision)
@ -2157,8 +2157,7 @@ def make_diff(wc, revision):
# FIXME: this is ugly but it cannot be avoided atm # FIXME: this is ugly but it cannot be avoided atm
# if a file is deleted via "osc rm file" we should keep the storefile. # if a file is deleted via "osc rm file" we should keep the storefile.
tmp_pac = None tmp_pac = None
if cmp_pac == None: if cmp_pac == None and removed_files:
olddir = os.getcwd()
tmpdir = tempfile.mkdtemp(dir='/tmp') tmpdir = tempfile.mkdtemp(dir='/tmp')
os.chdir(tmpdir) os.chdir(tmpdir)
init_package_dir(wc.apiurl, wc.prjname, wc.name, tmpdir, wc.rev) init_package_dir(wc.apiurl, wc.prjname, wc.name, tmpdir, wc.rev)