Репозиторий Sisyphus
Последнее обновление: 6 апреля 2020 | Пакетов: 17564 | Посещений: 17838168
en ru br
Репозитории ALT
S:0.01.2-alt2
5.1: 0.01-alt2
www.altlinux.org/Changes

Группа :: Система/Настройка/Пакеты
Пакет: apt-blacklist

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: port-on-python3.patch
Скачать


diff --git a/apt-blacklist b/apt-blacklist
index 8beef6b..789fa6b 100755
--- a/apt-blacklist
+++ b/apt-blacklist
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
 #vim:set fileencoding=utf-8:
 #
 #   apt-blacklist - Check packages that apt wants to install and abort the
@@ -21,7 +21,7 @@
 #   <http://www.gnu.org/licenses/>.
 #
 
-from __future__ import with_statement
+
 import os
 import sys
 
@@ -66,7 +66,7 @@ if __name__ == '__main__':
     for pkg, packager, dummy in pkgInfos:
         for badPackager in packagerBlacklist:
             if packager.lower().find(badPackager) > -1:
-                if not badPackages.has_key(packager):
+                if packager not in badPackages:
                     badPackages[packager] = []
                 badPackages[packager].append(pkg)
                 break
@@ -79,16 +79,16 @@ if __name__ == '__main__':
         for pkg, packager, dummy in pkgInfos:
             for warnPackager in packagerWarnlist:
                 if packager.lower().find(warnPackager) > -1:
-                    if not warnPackages.has_key(packager):
+                    if packager not in warnPackages:
                         warnPackages[packager] = []
                     warnPackages[packager].append(pkg)
 
         if len(warnPackages) > 0:
-            print
-            print '=== apt-blacklist-warning ==='
+            print()
+            print('=== apt-blacklist-warning ===')
             for packager in sorted(warnPackages):
-                print 'Package(s) %s is changed by maintainer in warning list: "%s"' % (', '.join(warnPackages[packager]), packager)
-            print
+                print('Package(s) %s is changed by maintainer in warning list: "%s"' % (', '.join(warnPackages[packager]), packager))
+            print()
 
     if os.path.exists(packagerWatchlistPath):
         with open(packagerWatchlistPath) as f:
@@ -99,21 +99,21 @@ if __name__ == '__main__':
             for watchPackager in packagerWatchlist:
                 if oldpackager and (oldpackager.lower().find(watchPackager) > -1) and (newpackager.lower() != oldpackager.lower()):
                     key = (oldpackager,newpackager)
-                    if not watchPackages.has_key(key):
+                    if key not in watchPackages:
                         watchPackages[key] = []
                     watchPackages[key].append(pkg)
 
         if len(watchPackages) > 0:
-            print
-            print '=== apt-blacklist-watch ==='
+            print()
+            print('=== apt-blacklist-watch ===')
             for oldpackager, newpackager in sorted(watchPackages):
-                print 'Note: package(s) %s was built by %s (after %s)' % (', '.join(watchPackages[(oldpackager,newpackager)]), newpackager, oldpackager)
-            print
+                print('Note: package(s) %s was built by %s (after %s)' % (', '.join(watchPackages[(oldpackager,newpackager)]), newpackager, oldpackager))
+            print()
 
     if len(badPackages) > 0:
-        print
-        print '=== apt-blacklist ==='
+        print()
+        print('=== apt-blacklist ===')
         for packager in sorted(badPackages):
-            print 'Package(s) %s is blacklisted: "%s"' % (', '.join(badPackages[packager]), packager)
-        print
+            print('Package(s) %s is blacklisted: "%s"' % (', '.join(badPackages[packager]), packager))
+        print()
         sys.exit(1)
-- 
2.24.1
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin