{
char *version = pkg_version_str_alloc(pkg);
char *description = pkg_get_string(pkg, PKG_DESCRIPTION);
- printf("%s - %s", pkg->name, version);
+ const char *abiver;
+ char *tmp, *tmpname = NULL;
+
+ if (conf->strip_abi &&
+ (abiver = pkg_get_string(pkg, PKG_ABIVERSION)) &&
+ (strlen(pkg->name) > strlen(abiver))) {
+ tmpname = strdup(pkg->name);
+ tmp = &tmpname[strlen(tmpname) - strlen(abiver)];
+ if (!strncmp(abiver, tmp, strlen(abiver)))
+ *tmp = '\0';
+ };
+
+ printf("%s - %s", tmpname?tmpname:pkg->name, version);
+
+ if (tmpname)
+ free(tmpname);
+
if (conf->size)
printf(" - %lu", (unsigned long) pkg_get_int(pkg, PKG_SIZE));
if (description)
char *description = pkg_get_string(pkg, PKG_DESCRIPTION);
char *version = pkg_version_str_alloc(pkg);
struct opkg_list_find_cmd_item *item;
- char *nameptr, *versionptr, *descriptionptr;
+ char *nameptr, *versionptr, *descriptionptr, *tmp;
+ const char *abiver;
int i, found = 0;
/* if we have package name or pattern and pkg does not match, then skip it */
&descriptionptr, description ? strlen(description) + 1 : 0);
item->name = strcpy(nameptr, pkg->name);
+
+ if (conf->strip_abi &&
+ (abiver = pkg_get_string(pkg, PKG_ABIVERSION)) &&
+ (strlen(item->name) > strlen(abiver))) {
+ tmp = &item->name[strlen(item->name) - strlen(abiver)];
+ if (!strncmp(abiver, tmp, strlen(abiver)))
+ *tmp = '\0';
+ };
+
item->size = pkg_get_int(pkg, PKG_SIZE);
item->version = strcpy(versionptr, version);
item->description = description ? strcpy(descriptionptr, description) : NULL;
{"proxy_user", OPKG_OPT_TYPE_STRING, &_conf.proxy_user},
{"query-all", OPKG_OPT_TYPE_BOOL, &_conf.query_all},
{"size", OPKG_OPT_TYPE_BOOL, &_conf.size},
+ {"strip_abi", OPKG_OPT_TYPE_BOOL, &_conf.strip_abi},
{"tmp_dir", OPKG_OPT_TYPE_STRING, &_conf.tmp_dir},
{"verbosity", OPKG_OPT_TYPE_INT, &_conf.verbosity},
{"verify_program", OPKG_OPT_TYPE_STRING, &_conf.verify_program},
char *verify_program;
int noaction;
int size;
+ int strip_abi;
int download_only;
char *cache;
ARGS_OPT_NO_CHECK_CERTIFICATE,
ARGS_OPT_VERIFY_PROGRAM,
ARGS_OPT_SIZE,
+ ARGS_OPT_STRIP_ABI,
};
static struct option long_options[] = {
{"add-arch", 1, 0, ARGS_OPT_ADD_ARCH},
{"add-dest", 1, 0, ARGS_OPT_ADD_DEST},
{"size", 0, 0, ARGS_OPT_SIZE},
+ {"strip-abi", 0, 0, ARGS_OPT_STRIP_ABI},
+ {"strip_abi", 0, 0, ARGS_OPT_STRIP_ABI},
{"test", 0, 0, ARGS_OPT_NOACTION},
{"tmp-dir", 1, 0, 't'},
{"tmp_dir", 1, 0, 't'},
case ARGS_OPT_VERIFY_PROGRAM:
conf->verify_program = xstrdup(optarg);
break;
+ case ARGS_OPT_STRIP_ABI:
+ conf->strip_abi = 1;
+ break;
case ':':
parse_err = -1;
break;
("\t--nocase Perform case insensitive pattern matching\n");
printf
("\t--size Print package size when listing available packages\n");
+ printf
+ ("\t--strip-abi Print package name without appended ABI version\n");
printf("\t--force-removal-of-dependent-packages\n");
printf("\t Remove package and all dependencies\n");
printf("\t--autoremove Remove packages that were installed\n");