diff -Nru cubic-2020.01/debian/bzr-builder.manifest cubic-2020.02/debian/bzr-builder.manifest --- cubic-2020.01/debian/bzr-builder.manifest 2020-01-28 02:31:39.000000000 +0000 +++ cubic-2020.02/debian/bzr-builder.manifest 2020-02-01 20:02:37.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0~213 -lp:cubic revid:psingh.cubic@gmail.com-20200128021719-hlratpx85isrlsmy +# bzr-builder format 0.3 deb-version {debupstream}-0~214 +lp:cubic revid:psingh.cubic@gmail.com-20200201195153-rlapzmrhwwcrwyfg diff -Nru cubic-2020.01/debian/changelog cubic-2020.02/debian/changelog --- cubic-2020.01/debian/changelog 2020-01-28 02:31:39.000000000 +0000 +++ cubic-2020.02/debian/changelog 2020-02-01 20:02:37.000000000 +0000 @@ -1,18 +1,19 @@ -cubic (2020.01-0~213~ubuntu14.04.1) trusty; urgency=low +cubic (2020.02-0~214~ubuntu14.04.1) trusty; urgency=low * Auto build. - -- Sonicwalker Tue, 28 Jan 2020 02:31:39 +0000 + -- Sonicwalker Sat, 01 Feb 2020 20:02:37 +0000 -cubic (2020.01) cosmic; urgency=low +cubic (2020.02) cosmic; urgency=low * Bug fixes included in this release: - * Fix for Issue #1 of Bug #1860345, "list index out of range". If a - directory (such as the casper directory on the original ISO) - contains only one initrd and vmlinuz file, then Cubic should assume - that both files have the same version, if the version of one or both - files can not be determined. + * Fix for Issue #1 of Bug #1860345, "list index out of range" and Bug + #1861068, "Crash after terminal step Edit". If a directory (such as + the casper directory on the original ISO) contains only one initrd + and vmlinuz file, then Cubic should assume that both files have the + same version, if the version of one or both files can not be + determined. * Bug fixes included in version 2020.01-61: @@ -45,4 +46,4 @@ since only actual files are now listed. This also resolves the issue of copying symlinks, since no symlinks can be selected. - -- PJ Singh Mon, 27 Jan 2020 21:15:11 -0500 + -- PJ Singh Sat, 01 Feb 2020 14:50:37 -0500 diff -Nru cubic-2020.01/usr/share/cubic/utilities.py cubic-2020.02/usr/share/cubic/utilities.py --- cubic-2020.01/usr/share/cubic/utilities.py 2020-01-28 02:31:39.000000000 +0000 +++ cubic-2020.02/usr/share/cubic/utilities.py 2020-02-01 20:02:37.000000000 +0000 @@ -2067,9 +2067,9 @@ vmlinuz_details['directory'] for vmlinuz_details in vmlinuz_details_list ]) - unique_vmlinuz_directories = [ - k for k, - v in vmlinuz_directory_counter.items() if v == 1 + directories_with_one_vmlinuz = [ + directory for directory, + count in vmlinuz_directory_counter.items() if count == 1 ] # @@ -2093,24 +2093,27 @@ initrd_details['directory'] for initrd_details in initrd_details_list ]) - unique_initrd_directories = [ - k for k, - v in initrd_directory_counter.items() if v == 1 + directories_with_one_initrd = [ + directory for directory, + count in initrd_directory_counter.items() if count == 1 ] # # Kernels (vmlinuz and initrd) # + # Create a list of directories that only contain one vmlinuz file + # and one initrd file. + directories_with_one_vmlinuz_and_initrd = list( + set(directories_with_one_vmlinuz) & set(directories_with_one_initrd)) + # Create a consolidated kernel details list. - unique_vmlinuz_and_initrd_directories = list( - set(unique_vmlinuz_directories) & set(unique_initrd_directories)) kernel_details_list = [] _create_kernel_details_list( vmlinuz_details_list, initrd_details_list, kernel_details_list, - unique_vmlinuz_and_initrd_directories) + directories_with_one_vmlinuz_and_initrd) # Sort, select kernel, add notes, and remove the 1st column. update_kernel_details_list(kernel_details_list) @@ -2125,7 +2128,7 @@ vmlinuz_details_list, initrd_details_list, kernel_details_list, - unique_vmlinuz_and_initrd_directories): + directories_with_one_vmlinuz_and_initrd): note = '' is_selected = False @@ -2158,7 +2161,6 @@ # 8: is_selected # 9: is_remove - # if vmlinuz_version_integers == initrd_version_integers and vmlinuz_directory == initrd_directory: if vmlinuz_directory == initrd_directory: if vmlinuz_version_name and initrd_version_name: if vmlinuz_version_integers == initrd_version_integers: @@ -2175,7 +2177,7 @@ 'is_remove': is_remove } kernel_details_list.append(kernel_details) - elif vmlinuz_directory in unique_vmlinuz_and_initrd_directories: + elif vmlinuz_directory in directories_with_one_vmlinuz_and_initrd: if vmlinuz_version_name and not initrd_version_name: kernel_details = { 'version_integers': vmlinuz_version_integers, @@ -2502,43 +2504,6 @@ details_list.append(details) -def update_vmlinuz_details_list_ORIGINAL(directory, details_list): - - logger.log_note('Create vmlinuz details list') - logger.log_data('• Search directory', directory) - - directory = os.path.realpath(directory) - filepath_pattern = os.path.join(directory, 'vmlinuz*') - - filepath_list = [ - # Replace simlinks with the actual filepath. - os.path.realpath(filepath) for filepath in glob.glob(filepath_pattern) - # Exclude broken symlinks. - if os.path.exists(filepath) - ] - filepath_list = list(set(filepath_list)) - - logger.log_data('• Number of vmlinuz files found', len(filepath_list)) - - for filepath in filepath_list: - filename = os.path.basename(filepath) - directory = os.path.dirname(filepath) - version_name = get_vmlinuz_version_name(filepath) - if not version_name: version_name = '0.0.0-0' - logger.log_data('• The vmlinuz version is', version_name) - version_integers = tuple(map(int, re.split('[.-]', version_name))) - new_filename = calculate_vmlinuz_filename(filepath) - - details = { - 'version_integers': version_integers, - 'version_name': version_name, - 'filename': filename, - 'new_filename': new_filename, - 'directory': directory - } - details_list.append(details) - - def get_vmlinuz_version_name(filepath): # logger.log_data('Get vmlinuz version', filepath) @@ -2675,65 +2640,6 @@ details_list.append(details) -def update_initrd_details_list_ORIGINAL(directory, details_list): - - logger.log_note('Create initrd details list') - logger.log_data('• Search directory', directory) - - directory = os.path.realpath(directory) - filepath_pattern = os.path.join(directory, 'initrd*') - - filepath_list = [ - # Replace simlinks with the actual filepath. - os.path.realpath(filepath) for filepath in glob.glob(filepath_pattern) - # Exclude broken symlinks. - if os.path.exists(filepath) - ] - filepath_list = list(set(filepath_list)) - - logger.log_data('• Number of initrd files found', len(filepath_list)) - - for filepath in filepath_list: - filename = os.path.basename(filepath) - directory = os.path.dirname(filepath) - version_name = get_initrd_version_name(filepath) - - # TODO: See if this hack can be improved? - # As a last resort, grab the first vmlinuz version name from - # this directory, and assume the initrd version is the same. The - # situation where the initrd version is unknown should only - # happen in the casper directory of the ISO; this is a critical - # assumption. In the casper directory, the initrd version should - # correspond to the vmlinuz version, and it is reasonable to - # simply use the vmlinuz version, whenever the version of initrd - # cannot be determined in this directory. - # - # if not version_name: - # version_name = get_vmlinuz_version_from_kernel_details_list( - # kernel_details_list, - # directory) - - # TODO: If the kernel version could not be determined, set it to - # a default value. This will cause an expection if no initrd - # versions match the vmlinuz versions, since the kernel details - # list will be empty. Therefore, a better approach is needed, or - # appropriate error handling in the UI is needed. - if not version_name: version_name = '0.0.0-0' - - logger.log_data('• The initrd version is', version_name) - version_integers = tuple(map(int, re.split('[.-]', version_name))) - new_filename = calculate_initrd_filename(filepath) - - details = { - 'version_integers': version_integers, - 'version_name': version_name, - 'filename': filename, - 'new_filename': new_filename, - 'directory': directory - } - details_list.append(details) - - def get_vmlinuz_version_from_kernel_details_list( kernel_details_list, directory): @@ -2847,7 +2753,11 @@ for details in details_list: if not isinstance(details, dict): # Assume details is a list; convert into a dictionary. - details = { index : details[index] for index in range(0, len(details)) } + details = { + index: details[index] + for index in range(0, + len(details)) + } for key, value in details.items(): if key in default_widths: widths[key] = default_widths[key] @@ -2872,7 +2782,11 @@ print((' of {:%d}' % index_width).format(total), end='') if not isinstance(details, dict): # Assume details is a list; convert into a dictionary. - details = { index : details[index] for index in range(0, len(details)) } + details = { + index: details[index] + for index in range(0, + len(details)) + } for key in widths.keys(): width = widths[key] if width: