mint-adjust.py should only add non null entries to array_preserves

Bug #1536291 reported by J G Miller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linux Mint
Fix Released
Undecided
Unassigned

Bug Description

DISTRIB_CODENAME=rosa
DISTRIB_DESCRIPTION="Linux Mint 17.3 Rosa"

Package: mintsystem
Maintainer: Clement Lefebvre <email address hidden>
Architecture: all
Version: 8.1.6
Filename: pool/main/m/mintsystem/mintsystem_7.9.7+1_all.deb

mint-adjust.py creates an arry of filename "preserves" which are files not to be subjected to mint-update overwrites.

            if extension == ".preserve":
                filehandle = open(adjustment_directory + "/" + filename)
                for line in filehandle:
                    line = line.strip()
                    array_preserves.append(line)
                filehandle.close()

If the line is blank, because the preserve file contains a trailing blank line just like all the overwrite files do, then a null string is inserted into the array. This can result in numerous null entries in the preserves array which is not a good thing, so a test should be done that the entry is non-null before insertion.

                for line in filehandle:
                    line = line.strip()
                    if (line):
                        array_preserves.append(line)
                filehandle.close()

Revision history for this message
J G Miller (jgmiller) wrote :
description: updated
description: updated
description: updated
Changed in linuxmint:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.