Use MANIFEST instead of MANIFEST-OLPC.

Package activity/ and setup.py stuff by default.
This commit is contained in:
Marco Pesenti Gritti 2007-02-07 11:33:24 +01:00
parent d0b4a48ff5
commit 292c648612

View File

@ -43,11 +43,25 @@ class _GitFileList(list):
self.append(filename) self.append(filename)
f.close() f.close()
class _DefaultFileList(list):
def __init__(self):
for name in os.listdir('activity'):
if name.endswith('.svg'):
self.append(os.path.join('activity', name))
self.append('activity/activity.info')
self.append('setup.py')
class _ManifestFileList(list): class _ManifestFileList(list):
def __init__(self): def __init__(self):
f = open('MANIFEST-OLPC','r') f = open('MANIFEST','r')
for line in f.readlines(): for line in f.readlines():
self.append(line[:-1]) self.append(line[:-1])
f.close()
defaults = _DefaultFileList()
for path in defaults:
self.append(path)
def _extract_bundle(source_file, dest_dir): def _extract_bundle(source_file, dest_dir):
if not os.path.exists(dest_dir): if not os.path.exists(dest_dir):
@ -114,18 +128,14 @@ def cmd_dev():
print 'ERROR - A bundle with the same name is already installed.' print 'ERROR - A bundle with the same name is already installed.'
def cmd_dist(): def cmd_dist():
try: if os.path.isfile('MANIFEST'):
os.stat('MANIFEST-OLPC')
file_list = _ManifestFileList() file_list = _ManifestFileList()
except: elif os.path.isdir('.git'):
if os.path.isdir('.git'): file_list = _GitFileList()
file_list = _GitFileList() elif os.path.isdir('.svn'):
elif os.path.isdir('.svn'): file_list = _SvnFileList()
file_list = _SvnFileList() else:
else: file_list = _DefaultFileList()
print 'ERROR - The command works only with git or svn\
repositories, or MANIFEST-OLPC file lists.'
return
zipname = _get_package_name() zipname = _get_package_name()
bundle_zip = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED) bundle_zip = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED)