Do not treat repositories with trailing '/' chars as invalid.
This commit is contained in:
parent
95804bdb77
commit
233d9f4803
3
NEWS
3
NEWS
@ -1,5 +1,8 @@
|
||||
xbps-0.12.0 (???):
|
||||
|
||||
* Fixed registerring repositories with trailing '/' chars in
|
||||
configuration file: xbps.conf.
|
||||
|
||||
* xbps-repo(8): the 'genindex' target now creates a plist file to cache
|
||||
all files provided by binary packages in a repository. This makes
|
||||
the 'find-files' target marginally faster, because this avoids having
|
||||
|
@ -42,8 +42,8 @@
|
||||
# or name will be used.
|
||||
#
|
||||
# By default we use the official "public" repositories. You can add
|
||||
# your own repositories by specifying the path (without the trailing
|
||||
# '/' character) to the directory where the index.plist file is stored.
|
||||
# your own repositories by specifying the path to the directory
|
||||
# where the index.plist file is stored.
|
||||
#
|
||||
# Repositories not matching the host architecture are simply ignored.
|
||||
#
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <libgen.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
@ -46,21 +47,18 @@ static bool
|
||||
check_repo_arch(const char *uri)
|
||||
{
|
||||
struct utsname un;
|
||||
char *p;
|
||||
char *p, *b;
|
||||
|
||||
if ((p = strdup(uri)) == NULL)
|
||||
return false;
|
||||
|
||||
uname(&un);
|
||||
p = strrchr(uri, '/');
|
||||
if (p == NULL)
|
||||
b = basename(p);
|
||||
free(p);
|
||||
if ((strcmp(b, "noarch")) && (strcmp(b, un.machine)))
|
||||
return false;
|
||||
p++;
|
||||
if (*p == '\0')
|
||||
return false;
|
||||
else if (strcmp(p, "noarch") == 0)
|
||||
return true;
|
||||
else if (strcmp(p, un.machine) == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
int HIDDEN
|
||||
|
Loading…
Reference in New Issue
Block a user