diff -Nru apt-xapian-index-0.51ubuntu1/.mypy.ini apt-xapian-index-0.54ubuntu1/.mypy.ini --- apt-xapian-index-0.51ubuntu1/.mypy.ini 1970-01-01 00:00:00.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/.mypy.ini 2023-11-29 16:49:54.000000000 +0000 @@ -0,0 +1,5 @@ +[mypy] +exclude = (?x)( + ^debian/ + | build/ + ) diff -Nru apt-xapian-index-0.51ubuntu1/axi/__init__.py apt-xapian-index-0.54ubuntu1/axi/__init__.py --- apt-xapian-index-0.51ubuntu1/axi/__init__.py 2020-03-08 15:15:55.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/axi/__init__.py 2024-02-28 10:29:58.000000000 +0000 @@ -18,8 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -from __future__ import print_function - import os import os.path import sys @@ -45,15 +43,18 @@ packagesize="package size" ) -def readValueDB(pathname=XAPIANDBVALUES, quiet=False): +def readValueDB( + pathname: str = XAPIANDBVALUES, + quiet: bool = False +) -> tuple[dict[str, int], dict[str, str]]: """ Read the "/etc/services"-style database of value indices """ try: re_empty = re.compile("^\s*(?:#.*)?$") re_value = re.compile("^(\S+)\s+(\d+)(?:\s*#\s*(.+))?$") - values = {} - descs = {} + values: dict[str, int] = {} + descs: dict[str, str] = {} for idx, line in enumerate(open(pathname)): # Skip empty lines and comments if re_empty.match(line): continue diff -Nru apt-xapian-index-0.51ubuntu1/axi/indexer.py apt-xapian-index-0.54ubuntu1/axi/indexer.py --- apt-xapian-index-0.51ubuntu1/axi/indexer.py 2020-03-27 11:05:54.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/axi/indexer.py 2024-02-28 10:29:59.000000000 +0000 @@ -18,8 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # - -from __future__ import print_function +from __future__ import annotations import axi import sys @@ -34,9 +33,14 @@ import time import re import pickle - from operator import itemgetter -from six.moves.urllib_parse import unquote +from types import TracebackType +from typing import Any, Iterable, Iterator, TYPE_CHECKING +from urllib.parse import unquote + +if TYPE_CHECKING: + import apt + import apt_pkg APTLISTDIR="/var/lib/apt/lists" @@ -44,7 +48,12 @@ """ Indexer plugin wrapper """ - def __init__(self, fname, progress=None, **kw): + def __init__( + self, + fname: str, + progress=None, + **kw + ) -> None: self.filename = os.path.basename(fname) self.name = os.path.splitext(self.filename)[0] oldpath = sys.path @@ -68,17 +77,17 @@ progress.warning("Plugin %s initialisation failed: %s" % (fname, str(e))) self.obj = None - def finished(self): + def finished(self) -> None: if hasattr(self.obj, "finished"): self.obj.finished() - def send_extra_info(self, **kw): + def send_extra_info(self, **kw: Any) -> None: func = getattr(self.obj, "send_extra_info", None) if func is not None: func(**kw) class Plugins(list): - def __init__(self, **kw): + def __init__(self, **kw) -> None: """ Read the plugins, in sorted order. @@ -88,20 +97,23 @@ kw["langs"] = self.scan_available_languages() progress = kw.get("progress", None) - self.disabled = [] + self.disabled: list[str] = [] for fname in sorted(os.listdir(axi.PLUGINDIR)): # Skip non-pythons, hidden files and python sources starting with '_' - if fname[0] in ['.', '_'] or not fname.endswith(".py"): continue + if fname[0] in ['.', '_'] or not fname.endswith(".py"): + continue fullname = os.path.join(axi.PLUGINDIR, fname) - if not os.path.isfile(fullname): continue - if progress: progress.verbose("Reading plugin %s." % fullname) + if not os.path.isfile(fullname): + continue + if progress: + progress.verbose("Reading plugin %s." % fullname) addon = Addon(fullname, **kw) if addon.obj != None: self.append(addon) - def scan_available_languages(self): + def scan_available_languages(self) -> set[str]: # Languages we index - langs = set() + langs: set[str] = set() # Look for files like: ftp.uk.debian.org_debian_dists_sid_main_i18n_Translation-it # And extract the language code at the end @@ -118,104 +130,126 @@ """ Normal progress report to stdout """ - def __init__(self): - self.task = None + def __init__(self) -> None: + self.task: str | None = None self.halfway = False self.is_verbose = False - def begin(self, task): + + def begin(self, task: str) -> None: self.task = task print("%s..." % self.task, end='') sys.stdout.flush() self.halfway = True - def progress(self, percent): + + def progress(self, percent: float) -> None: print("\r%s... %d%%" % (self.task, percent), end='') sys.stdout.flush() self.halfway = True - def end(self): + + def end(self) -> None: print("\r%s: done. " % self.task) self.halfway = False - def verbose(self, *args): + + def verbose(self, *args: str) -> None: if not self.is_verbose: return if self.halfway: print() print(" ".join(args)) self.halfway = False - def notice(self, *args): + + def notice(self, *args: str) -> None: if self.halfway: print() print(" ".join(args), file=sys.stderr) self.halfway = False - def warning(self, *args): + + def warning(self, *args: str) -> None: if self.halfway: print() print(" ".join(args), file=sys.stderr) self.halfway = False - def error(self, *args): + + def error(self, *args: str) -> None: if self.halfway: print() print(" ".join(args), file=sys.stderr) self.halfway = False + class BatchProgress: """ Machine readable progress report """ - def __init__(self): - self.task = None - def begin(self, task): + def __init__(self) -> None: + self.task: str | None = None + + def begin(self, task: str) -> None: self.task = task print("begin: %s\n" % self.task, end='') sys.stdout.flush() - def progress(self, percent): + + def progress(self, percent: float) -> None: print("progress: %d/100\n" % percent, end='') sys.stdout.flush() - def end(self): + + def end(self) -> None: print("done: %s\n" % self.task) sys.stdout.flush() - def verbose(self, *args): + + def verbose(self, *args: str) -> None: print("verbose: %s" % (" ".join(args))) sys.stdout.flush() - def notice(self, *args): + + def notice(self, *args: str) -> None: print("notice: %s" % (" ".join(args))) sys.stdout.flush() - def warning(self, *args): + + def warning(self, *args: str) -> None: print("warning: %s" % (" ".join(args))) sys.stdout.flush() - def error(self, *args): + + def error(self, *args:str) -> None: print("error: %s" % (" ".join(args))) sys.stdout.flush() + class SilentProgress: """ Quiet progress report """ - def begin(self, task): + def begin(self, task: str) -> None: pass - def progress(self, percent): + + def progress(self, percent: float) -> None: pass - def end(self): + + def end(self) -> None: pass - def verbose(self, *args): + + def verbose(self, *args: str) -> None: pass - def notice(self, *args): + + def notice(self, *args: str) -> None: pass - def warning(self, *args): + def warning(self, *args: str) -> None: print(" ".join(args), file=sys.stderr) - def error(self, *args): + + def error(self, *args: str) -> None: print(" ".join(args), file=sys.stderr) + class ClientProgress: """ Client-side progress report, reporting progress from another running indexer """ - def __init__(self, progress): + def __init__(self, progress) -> None: self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.sock.settimeout(None) self.sock.connect(axi.XAPIANDBUPDATESOCK) self.progress = progress - def loop(self): + def loop(self) -> None: hasBegun = False while True: msg = self.sock.recv(4096) @@ -255,38 +289,48 @@ """ Server endpoint for client-server progress report """ - def __init__(self, sock, task = None): + def __init__(self, sock: socket.socket, task: str | None = None) -> None: self.sock = sock - self.task = task - def __del__(self): + self.task: str | None = task + + def __del__(self) -> None: self._send(pickle.dumps(("alldone",))) - def _send(self, text): + + def _send(self, text: bytes) -> None: try: self.sock.send(text) except: pass - def begin(self, task): + + def begin(self, task: str) -> None: self.task = task self._send(pickle.dumps(("begin", self.task))) - def progress(self, percent): + + def progress(self, percent: float) -> None: self._send(pickle.dumps(("progress", self.task, percent))) - def end(self): + + def end(self) -> None: self._send(pickle.dumps(("end", self.task))) - def verbose(self, *args): + + def verbose(self, *args: str) -> None: self._send(pickle.dumps(("verbose",) + args)) - def notice(self, *args): + + def notice(self, *args: str) -> None: self._send(pickle.dumps(("notice",) + args)) - def warning(self, *args): + + def warning(self, *args: str) -> None: self._send(pickle.dumps(("warning",) + args)) - def error(self, *args): + + def error(self, *args: str) -> None: self._send(pickle.dumps(("error",) + args)) + class ServerProgress: """ Send progress report to any progress object, as well as to client indexers """ - def __init__(self, mine): - self.task = None + def __init__(self, mine) -> None: + self.task: str | None = None self.proxied = [mine] self.sockfile = axi.XAPIANDBUPDATESOCK try: @@ -301,10 +345,12 @@ # Disallowing unwanted people to mess with the file is automatic, as # the socket has the ownership of the user we're using, and people # can't connect to it unless they can write to it - def __del__(self): + + def __del__(self) -> None: self.sock.close() os.unlink(self.sockfile) - def _check(self): + + def _check(self) -> None: try: sock = self.sock.accept()[0] self.proxied.append(ServerSenderProgress(sock, self.task)) @@ -312,66 +358,81 @@ if e.args[0] != errno.EAGAIN: raise pass - def begin(self, task): + + def begin(self, task: str) -> None: self._check() self.task = task for x in self.proxied: x.begin(task) - def progress(self, percent): + + def progress(self, percent: float) -> None: self._check() for x in self.proxied: x.progress(percent) - def end(self): + + def end(self) -> None: self._check() for x in self.proxied: x.end() - def verbose(self, *args): + + def verbose(self, *args: str) -> None: self._check() for x in self.proxied: x.verbose(*args) - def notice(self, *args): + + def notice(self, *args: str) -> None: self._check() for x in self.proxied: x.notice(*args) - def warning(self, *args): + + def warning(self, *args: str) -> None: self._check() for x in self.proxied: x.warning(*args) - def error(self, *args): + + def error(self, *args: str) -> None: self._check() for x in self.proxied: x.error(*args) -class ExecutionTime(object): +class ExecutionTime: """ Helper that can be used in with statements to have a simple measure of the timing of a particular block of code, e.g. with ExecutionTime("db flush"): db.flush() """ - def __init__(self, info=""): + def __init__(self, info: str = "") -> None: self.info = info - def __enter__(self): + + def __enter__(self) -> None: self.now = time.time() - def __exit__(self, type, value, stack): + + def __exit__( + self, + type : type[BaseException] | None = None, + value: BaseException | None = None, + stack: TracebackType | None = None + ) -> None: print("%s: %s" % (self.info, time.time() - self.now)) -class Indexer(object): + +class Indexer: """ The indexer """ - def __init__(self, progress, quietapt=False): + def __init__(self, progress, quietapt: bool = False) -> None: self.progress = progress self.quietapt = quietapt self.verbose = getattr(progress, "is_verbose", False) # Timestamp of the most recent data source self.ds_timestamp = 0 # Apt cache instantiated on demand - self.apt_cache = None + self.apt_cache: apt.Cache | None = None # Loaded plugins - self.plugins = None + self.plugins: list[Addon] | None = None # OS file handle for the lock file - self.lockfd = None + self.lockfd: int | None = None # Ensure the database and cache directories exist self.ensure_dir_exists(axi.XAPIANDBPATH) self.ensure_dir_exists(axi.XAPIANCACHEPATH) - def ensure_dir_exists(self, pathname): + def ensure_dir_exists(self, pathname: str) -> None: """ Create a directory if missing, but do not complain if it already exists """ @@ -386,7 +447,7 @@ # If that path already exists, but is not a directory, also fail raise - def _test_wrap_apt_cache(self, wrapper): + def _test_wrap_apt_cache(self, wrapper) -> None: """ Wrap the apt-cache in some proxy object. @@ -399,7 +460,7 @@ # Wrap it self.apt_cache = wrapper(self.apt_cache) - def aptcache(self): + def aptcache(self) -> apt.Cache: if not self.apt_cache: #import warnings ## Yes, apt, thanks, I know, the api isn't stable, thank you so very much @@ -411,11 +472,11 @@ if self.quietapt: class AptSilentProgress(apt.progress.text.OpProgress) : - def __init__(self): + def __init__(self) -> None: pass - def done(self): + def done(self) -> None: pass - def update(self,percent=None): + def update(self, percent: float | None = None) -> None: pass aptprogress = AptSilentProgress() else: @@ -425,7 +486,7 @@ self.apt_cache = apt.Cache(progress=aptprogress) return self.apt_cache - def lock(self): + def lock(self) -> bool: """ Lock the session to prevent further updates. @@ -446,7 +507,7 @@ else: raise - def slave(self): + def slave(self) -> None: """ Attach to a running indexer and report its progress. @@ -456,7 +517,7 @@ childProgress = ClientProgress(self.progress) childProgress.loop() - def setupIndexing(self, force=False, system=True): + def setupIndexing(self, force: bool = False, system: bool = True) -> bool: """ Setup indexing: read plugins, check timestamps... @@ -521,10 +582,11 @@ return True - def get_document_from_apt(self, pkg): + def get_document_from_apt(self, pkg: apt.Package) -> xapian.Document: """ Get a xapian.Document for the given apt package record """ + assert self.plugins is not None document = xapian.Document() # The document data is the package name document.set_data(pkg.name) @@ -538,10 +600,11 @@ addon.obj.index(document, pkg) return document - def get_document_from_deb822(self, pkg): + def get_document_from_deb822(self, pkg) -> xapian.Document: """ Get a xapian.Document for the given deb822 package record """ + assert self.plugins is not None document = xapian.Document() # The document data is the package name @@ -556,7 +619,7 @@ addon.obj.indexDeb822(document, pkg) return document - def gen_documents_apt(self): + def gen_documents_apt(self) -> Iterator[xapian.Document]: """ Generate Xapian documents from an apt cache """ @@ -571,39 +634,34 @@ ":" in pkg.name and pkg.name.split(":")[0] in cache): continue # Print progress - if idx % 200 == 0: self.progress.progress(100*idx/count) + if idx % 200 == 0: + self.progress.progress(100*idx/count) yield self.get_document_from_apt(pkg) - def gen_documents_deb822(self, fnames): - try: - from debian import deb822 - except ImportError: - from debian_bundle import deb822 + def gen_documents_deb822(self, fnames: Iterable[str]) -> Iterator[xapian.Document]: + from debian import deb822 seen = set() for fname in fnames: infd = open(fname) - # In Python 3, you cannot tell() on a file object while - # iterating so you have to pop the hood to get at the - # underlying buffer. In Python 2, the file object doesn't have - # this attribute, or this restriction. - try: - tellable = infd.buffer - except AttributeError: - tellable = infd # Get file size to compute progress total = os.fstat(infd.fileno())[6] for idx, pkg in enumerate(deb822.Deb822.iter_paragraphs(infd)): name = pkg["Package"] - if name in seen: continue + if name in seen: + continue seen.add(name) # Print approximate progress by checking the current read position # against the file size if total > 0 and idx % 200 == 0: - cur = tellable.tell() + cur = infd.buffer.tell() self.progress.progress(100*cur/total) yield self.get_document_from_deb822(pkg) - def compareCacheToDb(self, cache, db): + def compareCacheToDb( + self, + cache: apt.Cache, + db: xapian.WritableDatabase + ) -> tuple[dict[str, int], dict[str, int], dict[str, int]]: """ Compare the apt cache to the database and return dicts of the form (pkgname, docid) for the following states: @@ -612,16 +670,17 @@ outdated - a new version since the last update obsolete - no longer in the apt cache """ - unchanged = {} - outdated = {} - obsolete = {} + unchanged: dict[str, int] = {} + outdated: dict[str, int] = {} + obsolete: dict[str, int] = {} self.progress.begin("Reading Xapian index") count = db.get_doccount() for (idx, m) in enumerate(db.postlist("")): - if idx % 5000 == 0: self.progress.progress(100*idx/count) + if idx % 5000 == 0: + self.progress.progress(100*idx/count) doc = db.get_document(m.docid) pkg = doc.get_data() - if bytes is not str and isinstance(pkg, bytes): + if isinstance(pkg, bytes): # python3-apt requires strings. pkg = pkg.decode('utf-8') # this will return '' if there is no value 0, which is fine because it @@ -640,10 +699,11 @@ self.progress.end() return unchanged, outdated, obsolete - def updateIndex(self, pathname): + def updateIndex(self, pathname: str) -> None: """ Update the index """ + assert self.plugins is not None try: db = xapian.WritableDatabase(pathname, xapian.DB_CREATE_OR_OPEN) except xapian.DatabaseLockError as e: @@ -659,7 +719,8 @@ len(obsolete))) self.progress.begin("Updating Xapian index") - for a in self.plugins: a.send_extra_info(db=db, aptcache=cache) + for a in self.plugins: + a.send_extra_info(db=db, aptcache=cache) for idx, pkg in enumerate(cache): if idx % 1000 == 0: self.progress.progress(100*idx/count) if not pkg.candidate: @@ -683,7 +744,7 @@ db.flush() self.progress.end() - def incrementalUpdate(self): + def incrementalUpdate(self) -> None: if not os.path.exists(axi.XAPIANINDEX): self.progress.notice("No Xapian index built yet: falling back to full rebuild") return self.rebuild() @@ -701,10 +762,11 @@ if self.ds_timestamp > 0: os.utime(axi.XAPIANDBSTAMP, (self.ds_timestamp, self.ds_timestamp)) - def buildIndex(self, pathname, documents, addoninfo={}): + def buildIndex(self, pathname: str, documents, addoninfo={}) -> None: """ Create a new Xapian index with the content provided by the plugins """ + assert self.plugins is not None self.progress.begin("Rebuilding Xapian index") # Create a new Xapian index @@ -712,19 +774,21 @@ # It seems to be faster without transactions, at the moment #db.begin_transaction(False) - for a in self.plugins: a.send_extra_info(db=db) + for a in self.plugins: + a.send_extra_info(db=db) # Add all generated documents to the index for doc in documents: db.add_document(doc) #db.commit_transaction(); - for a in self.plugins: + for a in self.plugins: a.finished() db.flush() self.progress.end() - def rebuild(self, pkgfiles=None): + def rebuild(self, pkgfiles: Iterable[str] | None = None) -> None: + assert self.plugins is not None # Create a new Xapian index with the content provided by the plugins # Xapian takes care of preventing concurrent updates and removing the old # database if it's left over by a previous crashed update @@ -738,7 +802,8 @@ if pkgfiles: generator = self.gen_documents_deb822(pkgfiles) else: - for a in self.plugins: a.send_extra_info(aptcache=self.aptcache()) + for a in self.plugins: + a.send_extra_info(aptcache=self.aptcache()) generator = self.gen_documents_apt() self.buildIndex(dbdir, generator) @@ -751,7 +816,7 @@ os.rename(axi.XAPIANINDEX + ".tmp", axi.XAPIANINDEX) # Remove all other index.* directories that are not the newly created one - def cleanoldcaches(dir): + def cleanoldcaches(dir: str) -> None: for file in os.listdir(dir): if not file.startswith("index."): continue # Don't delete what we just created @@ -774,10 +839,12 @@ self.writePrefixes() self.writeDoc() - def writePrefixes(self, pathname=axi.XAPIANDBPREFIXES): + def writePrefixes(self, pathname: str = axi.XAPIANDBPREFIXES) -> None: """ Write the prefix information on the given file """ + assert self.plugins is not None + self.progress.verbose("Writing prefix information to %s." % pathname) with open(pathname+".tmp", "w") as out: print(textwrap.dedent(""" @@ -794,7 +861,7 @@ """).lstrip(), file=out) # Aggregate and normalise prefix information from all the plugins - prefixes = dict() + prefixes: dict[str, dict[str, str]] = dict() for addon in self.plugins: for p in addon.info.get("prefixes", []): idx = p.get("idx", None) @@ -818,7 +885,7 @@ # Atomic update of the documentation os.rename(pathname+".tmp", pathname) - def writeValues(self, pathname=axi.XAPIANDBVALUES): + def writeValues(self, pathname: str = axi.XAPIANDBVALUES) -> None: """ Write the value information on the given file """ @@ -846,10 +913,11 @@ # Atomic update of the documentation os.rename(pathname+".tmp", pathname) - def writeDoc(self, pathname=axi.XAPIANDBDOC): + def writeDoc(self, pathname: str = axi.XAPIANDBDOC) -> None: """ Write the documentation in the given file """ + assert self.plugins is not None self.progress.verbose("Writing documentation to %s." % pathname) # Collect the documentation docinfo = [] diff -Nru apt-xapian-index-0.51ubuntu1/axi-cache apt-xapian-index-0.54ubuntu1/axi-cache --- apt-xapian-index-0.51ubuntu1/axi-cache 2020-03-27 10:57:03.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/axi-cache 2024-02-28 10:29:59.000000000 +0000 @@ -25,11 +25,9 @@ # - save NAME save the query to be recalled later with @NAME (or if notmuch # has a syntax for saved queries, recycle it) -from __future__ import print_function - from operator import itemgetter from optparse import OptionParser -from six import StringIO +from io import StringIO import sys import os, os.path import axi @@ -49,10 +47,7 @@ import math import xapian import apt - try: - from debian import deb822 - except ImportError: - from debian_bundle import deb822 + from debian import deb822 helponly = False except ImportError as e: print("%s: only help functions are implemented, for the sake of help2man" % str(e), file=sys.stderr) @@ -88,13 +83,14 @@ return facets, tags - class DB(object): + class DB: class BasicFilter(xapian.ExpandDecider): def __init__(self, stemmer=None, exclude=None, prefix=None): super(DB.BasicFilter, self).__init__() self.stem = stemmer if stemmer else lambda x:x self.exclude = set([self.stem(x) for x in exclude]) if exclude else set() self.prefix = prefix + def __call__(self, term): term = term.decode('utf-8') if len(term) < 4: return False @@ -110,15 +106,15 @@ return term[0].islower() class TermFilter(BasicFilter): - def __call__(self, term): - term = term.decode('utf-8') + def __call__(self, bterm: bytes) -> bool: + term = bterm.decode('utf-8') if len(term) < 4: return False if self.stem(term) in self.exclude: return False return term[0].islower() class TagFilter(xapian.ExpandDecider): - def __call__(self, term): - term = term.decode('utf-8') + def __call__(self, bterm: bytes) -> bool: + term = bterm.decode('utf-8') return term.startswith("XT") def __init__(self): @@ -126,7 +122,7 @@ try: self.db = xapian.Database(axi.XAPIANINDEX) except xapian.DatabaseOpeningError: - print >>sys.stderr, "Index not available: please run update-apt-xapian-index" + print("Index not available: please run update-apt-xapian-index", file=sys.stderr) sys.exit(2) self.stem = xapian.Stem("english") @@ -237,7 +233,7 @@ xapian.QueryParser.FLAG_AUTO_SYNONYMS) self.query = xapian.Query(xapian.Query.OP_AND, self.query, secondary) - # print "Query:", self.query + # print("Query:", self.query) # Build the enquire with the query self.enquire = xapian.Enquire(self.db) @@ -347,10 +343,10 @@ break first += 20 -class Cmdline(object): +class Cmdline: BOOLWORDS = set(["and", "or", "not"]) - def __init__(self): + def __init__(self) -> None: self.name = "axi-cache" class Parser(OptionParser): @@ -412,17 +408,17 @@ cur_timestamp = os.path.getmtime(axi.XAPIANDBSTAMP) cur_time = time.strftime("%c", time.localtime(cur_timestamp)) cur_time = "last updated: " + cur_time - except e: + except Exception as e: cur_timestamp = 0 cur_time = "not available: " + str(e) print("Update timestamp: %s (%s)" % (axi.XAPIANDBSTAMP, cur_time)) try: index_loc = open(axi.XAPIANINDEX).read().split(" ", 1)[1].strip() index_loc = "pointing to " + index_loc - except e: + except Exception as e: index_loc = "not available: " + str(e) print("Index location: %s (%s)" % (axi.XAPIANINDEX, index_loc)) - def fileinfo(fname): + def fileinfo(fname: str) -> str: if os.path.exists(fname): return fname else: @@ -438,8 +434,8 @@ # Aggregated value information # { valuename: { val=num, desc=shortdesc, plugins=[plugin names] } } - values, descs = axi.readValueDB() - values = dict(((a, dict(val=b, desc=descs[a], plugins=[])) for a, b in values.items())) + values_, descs = axi.readValueDB() + values = dict(((a, dict(val=b, desc=descs[a], plugins=[])) for a, b in values_.items())) # Aggregated data source information # { pathname: { desc=shortdesc, plugins=[plugin names] } } @@ -499,11 +495,11 @@ # Plugin information # { name: { path=path, desc=desc, status=status } } - #print "Plugins:" + #print("Plugins:") #maxname = max((len(x) for x in plugins.iterkeys())) #for name, info in sorted(plugins.iteritems(), key=lambda x:x[0]): - # print " %s:" % info["path"] - # print " ", info["desc"] + # print(" %s:" % info["path"]) + # print(" ", info["desc"]) print("Plugin status:") maxname = max((len(x) for x in plugins)) for name, info in sorted(plugins.items(), key=itemgetter(0)): @@ -535,7 +531,7 @@ return 0 - def do_search(self, args): + def do_search(self, args: list[str]) -> int: "search [terms]: start a new search" self.db = DB() self.db.set_query_args(args) @@ -554,11 +550,11 @@ self.db.save() return 0 - def complete_search(self): + def complete_search(self) -> int: self.db = DB() if self.opts.tabcomplete == "partial" and len(self.args) == 1: # Simple prefix search - terms = set() + terms = set() terms.update((str(term) for term in self.db.db.synonym_keys(self.args[0]))) terms.update((term.term for term in self.db.db.allterms(self.args[0]))) for term in sorted(terms): @@ -580,7 +576,7 @@ self.print_completions(self.db.get_matches()) return 0 - def do_again(self, args): + def do_again(self, args: list[str]) -> int: "again [query]: repeat the last search, possibly adding query terms" self.db = DB() self.db.set_query_args(args, secondary=True) @@ -601,7 +597,7 @@ self.db.save() return 0 - def complete_again(self): + def complete_again(self) -> int: self.db = DB() qargs, partial = self.tabcomplete_query_args() self.db.set_query_args(qargs, secondary=True) @@ -612,7 +608,7 @@ self.print_completions(self.db.get_matches(first = 0)) return 0 - def do_last(self, args): + def do_last(self, args: list[str]) -> int: "last [count]: show the last results again" self.db = DB() try: @@ -642,7 +638,7 @@ self.db.save() return 0 - def do_show(self, args): + def do_show(self, args: list[str]) -> None: "show pkgname[s]: run apt-cache show pkgname[s]" os.execvp("/usr/bin/apt-cache", ["apt-cache", "show"] + args) @@ -685,12 +681,12 @@ os.execvp("/usr/bin/apt-cache", ["apt-cache", "showsrc"] + args) complete_showsrc = complete_show - def do_depends(self, args): + def do_depends(self, args: list[str]) -> None: "depends pkgname[s]: run apt-cache depends pkgname[s]" os.execvp("/usr/bin/apt-cache", ["apt-cache", "depends"] + args) complete_depends = complete_show - def do_rdepends(self, args): + def do_rdepends(self, args: list[str]) -> None: "rdepends pkgname[s]: run apt-cache rdepends pkgname[s]" db = DB() for name in args: @@ -698,10 +694,10 @@ print("Reverse Depends:") for pfx in ("XRD", "XRR", "XRS", "XRE", "XRP", "XRB", "XRC"): for pkg in db.get_rdeps(name, pfx): - print(" ", pkg) + print(" ", pkg.decode("utf-8")) complete_rdepends = complete_show - def do_rdetails(self, args): + def do_rdetails(self, args: list[str]) -> None: "rdetails pkgname[s]: show details of reverse relationships for the given packages" db = DB() for name in args: @@ -713,22 +709,23 @@ ("XRP", "pre"), ("XRB", "bre"), ("XRC", "con")): - deps = list(db.get_rdeps(name, pfx)) - if not deps: continue + deps = map(lambda x: x.decode('utf-8'), db.get_rdeps(name, pfx)) + if not deps: + continue print(name, tag, " ".join(deps)) complete_rdetails = complete_show - def do_policy(self, args): + def do_policy(self, args: list[str]) -> None: "policy pkgname[s]: run apt-cache policy pkgname[s]" os.execvp("/usr/bin/apt-cache", ["apt-cache", "policy"] + args) complete_policy = complete_show - def do_madison(self, args): + def do_madison(self, args: list[str]) -> None: "madison pkgname[s]: run apt-cache madison pkgname[s]" os.execvp("/usr/bin/apt-cache", ["apt-cache", "madison"] + args) complete_madison = complete_show - def format_help(self, out): + def format_help(self, out) -> None: print("Commands:", file=out) itemlist = [] maxusage = 0 @@ -746,7 +743,7 @@ for usage, desc in [x for x in itemlist if "run apt-cache" in x[1]]: print(" %-*.*s %s" % (maxusage, maxusage, usage, desc), file=out) - def do_help(self, args): + def do_help(self, args) -> int: "help: show a summary of commands" self.parser.print_help() return 0 @@ -758,7 +755,7 @@ #res.sort() return res - def print_completions(self, matches): + def print_completions(self, matches) -> None: if self.opts.tabcomplete == "partial": prefix = self.args[-1] if self.args else None exclude = self.args[:-1] @@ -772,7 +769,7 @@ else: print(s) - def print_matches(self, matches): + def print_matches(self, matches) -> None: if self.opts.tags: facets, tags = self.db.vocabulary() def describe_tag(tag): @@ -787,7 +784,8 @@ for res in self.db.get_suggestions(count=20, filter=DB.TagFilter()): # Normalise the score in the interval [0, 1] weight = math.log(res.weight) - if maxscore == None: maxscore = weight + if maxscore is None: + maxscore = weight score = float(weight) / maxscore tag = self.db.unprefix(res.term.decode('utf-8'))[4:] desc = describe_tag(tag) @@ -851,8 +849,8 @@ try: return f(self.args) except xapian.FeatureUnavailableError: - print >>sys.stderr, "Existing Xapian index is incompatible, please rebuild it using\n" - print >>sys.stderr, "the update-apt-xapian-index command run as root (using sudo/su).\n" + print("Existing Xapian index is incompatible, please rebuild it using", file=sys.stderr) + print("the update-apt-xapian-index command run as root (using sudo/su).", file=sys.stderr) return 1 if __name__ == "__main__": diff -Nru apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.dirs apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.dirs --- apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.dirs 1970-01-01 00:00:00.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.dirs 2023-11-29 16:49:54.000000000 +0000 @@ -0,0 +1,6 @@ +usr/bin +usr/sbin +usr/share/apt-xapian-index +usr/share/apt-xapian-index/aliases +usr/share/apt-xapian-index/plugins +usr/share/doc diff -Nru apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.docs apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.docs --- apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.docs 1970-01-01 00:00:00.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.docs 2023-11-29 16:49:54.000000000 +0000 @@ -0,0 +1,2 @@ +ACKNOWLEDGEMENTS +README diff -Nru apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.examples apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.examples --- apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.examples 1970-01-01 00:00:00.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.examples 2023-11-29 16:49:54.000000000 +0000 @@ -0,0 +1 @@ +examples/* diff -Nru apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.manpages apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.manpages --- apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.manpages 1970-01-01 00:00:00.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.manpages 2023-11-29 16:49:54.000000000 +0000 @@ -0,0 +1,2 @@ +axi-cache.1 +update-apt-xapian-index.8 diff -Nru apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.postinst apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.postinst --- apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.postinst 1970-01-01 00:00:00.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.postinst 2023-11-29 16:49:54.000000000 +0000 @@ -0,0 +1,37 @@ +#!/bin/sh + +set -e + +#DEBHELPER# + +# ionice should not be called in a virtual environment +# (similar to man-db cronjobs) +if [ -x /usr/bin/ionice ] && ! egrep -q '(envID|VxID):.*[1-9]' /proc/self/status +then + IONICE="/usr/bin/ionice -c3" +else + IONICE="" +fi + +case "$1" in + configure) + # Just checking the main directory with -d should prevent the indexing + # to be started while an indexing is already going on, as the first + # thing that update-apt-xapian-index does is to create the directory if + # it is missing + # + # we also full-regenerate the index on upgrades from older versions + # because the weekly --update cron job will not use new plugins for + # already indexed packages + if [ ! -d /var/lib/apt-xapian-index ] + then + if [ ! -x /usr/sbin/policy-rc.d ] || /usr/sbin/policy-rc.d apt-xapian-index start + then + echo "apt-xapian-index: Building new index in background..." + $IONICE nice /usr/sbin/update-apt-xapian-index --force --quiet & + fi + fi + ;; +esac + +exit 0 diff -Nru apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.postrm apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.postrm --- apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.postrm 1970-01-01 00:00:00.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.postrm 2023-11-29 16:49:54.000000000 +0000 @@ -0,0 +1,17 @@ +#!/bin/sh + +set -e + +if [ "$1" = "remove" -o "$1" = "purge" ]; then + echo "Removing index /var/lib/apt-xapian-index..." + rm -rf /var/cache/apt-xapian-index + rm -rf /var/lib/apt-xapian-index +fi + +if [ "$1" = "remove" -o "$1" = "purge" ]; then + rm -f /usr/share/apt-xapian-index/plugins/*.pyc +fi + +#DEBHELPER# + +exit 0 diff -Nru apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.service apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.service --- apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.service 1970-01-01 00:00:00.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.service 2023-11-29 16:49:54.000000000 +0000 @@ -0,0 +1,12 @@ +[Unit] +Description=Update APT-Xapian-Index +Documentation=man:update-apt-xapian-index(8) +ConditionACPower=true + +[Service] +User=root +Type=oneshot +ExecStart=/usr/sbin/update-apt-xapian-index +Nice=19 +CPUSchedulingPolicy=idle +IOSchedulingClass=idle diff -Nru apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.timer apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.timer --- apt-xapian-index-0.51ubuntu1/debian/apt-xapian-index.timer 1970-01-01 00:00:00.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/apt-xapian-index.timer 2023-11-29 16:49:54.000000000 +0000 @@ -0,0 +1,11 @@ +[Unit] +Description=Update APT-Xapian-Index +Documentation=man:update-apt-xapian-index(8) + +[Timer] +OnCalendar=Mon *-*-* 6:15:0 +Persistent=true +RandomizedDelaySec=1h + +[Install] +WantedBy=timers.target diff -Nru apt-xapian-index-0.51ubuntu1/debian/changelog apt-xapian-index-0.54ubuntu1/debian/changelog --- apt-xapian-index-0.51ubuntu1/debian/changelog 2020-03-27 11:20:11.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/changelog 2024-02-28 11:26:43.000000000 +0000 @@ -1,3 +1,68 @@ +apt-xapian-index (0.54ubuntu1) noble; urgency=medium + + * Merge from Debian unstable (LP: #2055203). Remaining changes: + - Prefer native packages over foreign packages. + - Do not crash if the DB is already locked. + - Do not modify the DB "in-place" with --update + - debian/patches/01_axi_cjk_support.patch: + - Activate the CJK support when indexing the database. + - debian/patches/02_axi-pkgname-mangled-term.patch: + - add XPM term that contains a mangled version of the pkgname. + - plugins/app-install.py: + - Ignore file not found errors due to a race condition. + - debian/patches/06_32bit_sizes.patch: Watch out for package sizes that + don't fit in 32 bits. + - debian/patches/07_glib_import.patch: Fix the import of GLib and GObject. + - Build with quilt + * Dropped changes, no longer applicable: + - Bump the minimum version for removal of the dbus service + * debian/patches/python3.12.patch: Python 3.12 compatibility + (LP: #2055272) + + -- Graham Inggs Wed, 28 Feb 2024 11:26:43 +0000 + +apt-xapian-index (0.54) unstable; urgency=low + + * QA upload. + + * remove undeclared need for python3-six (Closes: #1032332, #1039456) + * bump to debhelper 13 & some forward compatibility with 14/15 + * migrate from python3-nose to python3-nose2 (Closes: #1018310) + * fix "unowned files after purge" (Closes: #863959) + * remove old references to deprecated debian_bundle + * fix remaining old Python2 "print" (Closes: #968060) + * provide a native systemd timer matching the cron job + * fix Py2->3 fallout: "rdetails fails: TypeError:" (Closes: #940987) + * review with mypy, remove more Python2 hybridation + * set Rules-Requires-Root: no + * d/control: remove redundant dh-python + + [ Debian Janitor ] + * Remove constraints unnecessary since stretch: + + Build-Depends-Indep: Drop versioned constraint on bash-completion. + + [ Gioele Barabucci ] + * d/post{inst,rm},preinst: Remove code for ancient versions + + -- Alexandre Detiste Wed, 29 Nov 2023 18:01:47 +0100 + +apt-xapian-index (0.53) unstable; urgency=medium + + * QA upload. + * Add the missing build dependency on python3-six. (Closes: #997109) + * Remove the dead Homepage. (Closes: #974718) + + -- Adrian Bunk Mon, 06 Dec 2021 20:13:46 +0200 + +apt-xapian-index (0.52) unstable; urgency=medium + + * QA upload. + + [ Debian Janitor ] + * Use set -e rather than passing -e on the shebang-line. + + -- Jelmer Vernooij Thu, 04 Feb 2021 01:45:54 +0000 + apt-xapian-index (0.51ubuntu1) focal; urgency=low * Merge from Debian unstable. Remaining changes: @@ -25,6 +90,7 @@ [ Debian Janitor ] * Use set -e rather than passing -e on the shebang-line. + * Add missing build dependency on dh addon. [ Julian Andres Klode ] * Port the code to work with apt 1.9 (Closes: #931133) @@ -960,4 +1026,3 @@ system-wide index of Debian package metadata. -- Enrico Zini Tue, 16 Oct 2007 12:20:43 +0100 - diff -Nru apt-xapian-index-0.51ubuntu1/debian/control apt-xapian-index-0.54ubuntu1/debian/control --- apt-xapian-index-0.51ubuntu1/debian/control 2020-03-27 10:47:40.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/control 2024-02-27 19:40:22.000000000 +0000 @@ -4,21 +4,23 @@ Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian QA Group Build-Depends: - debhelper-compat (= 12), + debhelper-compat (= 13), + dh-sequence-python3, quilt, Build-Depends-Indep: - bash-completion (>= 1:2.1-4.2~), + bash-completion, dh-python, help2man, python3-all, python3-apt (>= 0.7.93.2), python3-debian (>= 0.1.14), - python3-nose, + python3-nose2, python3-xapian, Standards-Version: 3.9.8 Vcs-Git: https://salsa.debian.org/debian/apt-xapian-index.git Vcs-Browser: https://salsa.debian.org/debian/apt-xapian-index -Homepage: http://www.enricozini.org/sw/apt-xapian-index/ +Homepage: https://salsa.debian.org/debian/apt-xapian-index/ +Rules-Requires-Root: no Package: apt-xapian-index Architecture: all diff -Nru apt-xapian-index-0.51ubuntu1/debian/cron.weekly apt-xapian-index-0.54ubuntu1/debian/cron.weekly --- apt-xapian-index-0.51ubuntu1/debian/cron.weekly 2020-03-08 15:15:54.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/cron.weekly 2024-02-27 19:34:16.000000000 +0000 @@ -1,5 +1,7 @@ #!/bin/sh +[ -d /run/systemd/system ] && exit 0 + CMD=/usr/sbin/update-apt-xapian-index # ionice should not be called in a virtual environment diff -Nru apt-xapian-index-0.51ubuntu1/debian/dirs apt-xapian-index-0.54ubuntu1/debian/dirs --- apt-xapian-index-0.51ubuntu1/debian/dirs 2020-03-08 15:15:54.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -usr/bin -usr/sbin -usr/share/apt-xapian-index -usr/share/apt-xapian-index/aliases -usr/share/apt-xapian-index/plugins -usr/share/doc diff -Nru apt-xapian-index-0.51ubuntu1/debian/docs apt-xapian-index-0.54ubuntu1/debian/docs --- apt-xapian-index-0.51ubuntu1/debian/docs 2020-03-08 15:15:54.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/docs 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -ACKNOWLEDGEMENTS -README diff -Nru apt-xapian-index-0.51ubuntu1/debian/examples apt-xapian-index-0.54ubuntu1/debian/examples --- apt-xapian-index-0.51ubuntu1/debian/examples 2020-03-08 15:15:54.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/examples 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -examples/* diff -Nru apt-xapian-index-0.51ubuntu1/debian/manpages apt-xapian-index-0.54ubuntu1/debian/manpages --- apt-xapian-index-0.51ubuntu1/debian/manpages 2020-03-08 15:15:54.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/manpages 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -axi-cache.1 -update-apt-xapian-index.8 diff -Nru apt-xapian-index-0.51ubuntu1/debian/patches/01_axi_cjk_support.patch apt-xapian-index-0.54ubuntu1/debian/patches/01_axi_cjk_support.patch --- apt-xapian-index-0.51ubuntu1/debian/patches/01_axi_cjk_support.patch 2019-06-27 09:35:49.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/patches/01_axi_cjk_support.patch 2024-02-28 10:45:35.000000000 +0000 @@ -1,9 +1,6 @@ -=== modified file 'axi-cache' -Index: apt-xapian-index-0.49ubuntu2/axi-cache -=================================================================== ---- apt-xapian-index-0.49ubuntu2.orig/axi-cache -+++ apt-xapian-index-0.49ubuntu2/axi-cache -@@ -43,6 +43,9 @@ +--- a/axi-cache ++++ b/axi-cache +@@ -41,6 +41,9 @@ XDG_CACHE_HOME = os.environ.get("XDG_CACHE_HOME", os.path.expanduser("~/.cache")) CACHEFILE = os.path.join(XDG_CACHE_HOME, "axi-cache.state") @@ -11,24 +8,22 @@ +os.environ["XAPIAN_CJK_NGRAM"] = "1" + try: - from ConfigParser import RawConfigParser + from configparser import RawConfigParser import re -Index: apt-xapian-index-0.49ubuntu2/axi/indexer.py -=================================================================== ---- apt-xapian-index-0.49ubuntu2.orig/axi/indexer.py -+++ apt-xapian-index-0.49ubuntu2/axi/indexer.py -@@ -641,6 +641,9 @@ +--- a/axi/indexer.py ++++ b/axi/indexer.py +@@ -699,6 +699,9 @@ self.progress.end() return unchanged, outdated, obsolete + def is_cjk_enabled (self): + return "XAPIAN_CJK_NGRAM" in os.environ + - def updateIndex(self, pathname): + def updateIndex(self, pathname: str) -> None: """ Update the index -@@ -650,6 +653,12 @@ - except xapian.DatabaseLockError: +@@ -709,6 +712,12 @@ + except xapian.DatabaseLockError as e: self.progress.warning("DB Update failed, database locked") return + @@ -40,7 +35,7 @@ cache = self.aptcache() count = len(cache) -@@ -710,6 +719,11 @@ +@@ -771,6 +780,11 @@ # Create a new Xapian index db = xapian.WritableDatabase(pathname, xapian.DB_CREATE_OR_OVERWRITE) @@ -52,19 +47,17 @@ # It seems to be faster without transactions, at the moment #db.begin_transaction(False) -Index: apt-xapian-index-0.49ubuntu2/test/test_indexer.py -=================================================================== ---- apt-xapian-index-0.49ubuntu2.orig/test/test_indexer.py -+++ apt-xapian-index-0.49ubuntu2/test/test_indexer.py -@@ -6,6 +6,7 @@ - import shutil - import subprocess +--- a/test/test_indexer.py ++++ b/test/test_indexer.py +@@ -10,6 +10,7 @@ + import axi + import axi.indexer import tools +import xapian def smallcache(pkglist=["apt", "libept-dev", "gedit"]): - class sc(object): -@@ -61,6 +62,11 @@ + class sc: +@@ -68,6 +69,11 @@ # Ensure that we have an index self.assertCleanIndex() @@ -73,10 +66,10 @@ + self.testAptRebuild() + del os.environ["XAPIAN_CJK_NGRAM"] + - def testDeb822Rebuild(self): + def testDeb822Rebuild(self) -> None: + assert self.indexer pkgfile = os.path.join(axi.XAPIANDBPATH, "packages") - subprocess.check_call("apt-cache show apt libept-dev gedit > " + pkgfile, shell=True) -@@ -117,6 +123,55 @@ +@@ -127,6 +133,55 @@ # Ensure that we did not create a new index self.assertEqual(open(axi.XAPIANINDEX).read(), curidx) @@ -129,16 +122,14 @@ + db = xapian.Database(axi.XAPIANINDEX) + self.assertEqual(db.get_metadata("cjk_ngram"), b"1") + - def testIncrementalRebuildFromEmpty(self): + def testIncrementalRebuildFromEmpty(self) -> None: + assert self.indexer # Prepare an incremental update - self.indexer._test_wrap_apt_cache(smallcache()) -Index: apt-xapian-index-0.49ubuntu2/update-apt-xapian-index -=================================================================== ---- apt-xapian-index-0.49ubuntu2.orig/update-apt-xapian-index -+++ apt-xapian-index-0.49ubuntu2/update-apt-xapian-index -@@ -24,6 +24,11 @@ - - from __future__ import print_function +--- a/update-apt-xapian-index ++++ b/update-apt-xapian-index +@@ -22,6 +22,11 @@ + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # +import os +# Activate support for the CJK tokenizer diff -Nru apt-xapian-index-0.51ubuntu1/debian/patches/python3.12.patch apt-xapian-index-0.54ubuntu1/debian/patches/python3.12.patch --- apt-xapian-index-0.51ubuntu1/debian/patches/python3.12.patch 1970-01-01 00:00:00.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/patches/python3.12.patch 2024-02-28 10:29:55.000000000 +0000 @@ -0,0 +1,41 @@ +Description: Python 3.12 compatibility + Use importlib.machinery SourceFileLoader instead of the + deprecated imp.load_source. + Use raw strings to avoid SyntaxWarning: invalid escape sequence. +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/apt-xapian-index/+bug/2055272 +Author: Graham Inggs +Last-Update: 2024-02-27 + +--- a/axi/indexer.py ++++ b/axi/indexer.py +@@ -23,7 +23,7 @@ + import axi + import sys + import os +-import imp ++from importlib.machinery import SourceFileLoader + import socket, errno + import fcntl + import textwrap +@@ -59,7 +59,7 @@ + oldpath = sys.path + try: + sys.path.append(os.path.dirname(fname)) +- self.module = imp.load_source("axi.plugin_" + self.name, fname) ++ self.module = SourceFileLoader("axi.plugin_" + self.name, fname).load_module() + finally: + sys.path = oldpath + try: +--- a/axi/__init__.py ++++ b/axi/__init__.py +@@ -51,8 +51,8 @@ + Read the "/etc/services"-style database of value indices + """ + try: +- re_empty = re.compile("^\s*(?:#.*)?$") +- re_value = re.compile("^(\S+)\s+(\d+)(?:\s*#\s*(.+))?$") ++ re_empty = re.compile(r"^\s*(?:#.*)?$") ++ re_value = re.compile(r"^(\S+)\s+(\d+)(?:\s*#\s*(.+))?$") + values: dict[str, int] = {} + descs: dict[str, str] = {} + for idx, line in enumerate(open(pathname)): diff -Nru apt-xapian-index-0.51ubuntu1/debian/patches/series apt-xapian-index-0.54ubuntu1/debian/patches/series --- apt-xapian-index-0.51ubuntu1/debian/patches/series 2020-03-27 10:49:26.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/patches/series 2024-02-27 20:41:07.000000000 +0000 @@ -2,3 +2,4 @@ 02_axi-pkgname-mangled-term.patch 06_32bit_sizes.patch 07_glib_import.patch +python3.12.patch diff -Nru apt-xapian-index-0.51ubuntu1/debian/postinst apt-xapian-index-0.54ubuntu1/debian/postinst --- apt-xapian-index-0.51ubuntu1/debian/postinst 2020-03-08 15:15:54.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/postinst 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -#!/bin/sh - -set -e - -#DEBHELPER# - -# ionice should not be called in a virtual environment -# (similar to man-db cronjobs) -if [ -x /usr/bin/ionice ] && ! egrep -q '(envID|VxID):.*[1-9]' /proc/self/status -then - IONICE="/usr/bin/ionice -c3" -else - IONICE="" -fi - -dpkg-maintscript-helper rm_conffile /etc/dbus-1/system.d/org.debian.AptXapianIndex.conf 0.49ubuntu1~ apt-xapian-index -- "$@" -dpkg-maintscript-helper rm_conffile /etc/bash_completion.d/axi-cache 0.47+nmu2~ apt-xapian-index -- "$@" - -case "$1" in - configure) - # Just checking the main directory with -d should prevent the indexing - # to be started while an indexing is already going on, as the first - # thing that update-apt-xapian-index does is to create the directory if - # it is missing - # - # we also full-regenerate the index on upgrades from older versions - # because the weekly --update cron job will not use new plugins for - # already indexed packages - if [ ! -d /var/lib/apt-xapian-index ] || dpkg --compare-versions "$2" lt-nl "0.39" - then - if [ ! -x /usr/sbin/policy-rc.d ] || /usr/sbin/policy-rc.d apt-xapian-index start - then - echo "apt-xapian-index: Building new index in background..." - $IONICE nice /usr/sbin/update-apt-xapian-index --force --quiet & - fi - fi - ;; -esac - -exit 0 diff -Nru apt-xapian-index-0.51ubuntu1/debian/postrm apt-xapian-index-0.54ubuntu1/debian/postrm --- apt-xapian-index-0.51ubuntu1/debian/postrm 2020-03-08 15:15:54.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/postrm 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#!/bin/sh - -set -e - -dpkg-maintscript-helper rm_conffile /etc/dbus-1/system.d/org.debian.AptXapianIndex.conf 0.49ubuntu1~ apt-xapian-index -- "$@" -dpkg-maintscript-helper rm_conffile /etc/bash_completion.d/axi-cache 0.47+nmu2~ apt-xapian-index -- "$@" - -if [ "$1" = "remove" -o "$1" = "purge" ]; then - echo "Removing index /var/lib/apt-xapian-index..." - rm -rf /var/cache/apt-xapian-index -fi - -if [ "$1" = "remove" -o "$1" = "purge" ]; then - rm -f /usr/share/apt-xapian-index/plugins/*.pyc -fi - -#DEBHELPER# - -exit 0 diff -Nru apt-xapian-index-0.51ubuntu1/debian/preinst apt-xapian-index-0.54ubuntu1/debian/preinst --- apt-xapian-index-0.51ubuntu1/debian/preinst 2020-03-08 15:15:54.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/preinst 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#!/bin/sh -e - -#DEBHELPER# - -dpkg-maintscript-helper rm_conffile /etc/dbus-1/system.d/org.debian.AptXapianIndex.conf 0.49ubuntu1~ apt-xapian-index -- "$@" -dpkg-maintscript-helper rm_conffile /etc/bash_completion.d/axi-cache 0.47+nmu2~ apt-xapian-index -- "$@" - -exit 0 diff -Nru apt-xapian-index-0.51ubuntu1/debian/rules apt-xapian-index-0.54ubuntu1/debian/rules --- apt-xapian-index-0.51ubuntu1/debian/rules 2020-03-27 10:48:30.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/debian/rules 2024-02-27 19:34:16.000000000 +0000 @@ -23,9 +23,9 @@ mv $(PFX)/usr/bin/update-apt-xapian-index \ $(PFX)/usr/sbin/update-apt-xapian-index # Install the plugins - install -o root -g root -m 755 -d $(PFX)/usr/share/apt-xapian-index/plugins - install -o root -g root -m 644 aliases/* $(PFX)/usr/share/apt-xapian-index/aliases/ - install -o root -g root -m 644 plugins/*.py $(PFX)/usr/share/apt-xapian-index/plugins/ + install -m 755 -d $(PFX)/usr/share/apt-xapian-index/plugins + install -m 644 aliases/* $(PFX)/usr/share/apt-xapian-index/aliases/ + install -m 644 plugins/*.py $(PFX)/usr/share/apt-xapian-index/plugins/ # Install bash completion dh_bash-completion diff -Nru apt-xapian-index-0.51ubuntu1/examples/aptxapianindex.py apt-xapian-index-0.54ubuntu1/examples/aptxapianindex.py --- apt-xapian-index-0.51ubuntu1/examples/aptxapianindex.py 2020-03-08 15:15:54.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/examples/aptxapianindex.py 2023-11-29 16:49:54.000000000 +0000 @@ -4,8 +4,6 @@ # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COPYING for more details. -from __future__ import print_function - import os, re import xapian diff -Nru apt-xapian-index-0.51ubuntu1/examples/axi-query-expand.py apt-xapian-index-0.54ubuntu1/examples/axi-query-expand.py --- apt-xapian-index-0.51ubuntu1/examples/axi-query-expand.py 2020-03-27 10:49:10.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/examples/axi-query-expand.py 2023-11-29 16:49:54.000000000 +0000 @@ -18,8 +18,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from __future__ import print_function - from optparse import OptionParser import sys diff -Nru apt-xapian-index-0.51ubuntu1/examples/axi-query-pkgtype.py apt-xapian-index-0.54ubuntu1/examples/axi-query-pkgtype.py --- apt-xapian-index-0.51ubuntu1/examples/axi-query-pkgtype.py 2020-03-27 10:49:10.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/examples/axi-query-pkgtype.py 2023-11-29 16:49:54.000000000 +0000 @@ -19,8 +19,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from __future__ import print_function - from optparse import OptionParser import sys diff -Nru apt-xapian-index-0.51ubuntu1/examples/axi-query-simple.py apt-xapian-index-0.54ubuntu1/examples/axi-query-simple.py --- apt-xapian-index-0.51ubuntu1/examples/axi-query-simple.py 2020-03-27 10:49:10.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/examples/axi-query-simple.py 2023-11-29 16:49:54.000000000 +0000 @@ -18,8 +18,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from __future__ import print_function - from optparse import OptionParser import sys diff -Nru apt-xapian-index-0.51ubuntu1/examples/axi-query-tags.py apt-xapian-index-0.54ubuntu1/examples/axi-query-tags.py --- apt-xapian-index-0.51ubuntu1/examples/axi-query-tags.py 2020-03-27 10:49:10.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/examples/axi-query-tags.py 2023-11-29 16:49:54.000000000 +0000 @@ -18,8 +18,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from __future__ import print_function - from optparse import OptionParser import sys diff -Nru apt-xapian-index-0.51ubuntu1/examples/axi-query.py apt-xapian-index-0.54ubuntu1/examples/axi-query.py --- apt-xapian-index-0.51ubuntu1/examples/axi-query.py 2020-03-27 10:49:10.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/examples/axi-query.py 2023-11-29 16:49:54.000000000 +0000 @@ -20,8 +20,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -from __future__ import print_function - from aptxapianindex import * from optparse import OptionParser import sys diff -Nru apt-xapian-index-0.51ubuntu1/examples/axi-searchcloud.py apt-xapian-index-0.54ubuntu1/examples/axi-searchcloud.py --- apt-xapian-index-0.51ubuntu1/examples/axi-searchcloud.py 2020-03-27 10:49:10.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/examples/axi-searchcloud.py 2023-11-29 16:49:54.000000000 +0000 @@ -73,7 +73,7 @@ def SimpleOrQuery(input_terms): """ Simple OR Query - + terms is an array of words """ @@ -194,7 +194,7 @@ w = gtk.Window() w.connect('destroy', gtk.main_quit) w.set_default_size(400, 400) - + self.model = gtk.ListStore(int, str, str) treeview = gtk.TreeView() @@ -210,17 +210,17 @@ column_name = gtk.TreeViewColumn ("Name", cell_name, text=1) column_name.set_sort_column_id(0) treeview.append_column(column_name) - + cell_desc = gtk.CellRendererText() column_desc = gtk.TreeViewColumn ("Name", cell_desc, text=2) column_desc.set_sort_column_id(0) treeview.append_column(column_desc) - - document = gtkhtml2.Document() - document.clear() - document.open_stream("text/html") - document.write_stream("Welcome, enter some text to start!") - document.close_stream() + + document = gtkhtml2.Document() + document.clear() + document.open_stream("text/html") + document.write_stream("Welcome, enter some text to start!") + document.close_stream() self.view = gtkhtml2.View() self.view.set_document(document) @@ -228,7 +228,7 @@ scrolledwin.show() scrolledwin.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) scrolledwin.add(treeview) - + vbox = gtk.VBox(False, 0) vbox.pack_start(scrolledwin, True, True, 0) vbox.pack_start(self.view, True, True, 0) @@ -241,16 +241,16 @@ w.show_all() gtk.main() - def on_entry_changed(self, widget, *args): + def on_entry_changed(self, widget, *args): packageslist, tags = SimpleOrQuery(widget.get_text().split()) - + self.model.clear() for item in packageslist: self.model.append(item) - + doc = mark_text_up(tags) doc.connect('link_clicked', self.on_link_clicked) - self.view.set_document(doc) + self.view.set_document(doc) def on_link_clicked(self, document, link): self.entry.set_text(link + " " + self.entry.get_text().lstrip()) diff -Nru apt-xapian-index-0.51ubuntu1/plugins/debtags.py apt-xapian-index-0.54ubuntu1/plugins/debtags.py --- apt-xapian-index-0.51ubuntu1/plugins/debtags.py 2020-03-08 15:15:55.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/plugins/debtags.py 2023-11-29 16:49:54.000000000 +0000 @@ -1,10 +1,9 @@ # Add debtags tags to the index -import re, os, os.path -try: - from debian import debtags -except ImportError: - from debian_bundle import debtags +import re +import os +import os.path +from debian import debtags DEBTAGSDB = os.environ.get("AXI_DEBTAGS_DB", "/var/lib/debtags/package-tags") @@ -14,7 +13,7 @@ Return general information about the plugin. The information returned is a dict with various keywords: - + timestamp (required) the last modified timestamp of this data source. This will be used to see if we need to update the database or not. A timestamp of 0 diff -Nru apt-xapian-index-0.51ubuntu1/plugins/translated-desc.py apt-xapian-index-0.54ubuntu1/plugins/translated-desc.py --- apt-xapian-index-0.51ubuntu1/plugins/translated-desc.py 2020-03-27 10:48:33.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/plugins/translated-desc.py 2023-11-29 16:49:54.000000000 +0000 @@ -7,12 +7,9 @@ import re import os import codecs -try: - from debian import deb822 -except ImportError: - from debian_bundle import deb822 +from debian import deb822 -from six.moves.urllib_parse import unquote +from urllib.parse import unquote APTLISTDIR="/var/lib/apt/lists" diff -Nru apt-xapian-index-0.51ubuntu1/runtests apt-xapian-index-0.54ubuntu1/runtests --- apt-xapian-index-0.51ubuntu1/runtests 2020-03-27 10:49:10.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/runtests 2023-11-29 16:49:54.000000000 +0000 @@ -8,13 +8,13 @@ --cov) echo "Run with code coverage..." shift - nosetests -w test --with-coverage --cover-package axi --cover-html --cover-html-dir=test-coverage "$@" + nose2-3 test --with-coverage --cover-package axi --cover-html --cover-html-dir=test-coverage "$@" echo "Coverage information found at file://`pwd`/test/test-coverage" ;; --clean) rm -rf test/test-coverage test/.coverage testdb ;; *) - python3 -m nose -w test "$@" + python3 -m nose2 test "$@" ;; esac diff -Nru apt-xapian-index-0.51ubuntu1/setup.py apt-xapian-index-0.54ubuntu1/setup.py --- apt-xapian-index-0.51ubuntu1/setup.py 2020-03-27 10:48:33.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/setup.py 2023-11-29 16:49:54.000000000 +0000 @@ -12,8 +12,8 @@ version=version, description='Xapian index of Debian packages', # long_description='' - author=['Enrico Zini'], - author_email=['enrico@debian.org'], + author='Enrico Zini', + author_email='enrico@debian.org', url='http://www.enricozini.org/sw/apt-xapian-index/', ## install_requires = [ ## "debian", "apt", "xapian", diff -Nru apt-xapian-index-0.51ubuntu1/test/test_indexer.py apt-xapian-index-0.54ubuntu1/test/test_indexer.py --- apt-xapian-index-0.51ubuntu1/test/test_indexer.py 2020-03-27 10:57:03.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/test/test_indexer.py 2024-02-28 10:29:59.000000000 +0000 @@ -1,29 +1,33 @@ # -*- coding: utf-8 -*- +from __future__ import annotations + +import shutil +import subprocess import unittest import os +from typing import Iterator + import axi import axi.indexer -import shutil -import subprocess import tools def smallcache(pkglist=["apt", "libept-dev", "gedit"]): - class sc(object): - def __init__(self, cache): + class sc: + def __init__(self, cache) -> None: self._pkgs = pkglist self._cache = cache - def has_key(self, name): + def has_key(self, name: str) -> bool: return name in self._pkgs - def __len__(self): + def __len__(self) -> int: return len(self._pkgs) - def __iter__(self): + def __iter__(self) -> Iterator[str]: for p in self._pkgs: yield self._cache[p] - def __getitem__(self, name): + def __getitem__(self, name: str): if name not in self._pkgs: raise KeyError("`%s' not in wrapped cache" % name) return self._cache[name] @@ -31,19 +35,22 @@ return sc class TestIndexer(tools.AxiTestBase): - def setUp(self): + indexer: axi.indexer.Indexer | None + + def setUp(self) -> None: # Remove the text index if it exists if os.path.exists(axi.XAPIANDBPATH): shutil.rmtree(axi.XAPIANDBPATH) # Prepare a quiet indexer progress = axi.indexer.SilentProgress() self.indexer = axi.indexer.Indexer(progress, True) - def tearDown(self): + def tearDown(self) -> None: # Explicitly set indexer to none, otherwise in the next setUp we rmtree # testdb before the indexer had a chance to delete its lock self.indexer = None - def testAptRebuild(self): + def testAptRebuild(self) -> None: + assert self.indexer self.indexer._test_wrap_apt_cache(smallcache()) # No other indexers are running, ensure lock succeeds @@ -61,7 +68,8 @@ # Ensure that we have an index self.assertCleanIndex() - def testDeb822Rebuild(self): + def testDeb822Rebuild(self) -> None: + assert self.indexer pkgfile = os.path.join(axi.XAPIANDBPATH, "packages") subprocess.check_call("apt-cache show apt libept-dev gedit > " + pkgfile, shell=True) @@ -80,7 +88,9 @@ # Ensure that we have an index self.assertCleanIndex() - def testIncrementalRebuild(self): + def testIncrementalRebuild(self) -> None: + assert self.indexer + pre_indexer: axi.indexer.Indexer | None # Perform the initial indexing progress = axi.indexer.SilentProgress() pre_indexer = axi.indexer.Indexer(progress, True) @@ -117,7 +127,8 @@ # Ensure that we did not create a new index self.assertEqual(open(axi.XAPIANINDEX).read(), curidx) - def testIncrementalRebuildFromEmpty(self): + def testIncrementalRebuildFromEmpty(self) -> None: + assert self.indexer # Prepare an incremental update self.indexer._test_wrap_apt_cache(smallcache()) @@ -172,7 +183,7 @@ # # # def test_cookie(self): -# """ Environ: COOKIES """ +# """ Environ: COOKIES """ # t = dict() # t['a=a'] = {'a': 'a'} # t['a=a; b=b'] = {'a': 'a', 'b':'b'} @@ -182,7 +193,7 @@ # self.assertEqual(v, request.COOKIES) # # def test_get(self): -# """ Environ: GET data """ +# """ Environ: GET data """ # e = {} # e['QUERY_STRING'] = 'a=a&a=1&b=b&c=c' # request.bind(e, None) @@ -192,9 +203,9 @@ # self.assertEqual(['b'], request.GET.getall('b')) # self.assertEqual('1', request.GET['a']) # self.assertEqual('b', request.GET['b']) -# +# # def test_post(self): -# """ Environ: POST data """ +# """ Environ: POST data """ # sq = u'a=a&a=1&b=b&c=c'.encode('utf8') # e = {} # wsgiref.util.setup_testing_defaults(e) @@ -211,7 +222,7 @@ # self.assertEqual('b', request.POST['b']) # # def test_params(self): -# """ Environ: GET and POST are combined in request.param """ +# """ Environ: GET and POST are combined in request.param """ # e = {} # wsgiref.util.setup_testing_defaults(e) # e['wsgi.input'].write(tob('b=b&c=p')) @@ -224,7 +235,7 @@ # self.assertEqual('p', request.params['c']) # # def test_getpostleak(self): -# """ Environ: GET and POST sh0uld not leak into each other """ +# """ Environ: GET and POST should not leak into each other """ # e = {} # wsgiref.util.setup_testing_defaults(e) # e['wsgi.input'].write(u'b=b'.encode('utf8')) @@ -237,7 +248,7 @@ # self.assertEqual(['b'], request.POST.keys()) # # def test_body(self): -# """ Environ: Request.body should behave like a file object factory """ +# """ Environ: Request.body should behave like a file object factory """ # e = {} # wsgiref.util.setup_testing_defaults(e) # e['wsgi.input'].write(u'abc'.encode('utf8')) @@ -257,7 +268,7 @@ # e['wsgi.input'].seek(0) # e['CONTENT_LENGTH'] = str(1024*1000) # request.bind(e, None) -# self.assertTrue(hasattr(request.body, 'fileno')) +# self.assertTrue(hasattr(request.body, 'fileno')) # self.assertEqual(1024*1000, len(request.body.read())) # self.assertEqual(1024, len(request.body.read(1024))) # self.assertEqual(1024*1000, len(request.body.readline())) diff -Nru apt-xapian-index-0.51ubuntu1/test/tools.py apt-xapian-index-0.54ubuntu1/test/tools.py --- apt-xapian-index-0.51ubuntu1/test/tools.py 2020-03-08 15:15:55.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/test/tools.py 2023-11-29 16:49:54.000000000 +0000 @@ -1,16 +1,19 @@ # -*- coding: utf-8 -*- +from __future__ import annotations + import unittest import axi import axi.indexer import os.path class AxiTestBase(unittest.TestCase): - def assertCleanIndex(self): + def assertCleanIndex(self) -> None: self.assert_(os.path.exists(axi.XAPIANINDEX)) self.assert_(os.path.exists(axi.XAPIANDBSTAMP)) self.assert_(os.path.exists(axi.XAPIANDBVALUES)) self.assert_(os.path.exists(axi.XAPIANDBDOC)) self.assert_(not os.path.exists(axi.XAPIANDBUPDATESOCK)) + indexer: axi.indexer.Indexer | None # Index is clean and up to date: an indexer should tell us that it does # not need to run diff -Nru apt-xapian-index-0.51ubuntu1/tests/dbus-update-apt-xapian-index.py apt-xapian-index-0.54ubuntu1/tests/dbus-update-apt-xapian-index.py --- apt-xapian-index-0.51ubuntu1/tests/dbus-update-apt-xapian-index.py 2020-03-27 10:57:03.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/tests/dbus-update-apt-xapian-index.py 2024-02-28 10:29:59.000000000 +0000 @@ -1,7 +1,5 @@ #!/usr/bin/python3 -from __future__ import print_function - import dbus import os import glib diff -Nru apt-xapian-index-0.51ubuntu1/tox.ini apt-xapian-index-0.54ubuntu1/tox.ini --- apt-xapian-index-0.51ubuntu1/tox.ini 2020-03-27 10:48:33.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/tox.ini 2023-11-29 16:49:54.000000000 +0000 @@ -12,5 +12,5 @@ AXI_CACHE_PATH={toxinidir}/testdb PYTHONPATH="$PYTHONPATH:{toxinidir}" commands = - nocov: python3 -m nose -w test - cov: python3 -m nose -w test --with-coverage --cover-package axi --cover-html --cover-html-dir=test-coverage-{envname} + nocov: python3 -m nose2 -w test + cov: python3 -m nose2 -w test --with-coverage --cover-package axi --cover-html --cover-html-dir=test-coverage-{envname} diff -Nru apt-xapian-index-0.51ubuntu1/update-apt-xapian-index apt-xapian-index-0.54ubuntu1/update-apt-xapian-index --- apt-xapian-index-0.51ubuntu1/update-apt-xapian-index 2020-03-27 10:57:03.000000000 +0000 +++ apt-xapian-index-0.54ubuntu1/update-apt-xapian-index 2024-02-28 10:29:59.000000000 +0000 @@ -22,8 +22,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -from __future__ import print_function - # # Main program body #