mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Moved some decls to make the "pkg_invalid" patch compile again.
This commit is contained in:
parent
77f6bcfa3d
commit
35a9f3e7d0
@ -235,6 +235,8 @@ pmpkg_t *_alpm_pkg_load(char *pkgfile)
|
|||||||
register struct archive *archive;
|
register struct archive *archive;
|
||||||
struct archive_entry *entry;
|
struct archive_entry *entry;
|
||||||
pmpkg_t *info = NULL;
|
pmpkg_t *info = NULL;
|
||||||
|
char *descfile = NULL;
|
||||||
|
int fd = -1;
|
||||||
|
|
||||||
if(pkgfile == NULL || strlen(pkgfile) == 0) {
|
if(pkgfile == NULL || strlen(pkgfile) == 0) {
|
||||||
RET_ERR(PM_ERR_WRONG_ARGS, NULL);
|
RET_ERR(PM_ERR_WRONG_ARGS, NULL);
|
||||||
@ -261,9 +263,6 @@ pmpkg_t *_alpm_pkg_load(char *pkgfile)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(!strcmp(archive_entry_pathname (entry), ".PKGINFO")) {
|
if(!strcmp(archive_entry_pathname (entry), ".PKGINFO")) {
|
||||||
char *descfile;
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
/* extract this file into /tmp. it has info for us */
|
/* extract this file into /tmp. it has info for us */
|
||||||
descfile = strdup("/tmp/alpm_XXXXXX");
|
descfile = strdup("/tmp/alpm_XXXXXX");
|
||||||
fd = mkstemp(descfile);
|
fd = mkstemp(descfile);
|
||||||
@ -351,9 +350,13 @@ pmpkg_t *_alpm_pkg_load(char *pkgfile)
|
|||||||
|
|
||||||
pkg_invalid:
|
pkg_invalid:
|
||||||
pm_errno = PM_ERR_PKG_INVALID;
|
pm_errno = PM_ERR_PKG_INVALID;
|
||||||
|
if(descfile) {
|
||||||
unlink(descfile);
|
unlink(descfile);
|
||||||
FREE(descfile);
|
FREE(descfile);
|
||||||
|
}
|
||||||
|
if(fd != -1) {
|
||||||
close(fd);
|
close(fd);
|
||||||
|
}
|
||||||
error:
|
error:
|
||||||
FREEPKG(info);
|
FREEPKG(info);
|
||||||
archive_read_finish (archive);
|
archive_read_finish (archive);
|
||||||
|
Loading…
Reference in New Issue
Block a user