This file is indexed.

/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeFetcherSelf.py is in python3-distupgrade 1:0.220.10.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from __future__ import absolute_import

import logging
import shutil

from .DistUpgradeFetcherCore import DistUpgradeFetcherCore

class DistUpgradeFetcherSelf(DistUpgradeFetcherCore):
    def __init__(self, new_dist, progress, options, view):
        DistUpgradeFetcherCore.__init__(self,new_dist,progress)
        self.view = view
        # user chose to use the network, otherwise it would not be
        # possible to download self
        self.run_options += ["--with-network"]
        # make sure to run self with proper options
        if options.cdromPath is not None:
            self.run_options += ["--cdrom=%s" % options.cdromPath]
        if options.frontend is not None:
            self.run_options += ["--frontend=%s" % options.frontend]

    def error(self, summary, message):
        return self.view.error(summary, message)

    def runDistUpgrader(self):
        " overwrite to ensure that the log is copied "
        # copy log so it isn't overwritten
        logging.info("runDistUpgrader() called, re-exec self")
        logging.shutdown()
        shutil.copy("/var/log/dist-upgrade/main.log",
                    "/var/log/dist-upgrade/main_update_self.log")
        # re-exec self
        DistUpgradeFetcherCore.runDistUpgrader(self)