command-not-found-20.04.2/0000775000000000000000000000000013642704232012077 5ustar command-not-found-20.04.2/COPYING0000777000000000000000000000000013546652345020730 2/usr/share/common-licenses/GPL-2ustar command-not-found-20.04.2/CommandNotFound/0000775000000000000000000000000013642704224015133 5ustar command-not-found-20.04.2/CommandNotFound/CommandNotFound.py0000664000000000000000000003767013642704164020560 0ustar # (c) Zygmunt Krynicki 2005, 2006, 2007, 2008 # Licensed under GPL, see COPYING for the whole text from __future__ import ( print_function, absolute_import, ) import gettext import grp import json import logging import os import os.path import posix import sys import subprocess from CommandNotFound.db.db import SqliteDatabase if sys.version >= "3": _gettext_method = "gettext" else: _gettext_method = "ugettext" _ = getattr(gettext.translation("command-not-found", fallback=True), _gettext_method) def similar_words(word): """ return a set with spelling1 distance alternative spellings based on http://norvig.com/spell-correct.html """ alphabet = 'abcdefghijklmnopqrstuvwxyz-_0123456789' s = [(word[:i], word[i:]) for i in range(len(word) + 1)] deletes = [a + b[1:] for a, b in s if b] transposes = [a + b[1] + b[0] + b[2:] for a, b in s if len(b) > 1] replaces = [a + c + b[1:] for a, b in s for c in alphabet if b] inserts = [a + c + b for a, b in s for c in alphabet] return set(deletes + transposes + replaces + inserts) def user_can_sudo(): try: groups = posix.getgroups() return (grp.getgrnam("sudo")[2] in groups or grp.getgrnam("admin")[2] in groups) except KeyError: return False # the new style DB - if that exists we skip the legacy DB dbpath = "/var/lib/command-not-found/commands.db" class CommandNotFound(object): programs_dir = "programs.d" max_len = 256 prefixes = ( "/snap/bin", "/bin", "/usr/bin", "/usr/local/bin", "/sbin", "/usr/sbin", "/usr/local/sbin", "/usr/games") snap_cmd = "/usr/bin/snap" output_fd = sys.stderr def __init__(self, data_dir="/usr/share/command-not-found"): self.sources_list = self._getSourcesList() # a new style DB means we can skip loading the old legacy static DB if os.path.exists(dbpath): self.db = SqliteDatabase(dbpath) else: raise FileNotFoundError("Cannot find database") self.user_can_sudo = user_can_sudo() self.euid = posix.geteuid() def spelling_suggestions(self, word, min_len=3): """ try to correct the spelling """ possible_alternatives = [] if not (min_len <= len(word) <= self.max_len): return possible_alternatives for w in similar_words(word): packages = self.get_packages(w) for (package, ver, comp) in packages: possible_alternatives.append((w, package, comp, ver)) return possible_alternatives def get_packages(self, command): return self.db.lookup(command) def get_snaps(self, command): exact_result = [] mispell_result = [] if not os.path.exists(self.snap_cmd): logging.debug("%s not exists" % self.snap_cmd) return [], [] try: with open(os.devnull) as devnull: output = subprocess.check_output( [self.snap_cmd, "advise-snap", "--format=json", "--command", command], stderr=devnull, universal_newlines=True) except subprocess.CalledProcessError as e: logging.debug("calling snap advice-snap returned an error: %s" % e) return [], [] logging.debug("got %s from snap advise-snap" % output) try: snaps = json.loads(output) except json.JSONDecodeError as e: logging.debug("cannot decoding json: %s" % e) return [], [] for snap in snaps: if snap["Command"] == command: exact_result.append((snap["Snap"], snap["Command"], snap.get("Version"))) else: mispell_result.append((snap["Command"], snap["Snap"], snap.get("Version"))) return exact_result, mispell_result def getBlacklist(self): try: with open(os.sep.join((os.getenv("HOME", "/root"), ".command-not-found.blacklist"))) as blacklist: return [line.strip() for line in blacklist if line.strip() != ""] except IOError: return [] def _getSourcesList(self): try: import apt_pkg from aptsources.sourceslist import SourcesList apt_pkg.init() except (SystemError, ImportError): return [] sources_list = set([]) # The matcher parses info files from # /usr/share/python-apt/templates/ # But we don't use the calculated data, skip it for source in SourcesList(withMatcher=False): if not source.disabled and not source.invalid: for component in source.comps: sources_list.add(component) return sources_list def install_prompt(self, package_name): if not "COMMAND_NOT_FOUND_INSTALL_PROMPT" in os.environ: return if package_name: prompt = _("Do you want to install it? (N/y)") if sys.version >= '3': answer = input(prompt) raw_input = lambda x: x # pyflakes else: answer = raw_input(prompt) if sys.stdin.encoding and isinstance(answer, str): # Decode the answer so that we get an unicode value answer = answer.decode(sys.stdin.encoding) if answer.lower() == _("y"): if self.euid == 0: command_prefix = "" else: command_prefix = "sudo " install_command = "%sapt install %s" % (command_prefix, package_name) print("%s" % install_command, file=sys.stdout) subprocess.call(install_command.split(), shell=False) def print_spelling_suggestions(self, word, mispell_packages, mispell_snaps, max_alt=15): """ print spelling suggestions for packages and snaps """ if len(mispell_packages)+len(mispell_snaps) > max_alt: print("", file=self.output_fd) print(_("Command '%s' not found, but there are %s similar ones.") % (word, len(mispell_packages)), file=self.output_fd) print("", file=self.output_fd) self.output_fd.flush() return elif len(mispell_packages)+len(mispell_snaps) > 0: print("", file=self.output_fd) print(_("Command '%s' not found, did you mean:") % word, file=self.output_fd) print("", file=self.output_fd) for (command, snap, ver) in mispell_snaps: if ver: ver = " (%s)" % ver else: ver = "" print(_(" command '%s' from snap %s%s") % (command, snap, ver), file=self.output_fd) for (command, package, comp, ver) in mispell_packages: if ver: ver = " (%s)" % ver else: ver = "" print(_(" command '%s' from deb %s%s") % (command, package, ver), file=self.output_fd) print("", file=self.output_fd) if len(mispell_snaps) > 0: print(_("See 'snap info ' for additional versions."), file=self.output_fd) elif len(mispell_packages) > 0: if self.user_can_sudo: print(_("Try: %s ") % "sudo apt install", file=self.output_fd) else: print(_("Try: %s ") % "apt install", file=self.output_fd) print("", file=self.output_fd) self.output_fd.flush() def _print_exact_header(self, command): print(file=self.output_fd) print(_("Command '%(command)s' not found, but can be installed with:") % { 'command': command}, file=self.output_fd) print(file=self.output_fd) def advice_single_snap_package(self, command, packages, snaps): self._print_exact_header(command) snap = snaps[0] if self.euid == 0: print("snap install %s" % snap[0], file=self.output_fd) elif self.user_can_sudo: print("sudo snap install %s" % snap[0], file=self.output_fd) else: print("snap install %s" % snap[0], file=self.output_fd) print(_("Please ask your administrator.")) print("", file=self.output_fd) self.output_fd.flush() def advice_single_deb_package(self, command, packages, snaps): self._print_exact_header(command) if self.euid == 0: print("apt install %s" % packages[0][0], file=self.output_fd) self.install_prompt(packages[0][0]) elif self.user_can_sudo: print("sudo apt install %s" % packages[0][0], file=self.output_fd) self.install_prompt(packages[0][0]) else: print("apt install %s" % packages[0][0], file=self.output_fd) print(_("Please ask your administrator.")) if not packages[0][2] in self.sources_list: print(_("You will have to enable the component called '%s'") % packages[0][2], file=self.output_fd) print("", file=self.output_fd) self.output_fd.flush() def sudo(self): if self.euid != 0 and self.user_can_sudo: return "sudo " return "" def advice_multi_deb_package(self, command, packages, snaps): self._print_exact_header(command) pad = max([len(s[0]) for s in snaps+packages]) for i, package in enumerate(packages): ver = "" if package[1]: if i == 0 and len(package) > 1: ver = " # version %s, or" % (package[1]) else: ver = " # version %s" % (package[1]) if package[2] in self.sources_list: print("%sapt install %-*s%s" % (self.sudo(), pad, package[0], ver), file=self.output_fd) else: print("%sapt install %-*s%s" % (self.sudo(), pad, package[0], ver) + " (" + _("You will have to enable component called '%s'") % package[2] + ")", file=self.output_fd) if self.euid != 0 and not self.user_can_sudo: print("", file=self.output_fd) print(_("Ask your administrator to install one of them."), file=self.output_fd) print("", file=self.output_fd) self.output_fd.flush() def advice_multi_snap_packages(self, command, packages, snaps): self._print_exact_header(command) pad = max([len(s[0]) for s in snaps+packages]) for i, snap in enumerate(snaps): ver = "" if snap[2]: if i == 0 and len(snaps) > 0: ver = " # version %s, or" % snap[2] else: ver = " # version %s" % snap[2] print("%ssnap install %-*s%s" % (self.sudo(), pad, snap[0], ver), file=self.output_fd) print("", file=self.output_fd) print(_("See 'snap info ' for additional versions."), file=self.output_fd) print("", file=self.output_fd) self.output_fd.flush() def advice_multi_mixed_packages(self, command, packages, snaps): self._print_exact_header(command) pad = max([len(s[0]) for s in snaps+packages]) for i, snap in enumerate(snaps): ver="" if snap[2]: if i == 0: ver = " # version %s, or" % snap[2] else: ver = " # version %s" % snap[2] print("%ssnap install %-*s%s" % (self.sudo(), pad, snap[0], ver), file=self.output_fd) for package in packages: ver="" if package[1]: ver = " # version %s" % package[1] print("%sapt install %-*s%s" % (self.sudo(), pad, package[0], ver), file=self.output_fd) print("", file=self.output_fd) if len(snaps) == 1: print(_("See 'snap info %s' for additional versions.") % snaps[0][0], file=self.output_fd) else: print(_("See 'snap info ' for additional versions."), file=self.output_fd) print("", file=self.output_fd) self.output_fd.flush() def advise(self, command, ignore_installed=False): " give advice where to find the given command to stderr " def _in_prefix(prefix, command): " helper that returns if a command is found in the given prefix " return (os.path.exists(os.path.join(prefix, command)) and not os.path.isdir(os.path.join(prefix, command))) if len(command) > self.max_len: return False if command.startswith("/"): if os.path.exists(command): prefixes = [os.path.dirname(command)] else: prefixes = [] else: prefixes = [prefix for prefix in self.prefixes if _in_prefix(prefix, command)] # check if we have it in a common prefix that may not be in the PATH if prefixes and not ignore_installed: if len(prefixes) == 1: print(_("Command '%(command)s' is available in '%(place)s'") % {"command": command, "place": os.path.join(prefixes[0], command)}, file=self.output_fd) else: print(_("Command '%(command)s' is available in the following places") % {"command": command}, file=self.output_fd) for prefix in prefixes: print(" * %s" % os.path.join(prefix, command), file=self.output_fd) missing = list(set(prefixes) - set(os.getenv("PATH", "").split(":"))) if len(missing) > 0: print(_("The command could not be located because '%s' is not included in the PATH environment variable.") % ":".join(missing), file=self.output_fd) if "sbin" in ":".join(missing): print(_("This is most likely caused by the lack of administrative privileges associated with your user account."), file=self.output_fd) return False # do not give advice if we are in a situation where apt # or aptitude are not available (LP: #394843) if not (os.path.exists("/usr/bin/apt") or os.path.exists("/usr/bin/aptitude")): return False if command in self.getBlacklist(): return False # python is special, on 20.04 and newer we should encourage # people to use python3 only, and command-not-found depends on # python3, so must be available if command == "python": print("") print(_("Command '%s' not found, did you mean:") % command, file=self.output_fd) print("") print(_(" command '%s' from deb %s%s") % ("python3", "python3", ""), file=self.output_fd) print(_(" command '%s' from deb %s%s") % ("python", "python-is-python3", ""), file=self.output_fd) print("") return True packages = self.get_packages(command) snaps, mispell_snaps = self.get_snaps(command) logging.debug("got debs: %s snaps: %s" % (packages, snaps)) if len(packages) == 0 and len(snaps) == 0: mispell_packages = self.spelling_suggestions(command) if len(mispell_packages) > 0 or len(mispell_snaps) > 0: self.print_spelling_suggestions(command, mispell_packages, mispell_snaps) elif len(packages) == 0 and len(snaps) == 1: self.advice_single_snap_package(command, packages, snaps) elif len(snaps) > 0 and len(packages) == 0: self.advice_multi_snap_packages(command, packages, snaps) elif len(packages) == 1 and len(snaps) == 0: self.advice_single_deb_package(command, packages, snaps) elif len(packages) > 1 and len(snaps) == 0: self.advice_multi_deb_package(command, packages, snaps) elif len(packages) > 0 and len(snaps) > 0: self.advice_multi_mixed_packages(command, packages, snaps) return (len(packages) > 0 or len(snaps) > 0 or len(mispell_snaps) > 0 or len(mispell_packages) > 0) command-not-found-20.04.2/CommandNotFound/__init__.py0000664000000000000000000000005013546652345017250 0ustar from __future__ import absolute_import command-not-found-20.04.2/CommandNotFound/db/0000775000000000000000000000000013546652345015531 5ustar command-not-found-20.04.2/CommandNotFound/db/__init__.py0000664000000000000000000000004713546652345017643 0ustar from __future__ import absolute_import command-not-found-20.04.2/CommandNotFound/db/creator.py0000775000000000000000000002074713546652345017557 0ustar #!/usr/bin/python3 import errno import json import logging import os import sqlite3 import sys import time import apt_pkg apt_pkg.init() # TODO: # - add apt.conf.d snippet for download handling # - add apt::update::post-invoke-success handler component_priorities = { 'main': 120, 'universe': 100, 'contrib': 80, 'restricted': 60, 'non-free': 40, 'multiverse': 20, } # pkgnames in here are blacklisted create_db_sql=""" CREATE TABLE IF NOT EXISTS "commands" ( [cmdID] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, [pkgID] INTEGER NOT NULL, [command] TEXT, FOREIGN KEY ([pkgID]) REFERENCES "pkgs" ([pkgID]) ); CREATE TABLE IF NOT EXISTS "packages" ( [pkgID] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, [name] TEXT, [version] TEXT, [component] TEXT, [priority] INTEGER ); CREATE INDEX IF NOT EXISTS idx_commands_command ON commands (command); CREATE INDEX IF NOT EXISTS idx_packages_name ON packages (name); """ # FIXME: # - add support for foreign arch in DB (add foreign commands if there # is not native command) # - addd support for -backports: pkgname must be appended with /backports # and only be shown if there is no other command available # - do not re-create the DB everytime, only if sources.list changed # - add "last-mtime" into the DB, then we can skip all packages files # where the mtime is older and we only need to update the DB class measure: def __init__(self, what, stats): self.what = what self.stats = stats def __enter__(self): self.now = time.time() def __exit__(self, *args): if not self.what in self.stats: self.stats[self.what] = 0 self.stats[self.what] += time.time() - self.now def rm_f(path): try: os.remove(path) except OSError as e: if e.errno != errno.ENOENT: raise class DbCreator: def __init__(self, files): self.files = files self.primary_arch = apt_pkg.get_architectures()[0] self.stats = {"total": 0,"total_time": time.time()} def create(self, dbname): metadata_file = dbname+".metadata" if not self._db_update_needed(metadata_file): logging.info( "%s does not require an update (inputs unchanged)", dbname) return tmpdb = dbname+".tmp" with sqlite3.connect(tmpdb) as con: con.executescript(create_db_sql) self._fill_commands(con) # remove now stale metadata rm_f(metadata_file) # put database in place os.rename(tmpdb, dbname) # add new metadata with open(metadata_file, "w") as fp: json.dump(self._calc_input_metadata(), fp) def _db_update_needed(self, metadata_file): if not os.path.exists(metadata_file): return True try: with open(metadata_file) as fp: meta = json.load(fp) return meta != self._calc_input_metadata() except Exception as e: logging.warning("cannot read %s: %s", metadata_file, e) return True def _calc_input_metadata(self): meta = {} for p in self.files: st = os.stat(p) meta[p] = { 'st_ino': st.st_ino, 'st_dev': st.st_dev, 'st_uid': st.st_uid, 'st_gid': st.st_gid, 'st_size': st.st_size, 'st_mtime': st.st_mtime, } return meta def _fill_commands(self, con): for f in self.files: with open(f) as fp: self._parse_single_commands_file(con, fp) self.stats["total_time"] = time.time() - self.stats["total_time"] logging.info("processed %i packages in %.2fs" % ( self.stats["total"], self.stats["total_time"])) def _in_db(self, con, command, pkgname): already_in_db = con.execute( """ SELECT packages.pkgID, name, version FROM commands INNER JOIN packages on packages.pkgID = commands.pkgID WHERE commands.command=? AND packages.name=?; """, (command, pkgname)).fetchone() return already_in_db def _delete_pkgid(self, con, pkgid): con.execute("DELETE FROM packages WHERE pkgID=?", (pkgid,) ) con.execute("DELETE FROM commands WHERE pkgID=?", (pkgid,) ) def _get_pkgid(self, con, pkgname): have_pkg = con.execute( "SELECT pkgID from packages WHERE name=?", (pkgname,)).fetchone() if have_pkg: return have_pkg[0] return None def _insert_package(self, con, pkgname, version, component, priority): cur=con.execute(""" INSERT INTO packages (name, version, component, priority) VALUES (?, ?, ?, ?); """, (pkgname, version, component, priority)) return cur.lastrowid def _insert_command(self, con, command, pkg_id): con.execute(""" INSERT INTO commands (command, pkgID) VALUES (?, ?); """, (command, pkg_id)) def _parse_single_commands_file(self, con, fp): tagf = apt_pkg.TagFile(fp) # file empty if not tagf.step(): return # read header suite=tagf.section["suite"] # FIXME: support backports if suite.endswith("-backports"): return component=tagf.section["component"] arch=tagf.section["arch"] # FIXME: add code for secondary arch handling! if arch != "all" and arch != self.primary_arch: return # step over the pkgs while tagf.step(): self.stats["total"] += 1 pkgname=tagf.section["name"] # allow to override the viisble pkgname to accomodate for # cases like "python2.7" which is part of python2.7-minimal # but users should just install python2.7 if tagf.section.get("visible-pkgname"): pkgname = tagf.section["visible-pkgname"] version=tagf.section.get("version", "") ignore_commands=set() if tagf.section.get("ignore-commands", ""): ignore_commands=set(tagf.section.get("ignore-commands", "").split(",")) for command in tagf.section["commands"].split(","): if command in ignore_commands: continue # see if we have the command already with measure("sql_already_db", self.stats): already_in_db=self._in_db(con, command, pkgname) if already_in_db: # we found a version that is higher what we have # in the DB -> remove current, insert higher if apt_pkg.version_compare(version, already_in_db[2]) > 0: logging.debug("replacing exiting %s in DB (higher version)" % command) with measure("sql_delete_already_in_db", self.stats): self._delete_pkgid(con, already_in_db[0]) else: logging.debug("skipping %s from %s (lower/same version)" % (command, suite)) continue logging.debug("adding %s from %s/%s (%s)" % ( command, pkgname, version, suite)) # insert new data with measure("sql_have_pkg", self.stats): pkg_id = self._get_pkgid(con, pkgname) if not pkg_id: priority = component_priorities[component] priority += int(tagf.section.get("priority-bonus", "0")) with measure("sql_insert_pkg", self.stats): pkg_id = self._insert_package(con, pkgname, version, component, priority) with measure("sql_insert_cmd", self.stats): self._insert_command(con, command, pkg_id) if __name__ == "__main__": logging.basicConfig(level=logging.INFO) if len(sys.argv) < 3: print("usage: %s " % sys.argv[0]) print(" e.g.: %s commands.db ./dists/*/*/*/Commands-*" % sys.argv[0]) print(" e.g.: %s /var/lib/command-not-found/commands.db /var/lib/apt/lists/*Commands-*", sys.argv[0]) sys.exit(1) col = DbCreator(sys.argv[2:]) col.create(sys.argv[1]) for stat, amount in col.stats.items(): logging.debug("%s: %s" % (stat, amount)) command-not-found-20.04.2/CommandNotFound/db/db.py0000664000000000000000000000154413546652345016474 0ustar #!/usr/bin/python3 import sqlite3 import apt_pkg apt_pkg.init() class SqliteDatabase(object): def __init__(self, filename): self.con = sqlite3.connect(filename) self.component = "" def lookup(self, command): # deal with invalid unicode (LP: #1130444) command = command.encode("utf-8", "surrogateescape").decode("utf-8", "replace") results = [] for row in self.con.execute( """ SELECT packages.name, packages.version, packages.component FROM commands INNER JOIN packages on packages.pkgID = commands.pkgID WHERE commands.command=? ORDER BY packages.priority DESC """, (command,)).fetchall(): results.append( (row[0], row[1], row[2]) ) return results command-not-found-20.04.2/CommandNotFound/db/tests/0000775000000000000000000000000013546652345016673 5ustar command-not-found-20.04.2/CommandNotFound/db/tests/__init__.py0000664000000000000000000000000013546652345020772 0ustar command-not-found-20.04.2/CommandNotFound/db/tests/data/0000775000000000000000000000000013546652345017604 5ustar command-not-found-20.04.2/CommandNotFound/db/tests/data/var/0000775000000000000000000000000013546652345020374 5ustar command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/0000775000000000000000000000000013546652345021142 5ustar command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/apt/0000775000000000000000000000000013546652345021726 5ustar command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/apt/lists/0000775000000000000000000000000013546652345023064 5ustar ././@LongLink0000644000000000000000000000022500000000000007772 Lustar command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_artful-proposed_main_cnf_Commands-amd64command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/apt/lists/de.archive.ubuntu.com_ubun0000664000000000000000000000076313546652345030154 0ustar suite: bionic-proposed component: main arch: amd64 name: autopoint version: 0.19.8.1-4ubuntu3 commands: autopoint name: bc version: 1.07.1-1 commands: bc name: bcrelay version: 1.4.0-11build1 commands: bcrelay name: bsdutils version: 1:2.30.2-0.1ubuntu3 commands: script,wall,scriptreplay,renice,logger name: btrfs-progs version: 4.15.1-1 commands: btrfs-find-root,btrfs-image,btrfs-zero-log,btrfs-debug-tree,btrfs,fsck.btrfs,btrfstune,btrfsck,mkfs.btrfs,btrfs-select-super,btrfs-map-logical ././@LongLink0000644000000000000000000000022400000000000007771 Lustar command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_artful-proposed_main_cnf_Commands-i386command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/apt/lists/de.archive.ubuntu.com_ubun0000664000000000000000000000076213546652345030153 0ustar suite: bionic-proposed component: main arch: i386 name: autopoint version: 0.19.8.1-4ubuntu3 commands: autopoint name: bc version: 1.07.1-1 commands: bc name: bcrelay version: 1.4.0-11build1 commands: bcrelay name: bsdutils version: 1:2.30.2-0.1ubuntu3 commands: renice,script,wall,scriptreplay,logger name: btrfs-progs version: 4.15.1-1 commands: btrfs-select-super,btrfs-zero-log,btrfsck,btrfs-find-root,fsck.btrfs,btrfs-image,btrfs,mkfs.btrfs,btrfs-map-logical,btrfstune,btrfs-debug-tree ././@LongLink0000644000000000000000000000021400000000000007770 Lustar command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_artful_main_cnf_Commands-amd64command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/apt/lists/de.archive.ubuntu.com_ubun0000664000000000000000000000041313546652345030144 0ustar suite: bionic component: main arch: amd64 name: autopoint version: 0.19.8.1-4ubuntu2 commands: autopoint name: autotools-dev version: 20180224.1 commands: dh_autotools-dev_restoreconfig,dh_autotools-dev_updateconfig name: bc version: 1.06.95-9build2 commands: bc ././@LongLink0000644000000000000000000000021300000000000007767 Lustar command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/apt/lists/de.archive.ubuntu.com_ubuntu_dists_artful_main_cnf_Commands-i386command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/apt/lists/de.archive.ubuntu.com_ubun0000664000000000000000000000105213546652345030144 0ustar suite: bionic component: main arch: i386 name: autopkgtest version: 5.1 commands: autopkgtest,autopkgtest-build-lxc,autopkgtest-build-lxd,autopkgtest-buildvm-ubuntu-cloud,autopkgtest-virt-chroot,autopkgtest-virt-lxc,autopkgtest-virt-lxd,autopkgtest-virt-null,autopkgtest-virt-qemu,autopkgtest-virt-schroot,autopkgtest-virt-ssh name: autopoint version: 0.19.8.1-4ubuntu2 commands: autopoint name: autotools-dev version: 20180224.1 commands: dh_autotools-dev_restoreconfig,dh_autotools-dev_updateconfig name: bc version: 1.06.95-9build2 commands: bc command-not-found-20.04.2/CommandNotFound/db/tests/data/var/lib/apt/lists/zzz_Commands-amd640000664000000000000000000000025213546652345026375 0ustar suite: bionic-newer component: main arch: amd64 name: autopoint version: 99:0.19.8.1-4ubuntu2 commands: autopoint name: autopoint-tng version: 1.0 commands: autopoint command-not-found-20.04.2/CommandNotFound/db/tests/test_db.py0000664000000000000000000001654213546652345020701 0ustar #!/usr/bin/python import os import shutil import tempfile import unittest import logging logging.basicConfig(level=logging.DEBUG) from CommandNotFound.db.creator import DbCreator from CommandNotFound.db.db import SqliteDatabase mock_commands_bionic_backports = """suite: bionic-backports component: main arch: all name: bsdutils version: 99.0 commands: script,wall,new-stuff-only-in-backports """ mock_commands_bionic_proposed = """suite: bionic-proposed component: main arch: all name: bsdutils version: 2.0 commands: script,wall """ mock_commands_bionic = """suite: bionic component: main arch: all name: bsdutils version: 1.0 commands: script,wall,removed-in-version-2.0 name: bzr1 version: 1.0 commands: bzr name: bzr2 version: 2.7 commands: bzr name: aaa-openjre-7 version: 7 commands: java name: default-jre version: 8 priority-bonus: 5 commands: java name: python2.7-minimal visible-pkgname: python2.7 version: 2.7 commands: python2.7 name: foo version: 3.0 commands: foo-cmd,ignore-me ignore-commands: ignore-me """ mock_commands_bionic_universe = """suite: bionic component: universe arch: all name: bzr-tng version: 3.0 commands: bzr """ class DbTestCase(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree(self.tmpdir) def make_mock_commands_file(self, suite, content): path = os.path.join(self.tmpdir, "var", "lib", "apt", "lists", "archive.ubuntu.com_ubuntu_dists_%s_Commands-all" % suite) try: os.makedirs(os.path.dirname(path)) except OSError: pass with open(path, "w") as fp: fp.write(content) return path def test_create_trivial_db(self): mock_commands_file = self.make_mock_commands_file( "bionic_main", mock_commands_bionic) cre = DbCreator([mock_commands_file]) dbpath = os.path.join(self.tmpdir, "test.db") cre.create(dbpath) # validate content db = SqliteDatabase(dbpath) self.assertEqual( db.lookup("wall"), [("bsdutils", "1.0", "main")]) self.assertEqual( db.lookup("removed-in-version-2.0"), [("bsdutils", "1.0", "main")]) def test_create_multiple_dbs(self): mock_commands_1 = self.make_mock_commands_file( "bionic_main", mock_commands_bionic) mock_commands_2 = self.make_mock_commands_file( "bionic-proposed_main", mock_commands_bionic_proposed) cre = DbCreator([mock_commands_1, mock_commands_2]) dbpath = os.path.join(self.tmpdir, "test.db") cre.create(dbpath) # validate content db = SqliteDatabase(dbpath) # newer version 2.0 ovrride older version 1.0 self.assertEqual( db.lookup("wall"), [("bsdutils", "2.0", "main")]) # binaries from older versions do not linger around self.assertEqual( db.lookup("removed-in-version-2.0"), []) # versions only from a single file are available self.assertEqual( db.lookup("bzr"), [ ("bzr1", "1.0", "main"), ("bzr2", "2.7", "main"), ]) def test_create_backports_excluded_dbs(self): mock_commands_1 = self.make_mock_commands_file( "bionic_main", mock_commands_bionic) mock_commands_2 = self.make_mock_commands_file( "bionic-backports_main", mock_commands_bionic_backports) cre = DbCreator([mock_commands_1, mock_commands_2]) dbpath = os.path.join(self.tmpdir, "test.db") cre.create(dbpath) # validate content db = SqliteDatabase(dbpath) self.assertEqual( db.lookup("wall"), [("bsdutils", "1.0", "main")]) self.assertEqual( db.lookup("new-stuff-only-in-backports"), []) def test_create_no_versions_does_not_crash(self): mock_commands = self.make_mock_commands_file( "bionic_main", mock_commands_bionic.replace("version: 1.0\n", "")) cre = DbCreator([mock_commands]) dbpath = os.path.join(self.tmpdir, "test.db") cre.create(dbpath) # validate content db = SqliteDatabase(dbpath) self.assertEqual( db.lookup("wall"), [("bsdutils", "", "main")]) def test_create_priorities_work(self): mock_commands_1 = self.make_mock_commands_file( "bionic_main", mock_commands_bionic) mock_commands_2 = self.make_mock_commands_file( "bionic_universe", mock_commands_bionic_universe) self.assertNotEqual(mock_commands_1, mock_commands_2) cre = DbCreator([mock_commands_1, mock_commands_2]) dbpath = os.path.join(self.tmpdir, "test.db") cre.create(dbpath) # validate content db = SqliteDatabase(dbpath) for i in range(100): # ensure that we always sort "main" before universe" # and that the same component is sorted alphabetically self.assertEqual( db.lookup("bzr"), [ ("bzr1", "1.0", "main"), ("bzr2", "2.7", "main"), ("bzr-tng", "3.0", "universe"), ]) def test_priorities_bonus_works(self): mock_commands_1 = self.make_mock_commands_file( "bionic_main", mock_commands_bionic) cre = DbCreator([mock_commands_1]) dbpath = os.path.join(self.tmpdir, "test.db") cre.create(dbpath) # validate content db = SqliteDatabase(dbpath) for i in range(100): self.assertEqual( db.lookup("java"), [ ("default-jre", "8", "main"), ("aaa-openjre-7", "7", "main"), ]) def test_visible_pkgname_works(self): mock_commands_1 = self.make_mock_commands_file( "bionic_main", mock_commands_bionic) cre = DbCreator([mock_commands_1]) dbpath = os.path.join(self.tmpdir, "test.db") cre.create(dbpath) # validate content db = SqliteDatabase(dbpath) for i in range(100): self.assertEqual( db.lookup("python2.7"), [("python2.7", "2.7", "main")]) def test_create_multiple_no_unneeded_creates(self): mock_commands_1 = self.make_mock_commands_file( "bionic_main", mock_commands_bionic) mock_commands_2 = self.make_mock_commands_file( "bionic-proposed_main", mock_commands_bionic_proposed) cre = DbCreator([mock_commands_1, mock_commands_2]) dbpath = os.path.join(self.tmpdir, "test.db") cre.create(dbpath) # ensure the metadata file was created self.assertTrue(os.path.exists(dbpath+".metadata")) # ensure the caching works and the db is not created twice st = os.stat(dbpath) cre.create(dbpath) self.assertEqual(st.st_mtime, os.stat(dbpath).st_mtime) def test_create_honors_ignore_comamnds(self): mock_commands_file = self.make_mock_commands_file( "bionic_main", mock_commands_bionic) cre = DbCreator([mock_commands_file]) dbpath = os.path.join(self.tmpdir, "test.db") cre.create(dbpath) # validate content db = SqliteDatabase(dbpath) # ignore-commands is correctly handled self.assertEqual( db.lookup("foo-cmd"), [("foo", "3.0", "main")]) self.assertEqual(db.lookup("igore-me"), []) command-not-found-20.04.2/CommandNotFound/tests/0000775000000000000000000000000013546652345016306 5ustar command-not-found-20.04.2/CommandNotFound/tests/__init__.py0000664000000000000000000000000013546652345020405 0ustar command-not-found-20.04.2/CommandNotFound/tests/test_command_not_found.py0000664000000000000000000001474013546652345023416 0ustar #!/usr/bin/python import json #import logging #logging.basicConfig(level=logging.DEBUG) import os import shutil import tempfile import unittest import CommandNotFound.CommandNotFound as CommandNotFound_Module from CommandNotFound.CommandNotFound import ( CommandNotFound, SqliteDatabase, ) from CommandNotFound.db.creator import DbCreator test_specs = [ """ test: single snap advise snaps: spotify/1.0:x-spotify with: x-spotify Command 'x-spotify' not found, but can be installed with: sudo snap install spotify """, """ test: mixed advise, single snap debs: aws/1.0:x-aws,other-cmd snaps: aws-cli/2.0:x-aws with: x-aws Command 'x-aws' not found, but can be installed with: sudo snap install aws-cli # version 2.0, or sudo apt install aws # version 1.0 See 'snap info aws-cli' for additional versions. """, """ test: mixed advise, multi-snap debs: aws/1.0:x-aws,other-cmd snaps: aws-cli/2.0:x-aws;aws-cli-compat/0.1:x-aws with: x-aws Command 'x-aws' not found, but can be installed with: sudo snap install aws-cli # version 2.0, or sudo snap install aws-cli-compat # version 0.1 sudo apt install aws # version 1.0 See 'snap info ' for additional versions. """, """ test: single advise deb debs: pylint/1.0:x-pylint with: x-pylint Command 'x-pylint' not found, but can be installed with: sudo apt install pylint """, """ test: multi advise debs debs: vim/1.0:x-vi;neovim/2.0:x-vi with: x-vi Command 'x-vi' not found, but can be installed with: sudo apt install vim # version 1.0, or sudo apt install neovim # version 2.0 """, """ test: fuzzy advise debs only debs: vim/1.0:x-vi;neovim/2.0:x-vi with: x-via Command 'x-via' not found, did you mean: command 'x-vi' from deb vim (1.0) command 'x-vi' from deb neovim (2.0) Try: sudo apt install """, """ test: single advise snaps snaps: spotify/1.0:x-spotify with: x-spotify Command 'x-spotify' not found, but can be installed with: sudo snap install spotify """, """ test: multi advise snaps snaps: foo1/1.0:x-foo;foo2/2.0:x-foo with: x-foo Command 'x-foo' not found, but can be installed with: sudo snap install foo1 # version 1.0, or sudo snap install foo2 # version 2.0 See 'snap info ' for additional versions. """, """ test: mixed fuzzy advise debs: aws/1.0:x-aws,other-cmd snaps: aws-cli/2.0:x-aws with: x-awsX Command 'x-awsX' not found, did you mean: command 'x-aws' from snap aws-cli (2.0) command 'x-aws' from deb aws (1.0) See 'snap info ' for additional versions. """, """ test: many mispellings just prints a summary debs: lsa/1.0:lsa;lsb/1.0:lsb;lsc/1.0:lsc;lsd/1.0:lsd;lsd/1.0:lsd;lse/1.0:lse;lsf/1.0:lsf;lsg/1.0:lsg;lse/1.0:lsh;lse/1.0:lsh;lsi/1.0:lsi;lsj/1.0:lsj;lsk/1.0:lsk;lsl/1.0:lsl;lsm/1.0:lsm;lsn/1.0:lsn;lso/1.0:lso with: lsx Command 'lsx' not found, but there are 17 similar ones. """, ] class MockAptDB: def __init__(self): self._db = {} def lookup(self, command): return self._db.get(command, []) class CommandNotFoundOutputTest(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() self.mock_db() self.cnf = CommandNotFound() self.cnf.snap_cmd = os.path.join(self.tmpdir, "mock-snap-cmd-%i") # FIXME: add this to the test spec to test the outputs for uid=0/1000 # and for sudo/no-sudo self.cnf.euid = 1000 self.cnf.user_can_sudo = True def tearDown(self): shutil.rmtree(self.tmpdir) def mock_db(self): """Create an empty database and point c-n-f to it.""" self.tmpdir = tempfile.mkdtemp() mock_commands_file = os.path.join(self.tmpdir, "Commands-all") with open(mock_commands_file, "w"): pass col = DbCreator([mock_commands_file]) col.create(os.path.join(self.tmpdir, "test.db")) CommandNotFound_Module.dbpath = os.path.join(self.tmpdir, "test.db") def set_mock_snap_cmd_json(self, json): with open(self.cnf.snap_cmd, "w") as fp: fp.write("""#!/bin/sh set -e echo '%s' """ % json) os.chmod(self.cnf.snap_cmd, 0o755) def test_from_table(self): for i, spec in enumerate(test_specs): self._test_spec(spec) def _test_spec(self, spec): # setup self.cnf.db = MockAptDB() self.set_mock_snap_cmd_json(json.dumps([])) self.cnf.output_fd = open(os.path.join(self.tmpdir, "output"), "w") # read spec lines = spec.split("\n") test = "unkown test" for i, line in enumerate(lines): if line.startswith("debs: "): debs = line[len("debs: "):].split(";") for deb in debs: l = deb.split(":") name, ver = l[0].split("/") cmds = l[1].split(",") for cmd in cmds: if not cmd in self.cnf.db._db: self.cnf.db._db[cmd] = [] self.cnf.db._db[cmd].append( (name, ver, "main") ) if line.startswith("snaps: "): snaps = line[len("snaps: "):].split(";") mock_json = [] for snap in snaps: l = snap.split(":") name, ver = l[0].split("/") cmds = l[1].split(",") for cmd in cmds: mock_json.append({"Snap": name, "Command": cmd, "Version": ver}) self.set_mock_snap_cmd_json(json.dumps(mock_json)) if line.startswith("test: "): test = line[len("test: "):] if line.startswith("with: "): cmd = line[len("with: "):] break expected_output = "\n".join(lines[i+1:]) # run test self.cnf.advise(cmd) # validate with open(self.cnf.output_fd.name) as fp: output = fp.read() self.assertEqual(output, expected_output, "test '%s' broken" % test) # cleanup self.cnf.output_fd.close() class RegressionTestCase(unittest.TestCase): def test_lp1130444(self): tmpdir = tempfile.mkdtemp() self.addCleanup(shutil.rmtree, tmpdir) mock_commands_file = os.path.join(tmpdir, "Commands-all") with open(mock_commands_file, "w"): pass col = DbCreator([mock_commands_file]) col.create(os.path.join(tmpdir, "test.db")) db = SqliteDatabase(os.path.join(tmpdir, "test.db")) self.assertEqual(db.lookup("foo\udcb6"), []) command-not-found-20.04.2/CommandNotFound/tests/test_pyflakes.py0000775000000000000000000000105513546652345021541 0ustar import glob import os import subprocess import unittest class TestPyflakesClean(unittest.TestCase): """ ensure that the tree is pyflakes clean """ def setUp(self): self.paths = [] basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) for dirpath, dirs, files in os.walk(basedir): self.paths.extend(glob.glob(dirpath+"/*.py")) def test_pyflakes3_clean(self): self.assertEqual(subprocess.check_call(['pyflakes3'] + self.paths), 0) if __name__ == "__main__": unittest.main() command-not-found-20.04.2/CommandNotFound/util.py0000664000000000000000000000315113546652345016473 0ustar # (c) Zygmunt Krynicki 2008 # Licensed under GPL, see COPYING for the whole text from __future__ import print_function import gettext import sys if sys.version >= "3": _gettext_method = "gettext" else: _gettext_method = "ugettext" _ = getattr(gettext.translation("command-not-found", fallback=True), _gettext_method) def crash_guard(callback, bug_report_url, version): """ Calls callback and catches all exceptions. When something bad happens prints a long error message with bug report information and exits the program""" try: try: callback() except Exception as ex: print(_("Sorry, command-not-found has crashed! Please file a bug report at:"), file=sys.stderr) print(bug_report_url, file=sys.stderr) print(_("Please include the following information with the report:"), file=sys.stderr) print(file=sys.stderr) print(_("command-not-found version: %s") % version, file=sys.stderr) print(_("Python version: %d.%d.%d %s %d") % sys.version_info, file=sys.stderr) try: import subprocess subprocess.call(["lsb_release", "-i", "-d", "-r", "-c"], stdout=sys.stderr) except (ImportError, OSError): pass print(_("Exception information:"), file=sys.stderr) print(file=sys.stderr) print(ex, file=sys.stderr) try: import traceback traceback.print_exc() except ImportError: pass finally: sys.exit(127) __all__ = ["crash_guard"] command-not-found-20.04.2/MANIFEST.in0000664000000000000000000000015313546652345013646 0ustar # the database recursive-include data/programs.d # the translations recursive-include po/ *.pot *.po *.mo command-not-found-20.04.2/README.md0000664000000000000000000000510413546652345013370 0ustar # Command-not-found This application implements the command-not-found spec at: https://wiki.ubuntu.com/CommandNotFoundMagic If you want automatic prompts to install the package, set COMMAND_NOT_FOUND_INSTALL_PROMPT in your environment. To use it in bash, please add the following line to your .bashrc file: . /etc/bash_command_not_found To use it in zsh, please add the following line to your .zshrc file: . /etc/zsh_command_not_found Note that it overrides the preexec and precmd functions, in case you have defined your own. ## Data sources Command-not-found will for the following data sources: 1. sqlite3 DB in /usr/share/command-not-found/commands.db, if that is *not* found it will fallback to (2) 2. legacy /usr/share/command-not-found/programs.d/*.db gdbm style database The datasource (1) is generated from data found on the archive server in deb822 format. The data is generated via https://code.launchpad.net/~mvo/command-not-found-extractor/+git/command-not-found-extractor and is downloaded via `apt update`. The datasource (2) is generated via a static `command-not-found-data` deb package. It is less rich and dynamic than (1) and should be considered legacy and only be used if no better data source is available. ### DB schemas #### Legacy DB: Simple key/value store with key `program_name` (e.g. bash) and value a comma separated list of packages that provide the program name. The filename indicates the component and architecuture via: `$component-$arch.db`. #### Sqlite3 DB: The database looks like this: ``` CREATE TABLE IF NOT EXISTS "commands" ( [command] TEXT PRIMARY KEY NOT NULL, [pkgID] INTEGER NOT NULL, FOREIGN KEY ([pkgID]) REFERENCES "pkgs" ([pkgID]) ); CREATE TABLE IF NOT EXISTS "packages" ( [pkgID] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, [name] TEXT, [version] TEXT, [priority] INTEGER ); ``` There is no need to store the component because we do not display that in c-n-f. Note that the "name" in the "pkgs" table may include an architecture qualifier. This is an optimization for multi-arch systems, by default if there is "bash:amd64" and "bash:i386" on an amd64 multi-arch systems we will not store "bash:i386" in the DB at all and will store "bash:amd64" just as "bash". However for commands that are only available for the foreign arch (e.g. "wine:i386") the full qualified package name is stored in the DB and used in the c-n-f output. ## Development To run the tests type: $ python -m unittest discover command-not-found-20.04.2/TODO0000664000000000000000000000210113546652345012573 0ustar TOP PRIORITY * Add a soundex encoded variant of the name to another database and make suggestions based on the similarity. * Gather cross-references for packages during the scan process PKG A: /bin/prog-a (+x) PGK B: /bin/prog-b -> /bin/prog-a (symlink) PKG B should record a dangling symlink that gets picked up by second phase scanner so that PKG B actually provides prog-b executable (even though the file is in other package) This is relevant for stuff like gcc which is registered as symlink using alternatives (we treat alternatives as symlinks during scanning) * Get Debian to adopt this package! MEDIUM PRIORITY * Modify the build system so that POT creation date is not re-set every time a package is buil ZK: disabled from now on, manual: make -C po update-po is needed to sync translations * Provide comprehensive suggestion database (sivang?) ZK: sivang is off the project for the moment LOW PRIORITY * Figure out why data (the empty directory) gets copied over /usr/share/command-not-found) * Suggest packages for the currently used desktop before other packages command-not-found-20.04.2/bash_command_not_found0000664000000000000000000000056313546652345016526 0ustar # (c) Zygmunt Krynicki 2005, # Licensed under GPL, see COPYING for the whole text # # This script will look-up command in the database and suggest # installation of packages available from the repository command_not_found_handle() { if [ -x /usr/lib/command-not-found ]; then /usr/lib/command-not-found -- "$1" return $? else return 127 fi } command-not-found-20.04.2/bzr/0000775000000000000000000000000013546652345012706 5ustar command-not-found-20.04.2/bzr/merge-with-ubuntu-core-dev0000775000000000000000000000013613546652345017726 0ustar #!/bin/bash bzr merge 'http://bazaar.launchpad.net/~ubuntu-core-dev/command-not-found/ubuntu' command-not-found-20.04.2/cnf-update-db0000775000000000000000000000125413546652345014452 0ustar #!/usr/bin/python3 import glob import logging import os import sys from CommandNotFound.db.creator import DbCreator from CommandNotFound import CommandNotFound if __name__ == "__main__": if "--debug" in sys.argv[1:]: logging.basicConfig(level=logging.DEBUG) elif "--verbose" in sys.argv[1:]: logging.basicConfig(level=logging.INFO) db = CommandNotFound.dbpath if not os.access(os.path.dirname(db), os.W_OK): print("datbase directory %s not writable" % db) sys.exit(0) command_files = glob.glob("/var/lib/apt/lists/*Commands-*") if len(command_files) > 0: col = DbCreator(command_files) col.create(db) command-not-found-20.04.2/command-not-found0000775000000000000000000000675513546652345015401 0ustar #!/usr/bin/python3 # (c) Zygmunt Krynicki 2005, 2006, 2007, 2008 # Licensed under GPL, see COPYING for the whole text from __future__ import absolute_import, print_function __version__ = "0.3" BUG_REPORT_URL = "https://bugs.launchpad.net/command-not-found/+filebug" try: import sys if sys.path and sys.path[0] == '/usr/lib': # Avoid ImportError noise due to odd installation location. sys.path.pop(0) if sys.version < '3': # We might end up being executed with Python 2 due to an old # /etc/bash.bashrc. import os if "COMMAND_NOT_FOUND_FORCE_PYTHON2" not in os.environ: os.execvp("/usr/bin/python3", [sys.argv[0]] + sys.argv) import gettext import locale from optparse import OptionParser from CommandNotFound.util import crash_guard from CommandNotFound import CommandNotFound except KeyboardInterrupt: import sys sys.exit(127) def enable_i18n(): cnf = gettext.translation("command-not-found", fallback=True) kwargs = {} if sys.version < '3': kwargs["unicode"] = True cnf.install(**kwargs) try: locale.setlocale(locale.LC_ALL, '') except locale.Error: locale.setlocale(locale.LC_ALL, 'C') def fix_sys_argv(encoding=None): """ Fix sys.argv to have only unicode strings, not binary strings. This is required by various places where such argument might be automatically coerced to unicode string for formatting """ if encoding is None: encoding = locale.getpreferredencoding() sys.argv = [arg.decode(encoding) for arg in sys.argv] class LocaleOptionParser(OptionParser): """ OptionParser is broken as its implementation of _get_encoding() uses sys.getdefaultencoding() which is ascii, what it should be using is locale.getpreferredencoding() which returns value based on LC_CTYPE (most likely) and allows for UTF-8 encoding to be used. """ def _get_encoding(self, file): encoding = getattr(file, "encoding", None) if not encoding: encoding = locale.getpreferredencoding() return encoding def main(): enable_i18n() if sys.version < '3': fix_sys_argv() parser = LocaleOptionParser( version=__version__, usage=_("%prog [options] ")) parser.add_option('-d', '--data-dir', action='store', default="/usr/share/command-not-found", help=_("use this path to locate data fields")) parser.add_option('--ignore-installed', '--ignore-installed', action='store_true', default=False, help=_("ignore local binaries and display the available packages")) parser.add_option('--no-failure-msg', action='store_true', default=False, help=_("don't print ': command not found'")) (options, args) = parser.parse_args() if len(args) == 1: try: cnf = CommandNotFound.CommandNotFound(options.data_dir) except FileNotFoundError: print(_("Could not find command-not-found database. Run 'sudo apt update' to populate it."), file=sys.stderr) print(_("%s: command not found") % args[0], file=sys.stderr) return if not cnf.advise(args[0], options.ignore_installed) and not options.no_failure_msg: print(_("%s: command not found") % args[0], file=sys.stderr) if __name__ == "__main__": crash_guard(main, BUG_REPORT_URL, __version__) command-not-found-20.04.2/data/0000775000000000000000000000000013546652345013022 5ustar command-not-found-20.04.2/data/50command-not-found0000664000000000000000000000116113546652345016436 0ustar ## This file is provided by command-not-found(1) to download ## Commands metadata files. Acquire::IndexTargets { # The deb822 metadata files deb::CNF { MetaKey "$(COMPONENT)/cnf/Commands-$(NATIVE_ARCHITECTURE)"; ShortDescription "Commands-$(NATIVE_ARCHITECTURE)"; Description "$(RELEASE)/$(COMPONENT) $(NATIVE_ARCHITECTURE) c-n-f Metadata"; }; }; # Refresh AppStream cache when APT's cache is updated (i.e. apt update) APT::Update::Post-Invoke-Success { "if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi"; }; command-not-found-20.04.2/debian/0000775000000000000000000000000013642704232013321 5ustar command-not-found-20.04.2/debian/changelog0000664000000000000000000010643113642704232015200 0ustar command-not-found (20.04.2) focal; urgency=medium * Having a command in quotes with a space after it isn't very tasteful. -- Brian Murray Mon, 06 Apr 2020 12:52:58 -0700 command-not-found (20.04.1) focal; urgency=medium * Special case python -> python3, with extra advert of python-is-python3. -- Dimitri John Ledkov Fri, 27 Mar 2020 11:01:51 +0000 command-not-found (20.04.0) focal; urgency=medium * Special case python -> python3, using existing translated strings. LP: #1306682, LP: #1863532 -- Dimitri John Ledkov Thu, 12 Mar 2020 13:10:32 +0000 command-not-found (19.10.0) eoan; urgency=medium * If the database is absent, do not crash with a backtrace, but tell the user to run apt update. * Remove the command-not-found-data package (LP: #1844651) -- Julian Andres Klode Mon, 07 Oct 2019 17:08:21 +0200 command-not-found (18.10.0~pre2) cosmic; urgency=medium * Update data for state as of release. LP: #1802462. -- Steve Langasek Fri, 09 Nov 2018 12:17:44 -0800 command-not-found (18.10.0~pre1) cosmic; urgency=medium * first cosmic build -- Michael Vogt Mon, 07 May 2018 07:35:23 +0200 command-not-found (18.04.5) bionic; urgency=medium * Ensure /snap/bin is in PATH when checking for commands (LP: #1769088) -- Michael Vogt Sat, 05 May 2018 08:41:03 +0200 command-not-found (18.04.4) bionic; urgency=medium * Refresh the command indices. -- Steve Langasek Mon, 23 Apr 2018 15:14:35 -0700 command-not-found (18.04.3) bionic; urgency=medium * Change to (LP: #1764413) * Update static commands data -- Michael Vogt Tue, 17 Apr 2018 08:22:35 +0200 command-not-found (18.04.2) bionic; urgency=medium * Drop unused python2 python-commandnotfound package (LP: #1763082) * Build with pybuild to simplify debian/rules -- Jeremy Bicha Fri, 13 Apr 2018 10:12:03 -0400 command-not-found (18.04.1) bionic; urgency=medium * CommandNotFound/CommandNotFound.py: - add special case for "python" when "python3" is already installed - update static commands data deb packaging - update static commands data -- Michael Vogt Thu, 12 Apr 2018 09:53:10 +0200 command-not-found (18.04.0) bionic; urgency=medium * support "ignore-commands" tags to support blacklisting certain commands * update advise to print "but can be installed with:" * when multiple versions are found, write the first version as: "# version 1.0, or" (i.e. append ", or") -- Michael Vogt Tue, 03 Apr 2018 11:54:19 +0200 command-not-found (18.04.0~pre8) bionic; urgency=medium * Update CommandNotFound/db to latest bionic. -- Łukasz 'sil2100' Zemczak Wed, 28 Mar 2018 10:39:21 +0200 command-not-found (18.04.0~pre7) bionic; urgency=medium * Only rebuild commands.db if the inputs changed -- Michael Vogt Mon, 19 Mar 2018 12:03:58 +0100 command-not-found (18.04.0~pre6) bionic; urgency=medium * update output to the latest agreements with the various stakeholders -- Michael Vogt Fri, 16 Mar 2018 09:51:37 +0100 command-not-found (18.04.0~pre5) bionic; urgency=medium * fix ftbfs harder (mock posix.geteuid()) -- Michael Vogt Mon, 12 Mar 2018 12:15:23 +0100 command-not-found (18.04.0~pre4) bionic; urgency=medium * fix ftbfs * improve tests -- Michael Vogt Mon, 12 Mar 2018 12:07:33 +0100 command-not-found (18.04.0~pre3) bionic; urgency=medium * CommandNotFound/CommandNotFound.py: - fix bug in "command-not-found jq" where empty () was shown - fix output to match https://forum.snapcraft.io/t/4345/3/ - add output format tests -- Michael Vogt Sat, 10 Mar 2018 21:59:07 +0100 command-not-found (18.04.0~pre2) bionic; urgency=medium * add versionized dependencies from command-not-found on command-not-found-data and python3-commandnotfound * update output to the latest agreement -- Michael Vogt Wed, 07 Mar 2018 14:58:22 +0100 command-not-found (18.04.0~pre1) bionic; urgency=medium * New version: - switch from gdbm to sqlite (smaller files and faster searches) - will fetch "dists/bionic/*/binary-*/cnf/Commands-* files once the archive provides them - CLI output follows what is outlined in LP: #1749777 - command-not-found-data switched to consume Commands-* files (package can be dropped/emptied once server side Commands-* files are available) - support for suggestions based on snap packages - add autopkgtest to the package -- Michael Vogt Wed, 28 Feb 2018 14:26:58 +0100 command-not-found (0.3ubuntu18.04.0~pre4) bionic; urgency=medium * CommandNotFound/CommandNotFound.py: - do not show stderr from snap output -- Michael Vogt Sat, 17 Feb 2018 17:09:01 +0100 command-not-found (0.3ubuntu18.04.0~pre3) bionic; urgency=medium * CommandNotFound/CommandNotFound.py: - limit input to 256 chars to avoid DoS (LP: #1605732) - add support for suggesting commands snap from snaps (needs snapd 2.31+ to work) - add "snapd" to suggests -- Michael Vogt Thu, 15 Feb 2018 09:15:40 +0100 command-not-found (0.3ubuntu18.04.0~pre2) bionic; urgency=medium * Update scan.data to latest bionic. * Add pyflakes test and make pyflakes clean. * Update README to markdown and include how to run the tests. -- Michael Vogt Tue, 13 Feb 2018 14:37:32 +0100 command-not-found (0.3ubuntu18.04.0~pre1) bionic; urgency=medium * Update scan.data to bionic. -- Michael Vogt Thu, 21 Dec 2017 09:07:18 +0100 command-not-found (0.3ubuntu17.10.2) artful; urgency=medium * Update scan.data after a new "artful" archive scan (LP: #1739467) -- Michael Vogt Wed, 20 Dec 2017 19:29:20 +0100 command-not-found (0.3ubuntu17.10.1) artful; urgency=medium * Update scan.data for new changes in artful. -- Łukasz 'sil2100' Zemczak Mon, 25 Sep 2017 10:22:26 -0400 command-not-found (0.3ubuntu17.10.0) artful; urgency=medium * Removing not used directory /usr/share/command-not-found/data/ -- Dominique Ramaekers Mon, 31 Jul 2017 17:23:52 +0200 command-not-found (0.3ubuntu17.04.2) zesty; urgency=medium * Update scan.data for zesty final release. -- Adam Conrad Mon, 10 Apr 2017 07:13:34 -0600 command-not-found (0.3ubuntu17.04.1) zesty; urgency=medium * Update scan.data for new changes in zesty. -- Adam Conrad Mon, 20 Mar 2017 17:13:54 -0600 command-not-found (0.3ubuntu17.04.0) zesty; urgency=medium [ Dominique Ramaekers ] * Fix crash on unreasonable long input (LP: #1643167) [ Michael Vogt ] * Updated the scan.data for zesty -- Michael Vogt Wed, 14 Dec 2016 07:37:52 +0100 command-not-found (0.3ubuntu16.10.0) yakkety; urgency=medium * command-not-found: Specify full path to python3 (LP: #1585696) * debian/rules: rm UnifiedDataExtractor/scan.data-old on clean. * Update data for yakkety, and add s390x database (LP: #1593592) -- Adam Conrad Fri, 17 Jun 2016 00:41:31 -0600 command-not-found (0.3ubuntu16.04.1) xenial; urgency=medium * ./update-from-web.sh: adjust script to not hardcode scp username. * Update data again for some late changes in xenial. -- Steve Langasek Fri, 22 Apr 2016 11:24:59 -0700 command-not-found (0.3ubuntu16.04) xenial; urgency=medium * update data to latest xenial -- Michael Vogt Thu, 14 Apr 2016 09:15:31 +0200 command-not-found (0.3ubuntu16.04~pre2) xenial; urgency=medium * Merge lp:command-not-found: - use apt, instead of apt-get. -- Dimitri John Ledkov Fri, 05 Feb 2016 05:59:46 +0000 command-not-found (0.3ubuntu16.04~pre1) xenial; urgency=medium * updated for xenial -- Michael Vogt Thu, 14 Jan 2016 19:53:31 +0100 command-not-found (0.3ubuntu15.10.1) wily; urgency=low * updated for latest wily -- Michael Vogt Tue, 25 Aug 2015 10:32:14 +0200 command-not-found (0.3ubuntu15.10.0) wily; urgency=low [ Carsten Hey ] * Update /etc/zsh_command_not_found: - Don't overwrite an already defined command-not-found handler. - Don't try to run command-not-found if the package has been removed since the shell has been started. [ Michael Vogt ] * updated for latest wily -- Michael Vogt Tue, 21 Jul 2015 08:02:05 +0200 command-not-found (0.3ubuntu15.3) vivid; urgency=low * updated for vivid (LP: #1439438) -- Michael Vogt Mon, 20 Apr 2015 18:37:06 +0200 command-not-found (0.3ubuntu15.2) vivid; urgency=low * updated for vivid -- Michael Vogt Mon, 23 Mar 2015 15:41:32 +0100 command-not-found (0.3ubuntu15.1) utopic-proposed; urgency=low * scan.data updated * blacklist postgresql-xc (LP: #1384864) -- Michael Vogt Tue, 28 Oct 2014 09:42:24 +0100 command-not-found (0.3ubuntu15) utopic; urgency=low * update scan.data for utopic-rc -- Michael Vogt Mon, 13 Oct 2014 16:20:42 +0200 command-not-found (0.3ubuntu14) utopic; urgency=low * update scan.data -- Michael Vogt Fri, 12 Sep 2014 16:08:21 +0200 command-not-found (0.3ubuntu13) utopic; urgency=low * add python3 suggestion if a user types "python" (LP: #1306682) * do not crash for invalid unicode (LP: #1130444) * update scan.data to latest utopic -- Michael Vogt Wed, 16 Jul 2014 08:03:59 +0200 command-not-found (0.3ubuntu12) trusty; urgency=low * updated scan.data for trusty (main architectures & ports) -- Michael Vogt Thu, 03 Apr 2014 08:12:33 +0200 command-not-found (0.3ubuntu11) trusty; urgency=low * python-commandnotfound needs to breaks/replaces with command-not-found from precise. (LP: #1296072) -- Rolf Leggewie Sat, 22 Mar 2014 23:25:21 +0800 command-not-found (0.3ubuntu10) trusty; urgency=medium [ Anthony Wong ] * Fix locale.Error: unsupported locale setting bug (LP: #1029204) -- Dimitri John Ledkov Fri, 21 Mar 2014 12:04:22 +0000 command-not-found (0.3ubuntu9) trusty; urgency=medium * Rebuild to drop files installed into /usr/share/pyshared. -- Matthias Klose Sun, 23 Feb 2014 13:46:33 +0000 command-not-found (0.3ubuntu8) saucy; urgency=low [ Gerhard Burger ] * Patch to fix traceback when getting input in Python 2 environment. (LP: #1073919) -- Barry Warsaw Mon, 29 Jul 2013 18:37:17 -0400 command-not-found (0.3ubuntu7) raring; urgency=low [ Danilo Segan ] * Reintroduce Python2 support with python-commandnotfound package. (LP: #1123193) [ Barry Warsaw ] * Move the Python 3 library to the python3-commandnotfound package, and build depend command-not-found on that. * debian/control: Bump to Standards-Version: 3.9.4 * debian/rules: Remove --without=python-support as no longer needed. -- Danilo Segan Wed, 20 Feb 2013 09:51:10 +0100 command-not-found (0.3ubuntu6) raring; urgency=low * Build depend on python3-all. -- Dmitrijs Ledkovs Fri, 26 Oct 2012 11:19:07 +0100 command-not-found (0.3ubuntu5) quantal; urgency=low * updated for the RC release, re-scan archive now that the internal archive mirror is up-to-date again * blacklist pentium-builder (LP: #1062043) -- Michael Vogt Tue, 09 Oct 2012 13:39:27 +0200 command-not-found (0.3ubuntu4) quantal; urgency=low * updated for beta2 -- Michael Vogt Tue, 25 Sep 2012 08:59:00 +0200 command-not-found (0.3ubuntu3) quantal; urgency=low * updated to the latest data from quantal -- Michael Vogt Thu, 30 Aug 2012 15:45:20 +0200 command-not-found (0.3ubuntu2) quantal; urgency=low [ Michael Vogt ] * update dependency/build-dependencies for the py3 port to fix ftbfs * update all scripts to run as py3 * update extractor to use data from bignay [ Colin Watson ] * Add several debhelper overrides to cope with the lack of buildsystem support for Python 3. * Drop Python 2 build-dependencies. -- Michael Vogt Fri, 29 Jun 2012 13:46:06 +0200 command-not-found (0.3ubuntu1) quantal; urgency=low * initial quantal upload - this still includes metadata from precise as rookery is not updating the command-not-found data exports * includes python3 port, thanks to Colin Watson -- Michael Vogt Tue, 26 Jun 2012 20:20:58 +0200 command-not-found (0.2.46ubuntu6) precise; urgency=low * Import sys again in command-not-found's KeyboardInterrupt handler (LP: #864461). * Forcibly remove /usr/lib from the start of sys.path to avoid unsightly ImportWarning noise (LP: #983875). * Update scan.data to current precise. -- Colin Watson Tue, 17 Apr 2012 12:35:51 +0100 command-not-found (0.2.46ubuntu5) precise; urgency=low * scan.data: - updated to current precise -- Michael Vogt Thu, 23 Feb 2012 18:06:00 +0100 command-not-found (0.2.46ubuntu4) precise; urgency=low * Fix debian/rules to work correctly when we're not building arch-indep packages. -- Steve Langasek Thu, 09 Feb 2012 23:28:07 +0000 command-not-found (0.2.46ubuntu3) precise; urgency=low * Check for the always-present sudo group first, so that checking for 'admin' on new installs doesn't raise a key error by mistake. LP: #893842. -- Steve Langasek Thu, 09 Feb 2012 14:46:59 -0800 command-not-found (0.2.46ubuntu2) precise; urgency=low * use dh8 and simplify rules file * updated to current precise -- Michael Vogt Fri, 03 Feb 2012 10:10:52 +0100 command-not-found (0.2.46ubuntu1) precise; urgency=low * merged from lp:command-not-found trunk: - add support for automatic install prompt (enable via the COMMAND_NOT_FOUND_INSTALL_PROMPT environment) - fix java recommends (LP: #853688) - add --no-failure-msg - improved zsh support from Alex Jurkiewicz - auto-installation support for root users from Serhiy Zahoriya -- Michael Vogt Fri, 13 Jan 2012 10:39:15 +0100 command-not-found (0.2.45ubuntu3) precise; urgency=low * Use the right group name ('sudo', not 'sudoers'). LP: #893842. -- Steve Langasek Thu, 12 Jan 2012 14:21:01 +0100 command-not-found (0.2.45ubuntu2) precise; urgency=low * scan.data: - updated to current precise -- Michael Vogt Fri, 06 Jan 2012 11:53:21 +0100 command-not-found (0.2.44.1ubuntu3) precise; urgency=low * Recognize the 'sudo' group as a valid admin group as well, so that we return the correct error message for those with admin access. LP: #893842. -- Steve Langasek Mon, 02 Jan 2012 14:47:43 -0800 command-not-found (0.2.44.1ubuntu2) precise; urgency=low * Rebuild to drop python2.6 dependencies. -- Matthias Klose Sat, 31 Dec 2011 02:01:46 +0000 command-not-found (0.2.44.1ubuntu1) oneiric-proposed; urgency=low * updated to the latest data from oneiric (LP: #882276) -- Michael Vogt Tue, 22 Nov 2011 09:13:22 +0100 command-not-found (0.2.44ubuntu1) oneiric; urgency=low * merged lp:~zkrynicki/command-not-found/fix-839609 LP: #839609 * scan.data: - updated to current oneiric -- Michael Vogt Tue, 20 Sep 2011 15:48:12 +0200 command-not-found (0.2.43ubuntu1) oneiric; urgency=low [ Zygmunt Krynicki ] * lp:~zkrynicki/command-not-found/rework-locale-support: - improved gettext handling -- Michael Vogt Thu, 25 Aug 2011 15:15:50 +0200 command-not-found (0.2.42ubuntu2) oneiric; urgency=low * update to curernt oneiric, this includes the new data from http://ports.ubuntu.com/~mvo/command-not-found/ to get more up-to-date data for the ports -- Michael Vogt Thu, 25 Aug 2011 10:12:59 +0200 command-not-found (0.2.42ubuntu1) oneiric; urgency=low [ Michael Vogt ] * updated data to current oneiric [ Zygmunt Krynicki ] * merged lp:~fahlgren/command-not-found/speedup thanks to Daniel Fahlgren -- Michael Vogt Wed, 10 Aug 2011 15:09:19 +0200 command-not-found (0.2.41ubuntu6) UNRELEASED; urgency=low * merged lp:~julien-nicoulaud/command-not-found/fix-zsh-hook, many thanks to Julien Nicoulaud (LP: #624565) ents -- Michael Vogt Mon, 15 Aug 2011 16:56:18 +0200 command-not-found (0.2.41ubuntu5) oneiric; urgency=low * updated for alpha3 -- Michael Vogt Mon, 01 Aug 2011 20:08:36 +0200 command-not-found (0.2.41ubuntu4) oneiric; urgency=low * updated to current oneiric -- Michael Vogt Fri, 01 Jul 2011 15:32:10 +0100 command-not-found (0.2.41ubuntu3) oneiric; urgency=low [ Steve Langasek ] * Migrate to dh_python2. LP: #788514. [ Michael Vogt ] * automatically update the scan.data in the pre-build.sh hook (thanks to Steve Langasek for this suggestion) * updated to oneiric -- Michael Vogt Fri, 10 Jun 2011 08:56:44 +0200 command-not-found (0.2.41ubuntu2) natty; urgency=low * updated for final natty -- Michael Vogt Tue, 19 Apr 2011 13:07:19 +0200 command-not-found (0.2.41ubuntu1) natty; urgency=low * updated to current natty * updated to include ports.ubuntu.com as well in the scan.data set (LP: #533031) -- Michael Vogt Tue, 05 Apr 2011 14:15:19 +0200 command-not-found (0.2.40ubuntu21) natty; urgency=low * scan.data: - updated for beta1 -- Michael Vogt Fri, 25 Mar 2011 21:48:16 +0100 command-not-found (0.2.40ubuntu20) natty; urgency=low * scan.data: - updated for alpha3 -- Michael Vogt Tue, 01 Mar 2011 10:11:33 +0100 command-not-found (0.2.40ubuntu19) natty; urgency=low * scan.data: - updated to current natty -- Michael Vogt Thu, 17 Feb 2011 17:08:56 +0100 command-not-found (0.2.40ubuntu18) natty; urgency=low * scan.data: - updated to current natty -- Michael Vogt Thu, 27 Jan 2011 16:56:22 +0100 command-not-found (0.2.40ubuntu17) natty; urgency=low * scan.data: - updated to current natty -- Michael Vogt Fri, 07 Jan 2011 11:06:41 +0100 command-not-found (0.2.40ubuntu16) natty; urgency=low * scan.data: - updated to current natty -- Michael Vogt Thu, 02 Dec 2010 14:26:56 +0100 command-not-found (0.2.40ubuntu15) maverick; urgency=low * scan.data: - updated to current maverick -- Michael Vogt Thu, 16 Sep 2010 15:54:41 +0200 command-not-found (0.2.40ubuntu14) maverick; urgency=low * scan.data: - updated for maverick beta -- Michael Vogt Fri, 27 Aug 2010 17:15:58 +0200 command-not-found (0.2.40ubuntu13) maverick; urgency=low * debian/rules: - generate pot during build (LP: #549106), thanks to David Planella -- Michael Vogt Fri, 13 Aug 2010 12:23:33 +0200 command-not-found (0.2.40ubuntu12) maverick; urgency=low * scan.data: - updated for maverick alpha-3 -- Michael Vogt Wed, 04 Aug 2010 11:59:09 +0200 command-not-found (0.2.40ubuntu11) maverick; urgency=low * scan.data: - updated for maverick alpha-2 -- Michael Vogt Wed, 30 Jun 2010 10:13:52 +0200 command-not-found (0.2.40ubuntu10) maverick; urgency=low [ Rolf Leggewie ] * fix spelling error s/priviledge/privilege/. LP: #574577 [ Michael Vogt ] * scan.data: - updated for maverick alpha-1 -- Michael Vogt Mon, 31 May 2010 16:55:04 +0200 command-not-found (0.2.40ubuntu5) lucid; urgency=low * scan.data: - updated for RC -- Michael Vogt Thu, 15 Apr 2010 09:59:35 +0200 command-not-found (0.2.40ubuntu4) lucid; urgency=low * updated for beta2 -- Michael Vogt Tue, 06 Apr 2010 08:45:24 +0200 command-not-found (0.2.40ubuntu3) lucid; urgency=low * CommandNotFound/CommandNotFound.py: - cherry pick "add numbers to the alphabet used for suggestions " from trunk (r116) (LP: #507760) * scan.data: - updated for beta-1 -- Michael Vogt Mon, 15 Mar 2010 09:36:32 +0100 command-not-found (0.2.40ubuntu2) lucid; urgency=low * scan.data: - updated to current lucid -- Michael Vogt Wed, 24 Feb 2010 13:40:40 +0100 command-not-found (0.2.40ubuntu1) lucid; urgency=low * scan.data: - updated to current lucid * command-not-found: - catch KeyboardInterrupt during initial import as well (LP: #479716) - show "command not found" string only when no command was found (LP: #408020) -- Michael Vogt Mon, 11 Jan 2010 09:30:41 +0100 command-not-found (0.2.38ubuntu4) karmic; urgency=low * updated to current karmic * fix pacakge suggestion for "tex" (LP: #427850) -- Michael Vogt Tue, 13 Oct 2009 09:19:23 +0200 command-not-found (0.2.38ubuntu3) karmic; urgency=low * updated for BETA -- Michael Vogt Fri, 02 Oct 2009 09:21:05 +0200 command-not-found (0.2.38ubuntu2) karmic; urgency=low * updated for alpha6 -- Michael Vogt Wed, 16 Sep 2009 11:02:39 +0200 command-not-found (0.2.38ubuntu1) karmic; urgency=low * updated data to current karmic * print error if a command is not found (bash used to do that but with bash-4.0 it does no longer) LP: #420161 -- Michael Vogt Wed, 02 Sep 2009 16:13:17 +0200 command-not-found (0.2.37ubuntu3) karmic; urgency=low * updated data to current karmic -- Michael Vogt Tue, 18 Aug 2009 09:08:51 +0200 command-not-found (0.2.37ubuntu2) karmic; urgency=low * scan.data: - updated for alpha-3 * CommandNotFound/CommandNotFound.py: - do not give advice if apt-get is not installed (LP: #394842) -- Michael Vogt Mon, 20 Jul 2009 13:17:27 +0200 command-not-found (0.2.37ubuntu1) karmic; urgency=low * CommandNotFound/CommandNotFound.py: - set min_length for mispelling suggestion to 3 (LP: #396829) - set max_length for mispelling suggestion to 15, if there are more, just a summary is printed -- Michael Vogt Fri, 10 Jul 2009 10:44:00 +0200 command-not-found (0.2.36ubuntu1) karmic; urgency=low * scan.data: updated to current karmic * scan.data: add exception for gftp (LP: #99708) * debian/postinst: - if old/leftover /etc/bash_command_found_found is there, remove it (LP: #379851) * debian/rules: - build with DH_PYCENTRAL=include-links LP: #342003 * CommandNotFound/util.py: - use try gettext if lgettext fails (LP: #282446) * debian/copyright: - fix location (LP: #314478) * CommandNotFound/CommandNotFound.py: - be more robust about missing priority.txt (LP: #359784) - add simple spelling correction (LP: #314486) * debian/control: - build for all python versions (LP: #366096) -- Michael Vogt Fri, 26 Jun 2009 13:58:24 +0200 command-not-found (0.2.35ubuntu2) karmic; urgency=low * scan.data: updated for alpha-2 -- Michael Vogt Mon, 08 Jun 2009 11:58:06 +0200 command-not-found (0.2.35ubuntu1) karmic; urgency=low * zsh_command_not_found: - Use the pseudo-namespace prefix cnf_ for everything. - Append the preexec/precmd functions to zsh’s pre*_functions arrays, allowing other pre* functions to be used simultaneously. -- Johan Kiviniemi Fri, 15 May 2009 22:13:00 +0300 command-not-found (0.2.34ubuntu3) jaunty; urgency=low * scan.data: - updated for RC -- Michael Vogt Fri, 17 Apr 2009 10:11:13 +0200 command-not-found (0.2.34ubuntu2) jaunty; urgency=low * scan.data: - updated to current jaunty -- Michael Vogt Tue, 07 Apr 2009 21:58:51 +0200 command-not-found (0.2.34ubuntu1) jaunty; urgency=low * CommandNotFound/CommandNotFound.py: - support "priority.txt" file that allows basic priority ordering in the output * data/priority.txt: - add initial version with "openjdk-6-jdk" (LP: #318442) -- Michael Vogt Mon, 23 Mar 2009 13:45:26 +0100 command-not-found (0.2.33ubuntu3) jaunty; urgency=low * scan.data: - updated for jaunty beta * suggest pythonX.Y instead of pythonX.Y-minimal when "pythonX.Y" is not found -- Michael Vogt Mon, 23 Mar 2009 11:07:26 +0100 command-not-found (0.2.33ubuntu2) jaunty; urgency=low * scan.data: updated to current jaunty -- Michael Vogt Mon, 16 Mar 2009 09:21:37 +0100 command-not-found (0.2.33ubuntu1) jaunty; urgency=low * debian/rules: - update debian/rules to the new python way of installing packages * command-not-found: - remove "-S" from "#!/usr/bin/python" -- Michael Vogt Mon, 02 Mar 2009 09:15:48 +0100 command-not-found (0.2.32ubuntu1) jaunty; urgency=low [ Steve Langasek ] * CommandNotFound/CommandNotFound.py: - add support for sorting by components [ Michael Vogt ] * scan.data: updated -- Michael Vogt Thu, 26 Feb 2009 16:34:20 +0100 command-not-found (0.2.31ubuntu2) jaunty; urgency=low * scan.data: fix git data (LP: #318433) by updating to the latest data -- Michael Vogt Thu, 22 Jan 2009 08:53:25 +0100 command-not-found (0.2.31ubuntu1) jaunty; urgency=low * scan.data: updated for jaunty alpha3 -- Michael Vogt Mon, 12 Jan 2009 21:08:22 +0100 command-not-found (0.2.30ubuntu1) jaunty; urgency=low [ Nick Ellery ] * Fixed spelling errors in package description (LP: #285631). [ Michael Vogt ] * add verify_scan_data.py to check against component mismatches and incorrect architecture fields * improve diff-scan-data.py -- Nick Ellery Tue, 04 Nov 2008 17:13:45 -0800 command-not-found (0.2.26ubuntu1) intrepid; urgency=low * scan.data updated to current intrepid -- Michael Vogt Wed, 15 Oct 2008 17:45:26 +0200 command-not-found (0.2.25ubuntu2) intrepid; urgency=low [ Era Eriksson ] * Print where-to-find-command, incorrect-PATH, and crash-guard messages to stderr rather than stdout (LP: #212723). [ Colin Watson ] * Fix various crash bugs in the crash handler (LP: #269821). * Adjust crash handler syntax to be friendly to Python 2.4 (LP: #234540). -- Colin Watson Wed, 15 Oct 2008 13:27:20 +0100 command-not-found (0.2.25ubuntu1) intrepid; urgency=low * command-not-found data updated for beta -- Michael Vogt Thu, 25 Sep 2008 20:43:10 +0200 command-not-found (0.2.24ubuntu1) intrepid; urgency=low * updated scan.data for alpha-6 -- Michael Vogt Fri, 12 Sep 2008 23:05:26 +0200 command-not-found (0.2.23ubuntu1) intrepid; urgency=low [ Zygmunt Krynicki ] * fix crash when PATH is unset (LP: #258572) [ Michael Vogt ] * scan.data: - updated to current intrepid -- Michael Vogt Wed, 20 Aug 2008 15:57:14 +0200 command-not-found (0.2.22ubuntu1) intrepid; urgency=low [ Zygmunt Krynicki ] * Fixed some locale issues and enchanced error reporting [ Michael Vogt ] * scan.data: - updated to current intrepid -- Michael Vogt Mon, 11 Aug 2008 18:24:21 +0200 command-not-found (0.2.21ubuntu1) intrepid; urgency=low * scan.data: - updated to current intrepid -- Michael Vogt Mon, 21 Jul 2008 14:22:17 +0200 command-not-found (0.2.20ubuntu1) intrepid; urgency=low * scan.data: - updated for intrepid -- Michael Vogt Mon, 30 Jun 2008 16:46:44 +0200 command-not-found (0.2.17ubuntu1) hardy; urgency=low * scan.data: - upated for RC -- Michael Vogt Fri, 11 Apr 2008 10:59:54 +0200 command-not-found (0.2.16ubuntu1) hardy; urgency=low * updated to latest hardy -- Michael Vogt Fri, 04 Apr 2008 10:36:34 +0200 command-not-found (0.2.15ubuntu1) hardy; urgency=low [ Kjell Braden ] * Don't run command-not-found from the shell scripts when it has been removed in the meantime (LP: #194939) [ Michael Vogt ] * CommandNotFound/CommandNotFound.py: - do not advise on ".." (LP: # 195090) - thanks to Thomas Perl - do not crash on problems with python-apt (LP: #161804) * debian/control: - improve description (LP: #144153) * command-not-found: - make the crash message a bit more friendly * use lgettext() instead of gettext() (LP: #161159) -- Michael Vogt Fri, 07 Mar 2008 10:01:20 +0100 command-not-found (0.2.14ubuntu1) hardy; urgency=low * updated data for alpha-6 * fixed bug in data extraction code for hardlinks (git-diff and friends was not in the index because of this) -- Michael Vogt Tue, 04 Mar 2008 17:00:42 +0100 command-not-found (0.2.13ubuntu1) hardy; urgency=low * updated data for alpha-5 -- Michael Vogt Tue, 19 Feb 2008 19:24:40 +0100 command-not-found (0.2.12ubuntu1) hardy; urgency=low * updated data for alpha-3 -- Michael Vogt Mon, 07 Jan 2008 15:25:11 +0100 command-not-found (0.2.11ubuntu3) hardy; urgency=low * CommandNotFound/CommandNotFound.py: When $HOME is not set, fall back to /root instead of crashing with a type error. (LP: #177934) -- Martin Pitt Thu, 03 Jan 2008 15:57:51 +0100 command-not-found (0.2.11ubuntu2) hardy; urgency=low * python-gdbm added to Depends, not just b-d -- Rick Clark Sun, 09 Dec 2007 15:51:19 -0500 command-not-found (0.2.11ubuntu1) hardy; urgency=low * fix FTBFS by adding missing b-d on python-gdbm (thanks to Michael Bienia) -- Michael Vogt Tue, 04 Dec 2007 10:52:32 +0100 command-not-found (0.2.10ubuntu1) hardy; urgency=low * command-not-found: - add --ignore-installed parameter to display the packages that have the given command even if the command is installed * updated data for hardy -- Michael Vogt Mon, 03 Dec 2007 21:43:49 +0100 command-not-found (0.2.9ubuntu1) hardy; urgency=low * switch from dbm to gdbm -- Michael Vogt Sat, 10 Nov 2007 14:51:51 -0500 command-not-found (0.2.8ubuntu2) gutsy; urgency=low * debian/control: - fix command not found description * scan.data updated to current gutsy -- Michael Vogt Sat, 06 Oct 2007 13:06:23 +0200 command-not-found (0.2.8ubuntu1) gutsy; urgency=low [ Michael Vogt ] * added missing pyhton-apt dependency (LP: #138842) [ Niklas Klein ] * CommandNotFound/CommandNotFound.py added test for propper set PATH variable. Backport from version 0.3 (LP: #111255). -- Niklas Klein Fri, 24 Sep 2007 09:33:22 +0200 command-not-found (0.2.7) gutsy; urgency=low [Zygmunt Krynicki] * data/suggestions.d: - removed * CommandNotFound/CommandNotFound.py: - fix typo in string substitution (LP: #131435) - only print components that are really required (LP: #133869) * setup.py: - move to /usr/lib, no end-user application (LP: #112411) -- Michael Vogt Wed, 22 Aug 2007 06:49:01 +0200 command-not-found (0.2.6) gutsy; urgency=low * updated command-not-found data to current gutsy -- Michael Vogt Fri, 17 Aug 2007 22:00:55 +0200 command-not-found (0.2.5) gutsy; urgency=low * Send output to stderr, not stdout (LP: #129257). -- Colin Watson Mon, 30 Jul 2007 17:12:32 +0100 command-not-found (0.2.4) feisty; urgency=low [ Michael Vogt ] * remove support for suggestins.d/ dir (not used currently and may break stuff) [ Zygmunt Krynicki ] * Fixed launchpad #95794: warning emitted about not finding group name * data files updated [ Johan Kiviniemi ] * zsh_command_not_found: unset the command variable, otherwise an empty line will rerun command-not-found. Thanks to Chris Ball for suggesting this (LP: #92942). -- Michael Vogt Tue, 10 Apr 2007 17:39:09 +0200 command-not-found (0.2.3) feisty; urgency=low [Johan Kiviniemi] * zsh_command_not_found, README, setup.py: Added support for zsh. (LP#92942, thanks!) -- Michael Vogt Fri, 16 Mar 2007 23:57:58 +0100 command-not-found (0.2.2) feisty; urgency=low * refreshed database to current feisty * set maintainer field to ubuntu -- Michael Vogt Fri, 16 Mar 2007 19:00:49 +0100 command-not-found (0.2.1) feisty; urgency=low * always return 127 to be compatible with the shell (lp: #67726) * make the message less confusing for non-admin users (Thanks to Chris Wagner for his patch, lp: #64220) * Grammar fixes (lp: #64542) -- Michael Vogt Thu, 11 Jan 2007 18:11:08 +0100 command-not-found (0.2.0) feisty; urgency=low [Zygmunt Krynicki] * applied patch from Daniel Werner * minor fixes to the suggestions database * updated the README file [Michael Vogt] * make the extraction skip package not available in the current distro release * updated the binary database with the latest feisty * show component information for other components than main -- Michael Vogt Fri, 5 Jan 2007 09:56:15 +0100 command-not-found (0.1.0) edgy; urgency=low [Zygmunt Krynicki] * updated the suggestions database * added support for update-alternative calls in the postinst (yeah!) * code cleanups [Michael Vogt] * updated the binary database wit the latest edgy * the command-not-found-data is build pre arch now -- Michael Vogt Tue, 12 Sep 2006 19:33:33 +0200 command-not-found (0.0.2) edgy; urgency=low * return 127 to bash if nothing was found in the database * update the database -- Michael Vogt Thu, 10 Aug 2006 15:05:14 +0200 command-not-found (0.0.1) edgy; urgency=low * initial release * start of the implementation of https://wiki.ubuntu.com/CommandNotFoundMagic * contains the current commands on edgy -- Michael Vogt Thu, 24 Nov 2005 16:34:54 +0100 command-not-found-20.04.2/debian/command-not-found.install0000664000000000000000000000001513546652345020244 0ustar etc/ usr/bin command-not-found-20.04.2/debian/compat0000664000000000000000000000000213546652345014531 0ustar 8 command-not-found-20.04.2/debian/control0000664000000000000000000000234213546652345014737 0ustar Source: command-not-found Section: admin Priority: optional Maintainer: Michael Vogt XSBC-Original-Maintainer: Zygmunt Krynicki Build-Depends: debhelper (>= 8), devscripts, dh-python, intltool, pyflakes3, python3-all, python3-apt, python3-distutils-extra Standards-Version: 3.9.4 XS-Vcs-Bzr: http://launchpad.net/~ubuntu-core-dev/command-not-found/ubuntu X-Python3-Version: >= 3.2 Package: command-not-found Architecture: all Depends: python3-commandnotfound (= ${binary:Version}), ${misc:Depends} Suggests: snapd Description: Suggest installation of packages in interactive bash sessions This package will install a handler for command_not_found that looks up programs not currently installed but available from the repositories. Package: python3-commandnotfound Section: python Architecture: all Replaces: command-not-found (<< 0.3ubuntu7) Depends: lsb-release, python3-apt, python3-gdbm, ${misc:Depends}, ${python3:Depends} Description: Python 3 bindings for command-not-found. This package will install the Python 3 library for command_not_found tool. command-not-found-20.04.2/debian/copyright0000664000000000000000000000072113546652345015266 0ustar This package was debianized by Michael Vogt on Fri, 31 May 2005 10:10:41 +0100. It was downloaded via bzr from https://code.launchpad.net/~zkrynicki/command-not-found/main The ubuntu source is at: https://code.edge.launchpad.net/~ubuntu-core-dev/command-not-found/ubuntu Upstream Author: Zygmunt Krynicki Michael Vogt Copyright: GPL, see /usr/share/common-licenses/GPL command-not-found-20.04.2/debian/dirs0000664000000000000000000000004213546652345014213 0ustar usr/bin var/lib/command-not-found command-not-found-20.04.2/debian/docs0000664000000000000000000000001213546652345014177 0ustar README.md command-not-found-20.04.2/debian/postinst0000664000000000000000000000153613546652345015146 0ustar #!/bin/sh # postinst script for command-not-found # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package case "$1" in configure) ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 command-not-found-20.04.2/debian/python3-commandnotfound.install0000664000000000000000000000002113546652345021511 0ustar usr/lib/python3* command-not-found-20.04.2/debian/rules0000775000000000000000000000143313546652345014414 0ustar #!/usr/bin/make -f %: dh $@ --with=python3 --buildsystem=pybuild override_dh_install: dh_install ifneq (,$(filter command-not-found,$(shell dh_listpackages))) # Move our script from /usr/bin to /usr/lib (not meant for end-users) install -d $(CURDIR)/debian/command-not-found/usr/lib mv $(CURDIR)/debian/command-not-found/usr/bin/command-not-found $(CURDIR)/debian/command-not-found/usr/lib/command-not-found mv $(CURDIR)/debian/command-not-found/usr/bin/cnf-update-db $(CURDIR)/debian/command-not-found/usr/lib/cnf-update-db rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/command-not-found/usr/bin # Get rid of bash integration script, got merged to bash rm $(CURDIR)/debian/command-not-found/etc/bash_command_not_found endif override_dh_auto_test: python3 -m unittest discover command-not-found-20.04.2/debian/tests/0000775000000000000000000000000013546652345014475 5ustar command-not-found-20.04.2/debian/tests/control0000664000000000000000000000010213546652345016071 0ustar Tests: smoke Restrictions: needs-root Depends: command-not-found command-not-found-20.04.2/debian/tests/smoke0000775000000000000000000000107213546652345015541 0ustar #!/bin/sh set -e echo "Ensure apt integration is installed" apt-config dump | grep -i Post-Invoke-Success | grep cnf-update-db echo "Ensure apt update runs without errors" apt-get update echo "Ensure we have results from c-n-f" /usr/lib/command-not-found --ignore-installed vim 2>&1 | grep vim /usr/lib/command-not-found --ignore-installed vim 2>&1 | grep vim-tiny echo "Add testuser" adduser --gecos="no" --disabled-password testuser echo "Ensure c-n-f works as user" su -l testuser -c "/usr/lib/command-not-found --ignore-installed konsole" 2>&1 | grep konsole command-not-found-20.04.2/mirror/0000775000000000000000000000000013546652345013423 5ustar command-not-found-20.04.2/mirror/do-mirror0000775000000000000000000000077613546652345015275 0ustar ARCH_LIST="i386,amd64,powerpc,sparc" DIST="$(echo $0 | cut -d - -f 3)" SECTION_LIST="main,restricted,universe,multiverse" MIRROR_HOST="archive.ubuntu.com" MIRROR_METHOD="rsync" MIRROR_ROOT=":ubuntu" OPTIONS="--verbose --nosource --progress --arch=$ARCH_LIST --dist=$DIST,$DIST-updates,$DIST-backports --section=$SECTION_LIST --ignore-release-gpg --host=$MIRROR_HOST --method=$MIRROR_METHOD --root=$MIRROR_ROOT" debmirror $OPTIONS $MIRROR_HOST MIRROR_HOST="security.ubuntu.com" debmirror $OPTIONS $MIRROR_HOST command-not-found-20.04.2/mirror/do-mirror-edgy0000777000000000000000000000000013546652345020036 2do-mirrorustar command-not-found-20.04.2/po/0000775000000000000000000000000013546652345012527 5ustar command-not-found-20.04.2/po/POTFILES.in0000664000000000000000000000013713546652345014305 0ustar [encoding: UTF-8] CommandNotFound/CommandNotFound.py command-not-found CommandNotFound/util.py command-not-found-20.04.2/po/command-not-found.pot0000664000000000000000000000776013546652345016612 0ustar # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2019-10-07 13:33+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: ../CommandNotFound/CommandNotFound.py:156 msgid "Do you want to install it? (N/y)" msgstr "" #: ../CommandNotFound/CommandNotFound.py:165 msgid "y" msgstr "" #: ../CommandNotFound/CommandNotFound.py:178 #, python-format msgid "Command '%s' not found, but there are %s similar ones." msgstr "" #: ../CommandNotFound/CommandNotFound.py:184 #, python-format msgid "Command '%s' not found, did you mean:" msgstr "" #: ../CommandNotFound/CommandNotFound.py:191 #, python-format msgid " command '%s' from snap %s%s" msgstr "" #: ../CommandNotFound/CommandNotFound.py:197 #, python-format msgid " command '%s' from deb %s%s" msgstr "" #: ../CommandNotFound/CommandNotFound.py:200 #: ../CommandNotFound/CommandNotFound.py:281 #: ../CommandNotFound/CommandNotFound.py:305 msgid "See 'snap info ' for additional versions." msgstr "" #: ../CommandNotFound/CommandNotFound.py:203 #: ../CommandNotFound/CommandNotFound.py:205 #, python-format msgid "Try: %s " msgstr "" #: ../CommandNotFound/CommandNotFound.py:211 #, python-format msgid "Command '%(command)s' not found, but can be installed with:" msgstr "" #: ../CommandNotFound/CommandNotFound.py:224 #: ../CommandNotFound/CommandNotFound.py:238 msgid "Please ask your administrator." msgstr "" #: ../CommandNotFound/CommandNotFound.py:240 #, python-format msgid "You will have to enable the component called '%s'" msgstr "" #: ../CommandNotFound/CommandNotFound.py:262 #, python-format msgid "You will have to enable component called '%s'" msgstr "" #: ../CommandNotFound/CommandNotFound.py:265 msgid "Ask your administrator to install one of them." msgstr "" #: ../CommandNotFound/CommandNotFound.py:303 #, python-format msgid "See 'snap info %s' for additional versions." msgstr "" #: ../CommandNotFound/CommandNotFound.py:330 #, python-format msgid "Command '%(command)s' is available in '%(place)s'" msgstr "" #: ../CommandNotFound/CommandNotFound.py:332 #, python-format msgid "Command '%(command)s' is available in the following places" msgstr "" #: ../CommandNotFound/CommandNotFound.py:337 #, python-format msgid "" "The command could not be located because '%s' is not included in the PATH " "environment variable." msgstr "" #: ../CommandNotFound/CommandNotFound.py:339 msgid "" "This is most likely caused by the lack of administrative privileges " "associated with your user account." msgstr "" #: ../command-not-found:77 #, c-format msgid "%prog [options] " msgstr "" #: ../command-not-found:80 msgid "use this path to locate data fields" msgstr "" #: ../command-not-found:83 msgid "ignore local binaries and display the available packages" msgstr "" #: ../command-not-found:86 msgid "don't print ': command not found'" msgstr "" #: ../command-not-found:92 msgid "" "Could not find command-not-found database. Run sudo apt update to populate " "it." msgstr "" #: ../command-not-found:93 ../command-not-found:96 #, c-format msgid "%s: command not found" msgstr "" #: ../CommandNotFound/util.py:25 msgid "Sorry, command-not-found has crashed! Please file a bug report at:" msgstr "" #: ../CommandNotFound/util.py:27 msgid "Please include the following information with the report:" msgstr "" #: ../CommandNotFound/util.py:29 #, python-format msgid "command-not-found version: %s" msgstr "" #: ../CommandNotFound/util.py:30 #, python-format msgid "Python version: %d.%d.%d %s %d" msgstr "" #: ../CommandNotFound/util.py:36 msgid "Exception information:" msgstr "" command-not-found-20.04.2/po/de.po0000664000000000000000000000355513546652345013467 0ustar # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-03-20 18:10+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../CommandNotFound/CommandNotFound.py:135 msgid "Ubuntu has the following similar programs" msgstr "Ubuntu hat die folgenden ähnlichen Programme" #: ../CommandNotFound/CommandNotFound.py:139 #, python-format msgid "The program '%s' is currently not installed. " msgstr "" #: ../CommandNotFound/CommandNotFound.py:141 #: ../CommandNotFound/CommandNotFound.py:144 msgid "You can install it by typing:" msgstr "" #: ../CommandNotFound/CommandNotFound.py:147 #, python-format msgid "" "To run '%(command)s' please ask your administrator to install the package '%" "(package)s'" msgstr "" #: ../CommandNotFound/CommandNotFound.py:149 #: ../CommandNotFound/CommandNotFound.py:161 #, python-format msgid "Make sure you have the '%s' component enabled" msgstr "" #: ../CommandNotFound/CommandNotFound.py:151 #, python-format msgid "The program '%s' can be found in the following packages:" msgstr "" #: ../CommandNotFound/CommandNotFound.py:155 #: ../CommandNotFound/CommandNotFound.py:157 #, python-format msgid "Try: %s " msgstr "" #: ../CommandNotFound/CommandNotFound.py:159 msgid "Ask your administrator to install one of them" msgstr "" #: ../command-not-found:18 #, c-format msgid "%prog [options] " msgstr "" #: ../command-not-found:20 msgid "use this path to locate data fields" msgstr "" command-not-found-20.04.2/po/fr.po0000664000000000000000000000446513546652345013507 0ustar msgid "" msgstr "" "Project-Id-Version: command-not-found\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-03-20 18:10+0100\n" "PO-Revision-Date: 2007-03-20 13:50+0100\n" "Last-Translator: Bruno Bord \n" "Language-Team: Bruno Bord \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: French\n" "X-Poedit-Country: FRANCE\n" "X-Poedit-SourceCharset: utf-8\n" #: ../CommandNotFound/CommandNotFound.py:135 msgid "Ubuntu has the following similar programs" msgstr "Ubuntu possède les programmes similaires suivants" #: ../CommandNotFound/CommandNotFound.py:139 #, fuzzy, python-format msgid "The program '%s' is currently not installed. " msgstr "" "Le programme '%s' n'est pas installé actuellement, vous pouvez l'installer " "en tapant :" #: ../CommandNotFound/CommandNotFound.py:141 #: ../CommandNotFound/CommandNotFound.py:144 msgid "You can install it by typing:" msgstr "" #: ../CommandNotFound/CommandNotFound.py:147 #, python-format msgid "" "To run '%(command)s' please ask your administrator to install the package '%" "(package)s'" msgstr "" "Pour lancer '%(command)s', veuillez prendre contact avec votre " "administrateur pour installer le paquet '%(package)s'" #: ../CommandNotFound/CommandNotFound.py:149 #: ../CommandNotFound/CommandNotFound.py:161 #, python-format msgid "Make sure you have the '%s' component enabled" msgstr "Assurez-vous que vous avez le composant '%s' activé" #: ../CommandNotFound/CommandNotFound.py:151 #, python-format msgid "The program '%s' can be found in the following packages:" msgstr "Le programme '%s' peut être trouvé dans les paquets suivants :" #: ../CommandNotFound/CommandNotFound.py:155 #: ../CommandNotFound/CommandNotFound.py:157 #, python-format msgid "Try: %s " msgstr "Essayez : %s " #: ../CommandNotFound/CommandNotFound.py:159 msgid "Ask your administrator to install one of them" msgstr "Demandez à votre administrateur d'installer un ceux-là" #: ../command-not-found:18 #, c-format msgid "%prog [options] " msgstr "%prog [options] " #: ../command-not-found:20 msgid "use this path to locate data fields" msgstr "utilisez ce chemin pour localiser les champs de données" command-not-found-20.04.2/po/pl.po0000664000000000000000000000445213546652345013507 0ustar # Copyright (C) 2005, Zygmunt Krynicki # This file is distributed under the same license as the command-not-found package. # Zygmunt Krynicki , 2005 msgid "" msgstr "" "Project-Id-Version: command-not-found 0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2007-03-20 18:10+0100\n" "PO-Revision-Date: 2005-11-25 00:49:+0100\n" "Last-Translator: Zygmunt Krynicki \n" "Language-Team: Polish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../CommandNotFound/CommandNotFound.py:135 msgid "Ubuntu has the following similar programs" msgstr "Ubuntu zawiera następujące podobne programy" #: ../CommandNotFound/CommandNotFound.py:139 #, python-format msgid "The program '%s' is currently not installed. " msgstr "Program %s nie jest obecnie zainstalowany. " #: ../CommandNotFound/CommandNotFound.py:141 #: ../CommandNotFound/CommandNotFound.py:144 msgid "You can install it by typing:" msgstr "Możesz go zainstalować wpisując:" #: ../CommandNotFound/CommandNotFound.py:147 #, python-format msgid "" "To run '%(command)s' please ask your administrator to install the package '%" "(package)s'" msgstr "" "Aby uruchomić '%(commands)s' poproś swojego administratora o zainstalowanie " "pakietu '%(package)s'" #: ../CommandNotFound/CommandNotFound.py:149 #: ../CommandNotFound/CommandNotFound.py:161 #, python-format msgid "Make sure you have the '%s' component enabled" msgstr "Upewnij się, że masz dostęp do repozytorium '%s'" #: ../CommandNotFound/CommandNotFound.py:151 #, python-format msgid "The program '%s' can be found in the following packages:" msgstr "Program '%s' można znaleźć w następujących pakietch:" #: ../CommandNotFound/CommandNotFound.py:155 #: ../CommandNotFound/CommandNotFound.py:157 #, python-format msgid "Try: %s " msgstr "Spróbuj: %s " #: ../CommandNotFound/CommandNotFound.py:159 msgid "Ask your administrator to install one of them" msgstr "Poproś swojego administratora o zainstalowanie jednego z nich" #: ../command-not-found:18 #, c-format msgid "%prog [options] " msgstr "%prog [opcje] " #: ../command-not-found:20 msgid "use this path to locate data fields" msgstr "użyj tej ścieżki aby zlokalizowac pliki z danymi" command-not-found-20.04.2/pre-build.sh0000775000000000000000000000013213546652345014327 0ustar #!/bin/sh set -x # I don't want to have the scan.data stuff in bzr ./update-from-web.sh command-not-found-20.04.2/setup.py0000775000000000000000000000117313546652345013630 0ustar #!/usr/bin/python3 from distutils.core import setup from DistUtilsExtra.command import (build_extra, build_i18n) import glob setup( name='command-not-found', version='0.3', packages=['CommandNotFound', 'CommandNotFound.db'], scripts=['command-not-found', 'cnf-update-db'], cmdclass={"build": build_extra.build_extra, "build_i18n": build_i18n.build_i18n, }, data_files=[ ('share/command-not-found/', glob.glob("data/*.db")), ('../etc', ['bash_command_not_found', 'zsh_command_not_found']), ('../etc/apt/apt.conf.d', ['data/50command-not-found']), ]) command-not-found-20.04.2/test/0000775000000000000000000000000013546652345013070 5ustar command-not-found-20.04.2/test/data/0000775000000000000000000000000013546652345014001 5ustar command-not-found-20.04.2/test/data/java.data0000664000000000000000000000013213546652345015551 0ustar # fixes bug #853688 all|main|default-jre|java,jexec all|main|default-jdk|javac,javadoc,jarcommand-not-found-20.04.2/update-from-web.sh0000775000000000000000000000047613546652345015455 0ustar #!/bin/sh set -e distro=$(dpkg-parsechangelog -S Distribution) cd CommandNotFound/db # the commands-not-found data is currently extracted here mkdir -p dists scp -r nusakan.canonical.com:~mvo/cnf-extractor/command-not-found-extractor/dists/${distro}* dists/ find dists/ -name "*.xz" -o -name "*.gz" | xargs rm -f command-not-found-20.04.2/zsh_command_not_found0000664000000000000000000000073513546652345016416 0ustar # (c) Zygmunt Krynicki 2007, # Licensed under GPL, see COPYING for the whole text # # This script will look-up command in the database and suggest # installation of packages available from the repository if [[ -x /usr/lib/command-not-found ]] ; then if (( ! ${+functions[command_not_found_handler]} )) ; then function command_not_found_handler { [[ -x /usr/lib/command-not-found ]] || return 1 /usr/lib/command-not-found --no-failure-msg -- ${1+"$1"} && : } fi fi