Browse Source

command-not-found: Use arch-specific command list

android-5
Fredrik Fornwall 6 years ago
parent
commit
82ea8b5367
  1. 2
      packages/command-not-found/build.sh
  2. 16
      packages/command-not-found/command-not-found.c
  3. 3197
      packages/command-not-found/commands-aarch64.h
  4. 3646
      packages/command-not-found/commands-arm.h
  5. 3182
      packages/command-not-found/commands-i686.h
  6. 3178
      packages/command-not-found/commands-x86_64.h

2
packages/command-not-found/build.sh

@ -1,6 +1,6 @@
TERMUX_PKG_HOMEPAGE=https://termux.com
TERMUX_PKG_DESCRIPTION="Suggest installation of packages in interactive shell sessions"
TERMUX_PKG_VERSION=1.34
TERMUX_PKG_VERSION=1.35
termux_step_make_install () {
TERMUX_LIBEXEC_DIR=$TERMUX_PREFIX/libexec/termux

16
packages/command-not-found/command-not-found.c

@ -2,7 +2,19 @@
#include <string.h>
#include <stdbool.h>
#include "commands.h"
char const* const commands[] = {
#ifdef __aarch64__
# include "commands-aarch64.h"
#elif defined __arm__
# include "commands-arm.h"
#elif defined __x86_64__
# include "commands-x86_64.h"
#elif defined __i686__
# include "commands-i686.h"
#else
# error Failed to detect arch
#endif
};
static inline int termux_min3(unsigned int a, unsigned int b, unsigned int c) {
return (a < b ? (a < c ? a : c) : (b < c ? b : c));
@ -52,7 +64,7 @@ int main(int argc, char** argv) {
} else if (best_distance == distance) {
guesses_at_best_distance++;
} else if (best_distance == -1 || best_distance > distance) {
guesses_at_best_distance = 0;
guesses_at_best_distance = 1;
best_distance = distance;
strncpy(best_command_guess, binary_name, sizeof(best_command_guess));
strncpy(best_package_guess, current_package, sizeof(best_package_guess));

3197
packages/command-not-found/commands-aarch64.h

File diff suppressed because it is too large

3646
packages/command-not-found/commands.h → packages/command-not-found/commands-arm.h

File diff suppressed because it is too large

3182
packages/command-not-found/commands-i686.h

File diff suppressed because it is too large

3178
packages/command-not-found/commands-x86_64.h

File diff suppressed because it is too large
Loading…
Cancel
Save