1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-12 16:56:15 +01:00

Revert "read_filemeta: create the default _files if not exists"

This reverts commit a05a2a0a4f.

Conflicts:

	osc/core.py

The commit doesn't make much sense because we can't recover from a missing .osc/_files file.
This has to be fixed.
This commit is contained in:
Marcus Huewe 2011-05-17 16:09:09 +02:00
parent 7c427aa505
commit 3007c252a2

View File

@ -2757,21 +2757,17 @@ def filedir_to_pac(f, progress_obj=None):
def read_filemeta(dir):
global store
msg = '\'%s\' is not a valid working copy.\n' % dir
msg = '\'%s\' is not a valid working copy.' % dir
filesmeta = os.path.join(dir, store, '_files')
if not is_package_dir(dir):
raise oscerr.NoWorkingCopy(msg)
filesmeta = os.path.join(dir, store, '_files')
if not os.path.isfile(filesmeta):
print >>sys.stderr, "Warning: file _files is missing, creating a default one"
store_write_string(os.path.join(dir, store), '_files', '<directory \>')
raise oscerr.NoWorkingCopy('%s (%s does not exist)' % (msg, filesmeta))
try:
r = ET.parse(filesmeta)
except SyntaxError, e:
raise oscerr.NoWorkingCopy(msg +
'When parsing .osc/_files, the following error was encountered:\n'
'%s' % (dir, e))
raise oscerr.NoWorkingCopy('%s\nWhen parsing .osc/_files, the following error was encountered:\n%s' % (msg, e))
return r
def store_readlist(dir, name):