Additional fixes

This commit is contained in:
2019-09-03 14:14:45 +02:00
parent 50e508fd18
commit 03cf4c0896
2 changed files with 26 additions and 27 deletions

View File

@@ -35,11 +35,6 @@ class Package:
self.platform = self._get_platform(self.filename)
self.branch = self._get_branch(self.filename)
if self.platform == '':
sys.stderr.write('Failed to detect platform ' +
'from package: %r\n' % self.filename)
sys.exit(1)
# extension stripping
def _strip_extension(self, filename):
extensions = '.zip', '.tar', '.bz2', '.gz', '.tgz', '.tbz', '.exe'
@@ -101,7 +96,7 @@ def get_download_dir(branch):
elif branch == 'experimental-build':
directory = os.path.join(download_prefix, "experimental")
else:
directory = os.path.join(download_prefix, "branches", branch)
directory = os.path.join(download_prefix, branch)
os.makedirs(directory, exist_ok=True)
return directory
@@ -130,6 +125,12 @@ def get_branch_platform(packages):
# Extract branch and platform names
branch = packages[0].branch
platform = packages[0].platform
if platform == '':
sys.stderr.write('Failed to detect platform ' +
'from package: %r\n' % packages[0].filename)
sys.exit(1)
for package in packages:
if package.branch != branch or package.platform != platform:
sys.stderr.write('All packages in the zip file must have the same branch and platform\n')