xbps-repo: more exact pkg extension check.
This commit is contained in:
parent
f0ab396036
commit
c34e564327
@ -40,7 +40,7 @@ cachedir_clean(struct xbps_handle *xhp)
|
|||||||
DIR *dirp;
|
DIR *dirp;
|
||||||
struct dirent *dp;
|
struct dirent *dp;
|
||||||
const char *pkgver, *rsha256;
|
const char *pkgver, *rsha256;
|
||||||
char *binpkg;
|
char *binpkg, *ext;
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
|
|
||||||
if ((dirp = opendir(xhp->cachedir)) == NULL)
|
if ((dirp = opendir(xhp->cachedir)) == NULL)
|
||||||
@ -52,7 +52,9 @@ cachedir_clean(struct xbps_handle *xhp)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* only process xbps binary packages, ignore something else */
|
/* only process xbps binary packages, ignore something else */
|
||||||
if (!strstr(dp->d_name, ".xbps")) {
|
if ((ext = strrchr(dp->d_name, '.')) == NULL)
|
||||||
|
continue;
|
||||||
|
if (strcmp(ext, ".xbps")) {
|
||||||
printf("ignoring unknown file: %s\n", dp->d_name);
|
printf("ignoring unknown file: %s\n", dp->d_name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ repo_remove_obsoletes(struct xbps_handle *xhp, const char *repodir)
|
|||||||
DIR *dirp;
|
DIR *dirp;
|
||||||
struct dirent *dp;
|
struct dirent *dp;
|
||||||
const char *pkgver, *arch;
|
const char *pkgver, *arch;
|
||||||
char *plist;
|
char *plist, *ext;
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
|
|
||||||
if ((plist = xbps_pkg_index_plist(xhp, repodir)) == NULL)
|
if ((plist = xbps_pkg_index_plist(xhp, repodir)) == NULL)
|
||||||
@ -77,7 +77,9 @@ repo_remove_obsoletes(struct xbps_handle *xhp, const char *repodir)
|
|||||||
while ((dp = readdir(dirp))) {
|
while ((dp = readdir(dirp))) {
|
||||||
if (strcmp(dp->d_name, "..") == 0)
|
if (strcmp(dp->d_name, "..") == 0)
|
||||||
continue;
|
continue;
|
||||||
if (!strstr(dp->d_name, ".xbps"))
|
if ((ext = strrchr(dp->d_name, '.')) == NULL)
|
||||||
|
continue;
|
||||||
|
if (strcmp(ext, ".xbps"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pkgd = xbps_dictionary_metadata_plist_by_url(dp->d_name,
|
pkgd = xbps_dictionary_metadata_plist_by_url(dp->d_name,
|
||||||
|
Loading…
Reference in New Issue
Block a user