Esempio n. 1
0
 def _uninstall_dirs(self):
     dirsmade = self.tracereader.dirs_made()
     if dirsmade:
         dirsmade = [sh.abspth(d) for d in dirsmade]
         if self.keep_old:
             places = set()
             for (pth_loc, _) in self.tracereader.download_locations():
                 places.add(pth_loc)
             LOG.info("Keeping %s download directories [%s]", len(places), ",".join(sorted(places)))
             for download_place in places:
                 dirsmade = sh.remove_parents(download_place, dirsmade)
         for dirname in dirsmade:
             LOG.info("Removing created directory (%s)", dirname)
             sh.deldir(dirname, run_as_root=True)
Esempio n. 2
0
 def _uninstall_dirs(self):
     dirsmade = self.tracereader.dirs_made()
     if dirsmade:
         dirsmade = [sh.abspth(d) for d in dirsmade]
         if self.keep_old:
             places = set()
             for (pth_loc, _) in self.tracereader.download_locations():
                 places.add(pth_loc)
             LOG.info("Keeping %s download directories [%s]", len(places),
                      ",".join(sorted(places)))
             for download_place in places:
                 dirsmade = sh.remove_parents(download_place, dirsmade)
         for dirname in dirsmade:
             LOG.info("Removing created directory (%s)", dirname)
             sh.deldir(dirname, run_as_root=True)
 def _uninstall_dirs(self):
     dirs_made = self.tracereader.dirs_made()
     if dirs_made:
         dirs_made = [sh.abspth(d) for d in dirs_made]
         if self.keep_old:
             download_places = [path_location[0] for path_location in self.tracereader.download_locations()]
             if download_places:
                 utils.log_iterable(download_places, logger=LOG,
                     header="Keeping %s download directories (and there children directories)" % (len(download_places)))
                 for download_place in download_places:
                     dirs_made = sh.remove_parents(download_place, dirs_made)
         if dirs_made:
             utils.log_iterable(dirs_made, logger=LOG,
                 header="Removing %s created directories" % (len(dirs_made)))
             for dir_name in dirs_made:
                 sh.deldir(dir_name, run_as_root=True)
 def _uninstall_dirs(self):
     dirsmade = self.tracereader.dirs_made()
     if dirsmade:
         dirsmade = [sh.abspth(d) for d in dirsmade]
         if self.keep_old:
             downloads = (self.tracereader.downloaded())
             places = set()
             for info in downloads:
                 download_place = info.get('target')
                 if download_place:
                     places.add(download_place)
             LOG.info("Keeping %s download directories [%s]" % (len(places), ",".join(sorted(places))))
             for download_place in places:
                 dirsmade = sh.remove_parents(download_place, dirsmade)
         for dirname in dirsmade:
             LOG.info("Removing created directory (%s)" % (dirname))
             sh.deldir(dirname, run_as_root=True)