Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions usr/bin/mint-switch-to-local-mirror
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
#TODO: Factorize mirror detection/analysis code into mint-common
# It's used in here, but also in mintsources itself, and in mintupdate...

import os, sys
import lsb_release
import datetime
import pycurl
import fileinput
import json
import urllib.request as urllibrequest
import re
import os
import random
import fileinput
import re
import sys
import urllib.request as urllibrequest

import lsb_release

import pycurl

MIRROR_LIST = "/usr/share/mint-mirrors/linuxmint.list"
SOURCES_LIST = "/etc/apt/sources.list.d/official-package-repositories.list"
Expand Down
1 change: 0 additions & 1 deletion usr/bin/software-sources
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import os
import subprocess
import sys

if os.getuid() != 0:
subprocess.run(["pkexec", "/usr/bin/mintsources"])
Expand Down
15 changes: 7 additions & 8 deletions usr/lib/linuxmint/mintSources/foreign_packages.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
#!/usr/bin/python3
import os
import sys
import apt

import gettext
import tempfile
import os
import subprocess
import mintcommon.aptdaemon
import gi
import locale
import sys

import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Vte', '2.91')
from gi.repository import Gtk, Vte, GLib

import apt
import mintcommon.aptdaemon

# i18n
APP = 'mintsources'
LOCALE_DIR = "/usr/share/linuxmint/locale"
locale.bindtextdomain(APP, LOCALE_DIR)
gettext.bindtextdomain(APP, LOCALE_DIR)
gettext.textdomain(APP)
_ = gettext.gettext
Expand Down
14 changes: 6 additions & 8 deletions usr/lib/linuxmint/mintSources/mintSources.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
from urllib.request import urlopen
import requests
from optparse import OptionParser
import locale
import mintcommon.aptdaemon
import glob
from glob import glob
import apt_pkg
import shutil
import gi
Expand All @@ -39,7 +38,6 @@
# i18n
APP = 'mintsources'
LOCALE_DIR = "/usr/share/linuxmint/locale"
locale.bindtextdomain(APP, LOCALE_DIR)
gettext.bindtextdomain(APP, LOCALE_DIR)
gettext.textdomain(APP)
_ = gettext.gettext
Expand Down Expand Up @@ -267,7 +265,7 @@ def expand_ppa_line(abrev, distro_codename):
ppa_owner = abrev.split("/")[0]
try:
ppa_name = abrev.split("/")[1]
except IndexError:
except:
ppa_name = "ppa"
sourceslistd = "/etc/apt/sources.list.d"
line = "deb http://ppa.launchpad.net/%s/%s/ubuntu %s main" % (ppa_owner, ppa_name, distro_codename)
Expand All @@ -282,7 +280,7 @@ def expand_http_line(line, distro_codename):
apt-add-repository 'deb http://packages.medibuntu.org/ base_codename free non-free'
"""
if not line.startswith("http"):
return line
return line
repo = line.split()[0]
try:
areas = line.split(" ",1)[1]
Expand Down Expand Up @@ -610,7 +608,7 @@ def _all_speed_tests(self):
if mirror in self.visible_mirrors:
url = self._mirrors_model.get_value(iter, MirrorSelectionDialog.MIRROR_URL_COLUMN)
self._speed_test (iter, url)
except Exception as e:
except:
pass # null types will occur here...

def _get_speed_label(self, speed):
Expand Down Expand Up @@ -1059,7 +1057,7 @@ def remove_duplicates(self, widget):
knownlines = set()

# Parse official sources first
for listfile in glob.glob("/etc/apt/sources.list.d/official*.list"):
for listfile in glob("/etc/apt/sources.list.d/official*.list"):
with open(listfile, encoding="utf-8", errors="ignore") as f:
lines = []
for line in f.readlines():
Expand All @@ -1070,7 +1068,7 @@ def remove_duplicates(self, widget):

# Now parse other sources and remove any duplicates
found_duplicates = False
for listfile in ["/etc/apt/sources.list"] + glob.glob("/etc/apt/sources.list.d/*.list"):
for listfile in ["/etc/apt/sources.list"] + glob("/etc/apt/sources.list.d/*.list"):
if not listfile.startswith("/etc/apt/sources.list.d/official"):
with open(listfile, encoding="utf-8", errors="ignore") as f:
lines = []
Expand Down
20 changes: 9 additions & 11 deletions usr/lib/linuxmint/mintSources/ppa_browser.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
#!/usr/bin/python3
import os
import sys
import apt

import gettext
import tempfile
import os
import subprocess
import mintcommon.aptdaemon
import platform
import locale
import sys

import gi
gi.require_version('Gtk', '3.0')
gi.require_version('GdkX11', '3.0') # Needed to get xid
from gi.repository import Gtk, GdkX11
from gi.repository import Gtk

import apt
import mintcommon.aptdaemon

# i18n
APP = 'mintsources'
LOCALE_DIR = "/usr/share/linuxmint/locale"
locale.bindtextdomain(APP, LOCALE_DIR)
gettext.bindtextdomain(APP, LOCALE_DIR)
gettext.textdomain(APP)
_ = gettext.gettext

class PPA_Browser():

def __init__(self, base_codename, ppa_owner, ppa_name):
if platform.machine() == "X86_64":
if os.uname().machine == "x86_64":
architecture = "amd64"
else:
architecture = "i386"
Expand Down