command-not-found: Use arch-specific command list
This commit is contained in:
parent
2b61e3a317
commit
c3175fe791
@ -1,6 +1,6 @@
|
|||||||
TERMUX_PKG_HOMEPAGE=https://termux.com
|
TERMUX_PKG_HOMEPAGE=https://termux.com
|
||||||
TERMUX_PKG_DESCRIPTION="Suggest installation of packages in interactive shell sessions"
|
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_step_make_install () {
|
||||||
TERMUX_LIBEXEC_DIR=$TERMUX_PREFIX/libexec/termux
|
TERMUX_LIBEXEC_DIR=$TERMUX_PREFIX/libexec/termux
|
||||||
|
@ -2,7 +2,19 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.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) {
|
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));
|
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) {
|
} else if (best_distance == distance) {
|
||||||
guesses_at_best_distance++;
|
guesses_at_best_distance++;
|
||||||
} else if (best_distance == -1 || best_distance > distance) {
|
} else if (best_distance == -1 || best_distance > distance) {
|
||||||
guesses_at_best_distance = 0;
|
guesses_at_best_distance = 1;
|
||||||
best_distance = distance;
|
best_distance = distance;
|
||||||
strncpy(best_command_guess, binary_name, sizeof(best_command_guess));
|
strncpy(best_command_guess, binary_name, sizeof(best_command_guess));
|
||||||
strncpy(best_package_guess, current_package, sizeof(best_package_guess));
|
strncpy(best_package_guess, current_package, sizeof(best_package_guess));
|
||||||
|
3197
packages/command-not-found/commands-aarch64.h
Normal file
3197
packages/command-not-found/commands-aarch64.h
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
3182
packages/command-not-found/commands-i686.h
Normal file
3182
packages/command-not-found/commands-i686.h
Normal file
File diff suppressed because it is too large
Load Diff
3178
packages/command-not-found/commands-x86_64.h
Normal file
3178
packages/command-not-found/commands-x86_64.h
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user