<commit_before>/*
 * Copyright (c) 2007, Novell Inc.
 *
 * This program is licensed under the BSD license, read LICENSE.BSD
 * for further information
 */

/*
 * poolarch.c
 *
 * create architecture policies
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "pool.h"
#include "poolid.h"
#include "poolarch.h"
#include "util.h"

static const char *archpolicies[] = {
  "x86_64",	"x86_64:i686:i586:i486:i386",
  "i686",	"i686:i586:i486:i386",
  "i586",	"i586:i486:i386",
  "i486",	"i486:i386",
  "i386",	"i386",
  "s390x",	"s390x:s390",
  "s390",	"s390",
  "ia64",	"ia64:i686:i586:i486:i386",
  "ppc64",	"ppc64:ppc",
  "ppc",	"ppc",
  "ppc64p7",	"ppc64p7:ppc64:ppc",
  "aarch64",	"aarch64",
  "armv6hl",	"armv6hl",
  "armv7hnl",	"armv7hnl:armv7hl:armv6hl",
  "armv7hl",	"armv7hl:armv6hl",
  "armv7l",	"armv7l:armv6l:armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
  "armv6l",	"armv6l:armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
  "armv5tejl",	"armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
  "armv5tel",	"armv5tel:armv5l:armv4tl:armv4l:armv3l",
  "armv5tl",	"armv5l:armv4tl:armv4l:armv3l",
  "armv5l",	"armv5l:armv4tl:armv4l:armv3l",
  "armv4tl",	"armv4tl:armv4l:armv3l",
  "armv4l",	"armv4l:armv3l",
  "armv3l",	"armv3l",
  "sh3",	"sh3",
  "sh4",	"sh4",
  "sh4a",	"sh4a:sh4",
  "sparc64v",	"sparc64v:sparc64:sparcv9v:sparcv9:sparcv8:sparc",
  "sparc64",	"sparc64:sparcv9:sparcv8:sparc",
  "sparcv9v",	"sparcv9v:sparcv9:sparcv8:sparc",
  "sparcv9",	"sparcv9:sparcv8:sparc",
  "sparcv8",	"sparcv8:sparc",
  "sparc",	"sparc",
  0
};

void
pool_setarch(Pool *pool, const char *arch)
{
  if (arch)
    {
      int i;

      /* convert arch to known policy */
      for (i = 0; archpolicies[i]; i += 2)
	if (!strcmp(archpolicies[i], arch))
	  break;
      if (archpolicies[i])
	arch = archpolicies[i + 1];
      else
	arch = "";
    }
  pool_setarchpolicy(pool, arch);
}

/*
 * we support three relations:
 *
 * a = b   both architectures a and b are treated as equivalent
 * a > b   a is considered a "better" architecture, the solver<commit_msg>Add mipsel architecture<commit_after>/*
 * Copyright (c) 2007, Novell Inc.
 *
 * This program is licensed under the BSD license, read LICENSE.BSD
 * for further information
 */

/*
 * poolarch.c
 *
 * create architecture policies
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "pool.h"
#include "poolid.h"
#include "poolarch.h"
#include "util.h"

static const char *archpolicies[] = {
  "x86_64",	"x86_64:i686:i586:i486:i386",
  "i686",	"i686:i586:i486:i386",
  "i586",	"i586:i486:i386",
  "i486",	"i486:i386",
  "i386",	"i386",
  "s390x",	"s390x:s390",
  "s390",	"s390",
  "ia64",	"ia64:i686:i586:i486:i386",
  "ppc64",	"ppc64:ppc",
  "ppc",	"ppc",
  "ppc64p7",	"ppc64p7:ppc64:ppc",
  "aarch64",	"aarch64",
  "armv6hl",	"armv6hl",
  "armv7hnl",	"armv7hnl:armv7hl:armv6hl",
  "armv7hl",	"armv7hl:armv6hl",
  "armv7l",	"armv7l:armv6l:armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
  "armv6l",	"armv6l:armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
  "armv5tejl",	"armv5tejl:armv5tel:armv5l:armv4tl:armv4l:armv3l",
  "armv5tel",	"armv5tel:armv5l:armv4tl:armv4l:armv3l",
  "armv5tl",	"armv5l:armv4tl:armv4l:armv3l",
  "armv5l",	"armv5l:armv4tl:armv4l:armv3l",
  "armv4tl",	"armv4tl:armv4l:armv3l",
  "armv4l",	"armv4l:armv3l",
  "armv3l",	"armv3l",
  "sh3",	"sh3",
  "sh4",	"sh4",
  "sh4a",	"sh4a:sh4",
  "sparc64v",	"sparc64v:sparc64:sparcv9v:sparcv9:sparcv8:sparc",
  "sparc64",	"sparc64:sparcv9:sparcv8:sparc",
  "sparcv9v",	"sparcv9v:sparcv9:sparcv8:sparc",
  "sparcv9",	"sparcv9:sparcv8:sparc",
  "sparcv8",	"sparcv8:sparc",
  "sparc",	"sparc",
  "mipsel",	"mipsel",
  0
};

void
pool_setarch(Pool *pool, const char *arch)
{
  if (arch)
    {
      int i;

      /* convert arch to known policy */
      for (i = 0; archpolicies[i]; i += 2)
	if (!strcmp(archpolicies[i], arch))
	  break;
      if (archpolicies[i])
	arch = archpolicies[i + 1];
      else
	arch = "";
    }
  pool_setarchpolicy(pool, arch);
}

/*
 * we support three relations:
 *
 * a = b   both architectures a and b are treated as equivalent
 * a > b   a is considered a "better" architecture, the solver
{'fraction_non_alphanumeric': 0.18690248565965584, 'fraction_numerical': 0.09847036328871893, 'mean_word_length': 4.836820083682008, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7436621', 'n_tokens_mistral': 2316, 'n_tokens_neox': 2135, 'n_words': 337}