Browse Source

voixicron: update repository information before reporting available updates (fixes #3)

Helmut Pozimski 7 years ago
parent
commit
0d02c4ebb8
1 changed files with 6 additions and 0 deletions
  1. 6 0
      voixicron.py

+ 6 - 0
voixicron.py

@@ -40,6 +40,12 @@ LOGGER.setLevel(LOG_LEVEL)
 CONSOLE_HANDLER = logging.StreamHandler()
 LOGGER.addHandler(CONSOLE_HANDLER)
 
+try:
+    subprocess.call(["xbps-install", "-S"], stdout=DEVNULL, stderr=DEVNULL)
+except subprocess.CalledProcessError:
+    LOGGER.warn("Repository information could not be updated, voixicron will "
+                "report outdated data!")
+
 try:
     XBPS_INSTALL_RESULT = subprocess.check_output(["xbps-install", "-Sun"],
                                                   stderr=DEVNULL)