Bug fix: do not catch exceptions too aggresively and fix libvers computation for updates.

This commit is contained in:
Achim D. Brucker 2017-09-16 17:20:23 +01:00
parent 4cf41e2e4f
commit 205c8836e9
1 changed files with 12 additions and 16 deletions

View File

@ -121,20 +121,17 @@ def path_to_list(path):
def get_file_libinfo(release_dic, git_path, libfile): def get_file_libinfo(release_dic, git_path, libfile):
"""Compute file idenfifiers and library information of libfile.""" """Compute file idenfifiers and library information of libfile."""
logging.info("Computing file info for " + libfile) logging.info("Computing file info for " + libfile)
try: file_info = get_file_identifiers(libfile)
file_info = get_file_identifiers(libfile) plist = path_to_list(libfile)
plist = path_to_list(libfile) idx = plist.index("libs")
idx = plist.index("libs") lib = plist[idx + 1]
lib = plist[idx + 1] version = plist[idx + 2]
version = plist[idx + 2] file_info['library'] = lib
file_info['library'] = lib file_info['version'] = version
file_info['version'] = version file_info['add_date'] = release_dic[(lib, version)]
file_info['add_date'] = release_dic[(lib, version)] package = os.path.join(
package = os.path.join( reduce(os.path.join, plist[:idx + 1]), "package.json")
reduce(os.path.join, plist[:idx + 1]), "package.json") return file_info
return file_info
except Exception:
return None
def pull_get_updated_lib_files(cdnjs_git_path): def pull_get_updated_lib_files(cdnjs_git_path):
@ -148,8 +145,7 @@ def pull_get_updated_lib_files(cdnjs_git_path):
fname = os.path.join(cdnjs_git_path, update) fname = os.path.join(cdnjs_git_path, update)
files.append(fname) files.append(fname)
plist = path_to_list(update) plist = path_to_list(update)
if len(plist) == 4: libvers.add(reduce(os.path.join, plist[:4]))
libvers.add(fname)
logging.info("Found " + str(len(files)) + " files") logging.info("Found " + str(len(files)) + " files")
logging.info("Found " + str(len(libvers)) + logging.info("Found " + str(len(libvers)) +
" unique library/version combinations.") " unique library/version combinations.")