Imported from pacman-2.7.4.tar.gz
This commit is contained in:
parent
617b904b26
commit
a11fb0b581
14 changed files with 189 additions and 3190 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,5 +1,15 @@
|
||||||
VERSION DESCRIPTION
|
VERSION DESCRIPTION
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
|
2.7.4 - fixed a bug in conflict handling, where installing a
|
||||||
|
conflicting package would fail even if the new package
|
||||||
|
"provided" it
|
||||||
|
- if pacman sees a newer version of itself during an upgrade,
|
||||||
|
it will ask to install itself first, then be re-run to upgrade
|
||||||
|
the other packages.
|
||||||
|
- You can now use the --info option with --sync to display an
|
||||||
|
uninstalled package's dependency info.
|
||||||
|
- Added a sane umask before db writes
|
||||||
|
- buffer overflow fix (bug #442)
|
||||||
2.7.3 - makepkg not longer strips files with .exe or .dll extensions
|
2.7.3 - makepkg not longer strips files with .exe or .dll extensions
|
||||||
- Added Aurelien's patch:
|
- Added Aurelien's patch:
|
||||||
- proxy support (no authentication yet)
|
- proxy support (no authentication yet)
|
||||||
|
|
|
@ -34,7 +34,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||||
|
|
||||||
PACVER = 2.7.3
|
PACVER = 2.7.4
|
||||||
|
|
||||||
TOPDIR = @srcdir@
|
TOPDIR = @srcdir@
|
||||||
SRCDIR = $(TOPDIR)/src/
|
SRCDIR = $(TOPDIR)/src/
|
||||||
|
|
6
TODO
6
TODO
|
@ -3,13 +3,7 @@
|
||||||
- replaces code doesn't run with -U or -A
|
- replaces code doesn't run with -U or -A
|
||||||
- when performing replaces, pacman should not remove old packages until
|
- when performing replaces, pacman should not remove old packages until
|
||||||
the conflict checks are passed
|
the conflict checks are passed
|
||||||
- --info should work with --sync to display dependencies
|
|
||||||
- add an ETA to the download progress bar
|
|
||||||
- add HTTP/1.1 support
|
|
||||||
- fix the broken pipe bug
|
|
||||||
- handle version comparators in makepkg dep resolution (eg, glibc>=2.2.5)
|
- handle version comparators in makepkg dep resolution (eg, glibc>=2.2.5)
|
||||||
- add post_remove, pre_install, pre_upgrade functions to scriptlets
|
- add post_remove, pre_install, pre_upgrade functions to scriptlets
|
||||||
? record md5sums of all files in a package
|
|
||||||
? use 'set -e' in makepkg?
|
|
||||||
- check $PACCONF env var
|
- check $PACCONF env var
|
||||||
- add a --pretend option
|
- add a --pretend option
|
||||||
|
|
|
@ -100,6 +100,11 @@ diskspace, you can remove these packages by using the --clean option.
|
||||||
Display all the members for each package group specified. If no group
|
Display all the members for each package group specified. If no group
|
||||||
names are provided, all groups will be listed.
|
names are provided, all groups will be listed.
|
||||||
.TP
|
.TP
|
||||||
|
.B "\-i, \-\-info"
|
||||||
|
Display dependency information for a given package. This will search
|
||||||
|
through all repositories for a matching package and display the
|
||||||
|
dependencies, conflicts, etc.
|
||||||
|
.TP
|
||||||
.B "\-l, \-\-list"
|
.B "\-l, \-\-list"
|
||||||
List all files in the specified repositories. Multiple repositories can
|
List all files in the specified repositories. Multiple repositories can
|
||||||
be specified on the command line.
|
be specified on the command line.
|
||||||
|
|
|
@ -5,6 +5,11 @@
|
||||||
# move it to the top of the server list, so pacman will choose it
|
# move it to the top of the server list, so pacman will choose it
|
||||||
# first.
|
# first.
|
||||||
#
|
#
|
||||||
|
# To re-sort your mirror lists by ping/traceroute results, use the
|
||||||
|
# /usr/bin/sortmirrors.pl script. It requires the "netselect" package.
|
||||||
|
#
|
||||||
|
# # sortmirrors.pl </etc/pacman.conf >pacman.conf.new
|
||||||
|
#
|
||||||
|
|
||||||
# See the pacman manpage for option directives
|
# See the pacman manpage for option directives
|
||||||
|
|
||||||
|
@ -25,10 +30,10 @@ NoUpgrade = etc/lilo.conf boot/grub/menu.lst
|
||||||
#
|
#
|
||||||
[current]
|
[current]
|
||||||
Server = ftp://ftp.archlinux.org/current
|
Server = ftp://ftp.archlinux.org/current
|
||||||
|
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/current
|
||||||
Server = ftp://ftp.archlinux.de/pub/archlinux/current
|
Server = ftp://ftp.archlinux.de/pub/archlinux/current
|
||||||
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/current
|
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/current
|
||||||
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/current
|
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/current
|
||||||
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/current
|
|
||||||
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/current
|
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/current
|
||||||
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/current
|
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/current
|
||||||
Server = ftp://ftp.kegep.tuc.gr/archlinux/current
|
Server = ftp://ftp.kegep.tuc.gr/archlinux/current
|
||||||
|
@ -41,12 +46,12 @@ Server = ftp://ftp.rez-gif.supelec.fr/pub/Linux/distrib/archlinux/current
|
||||||
# Uncomment this block to access the EXTRA package set
|
# Uncomment this block to access the EXTRA package set
|
||||||
#
|
#
|
||||||
[extra]
|
[extra]
|
||||||
Server = ftp://ftp.archlinux.org/extra
|
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/extra
|
||||||
Server = ftp://ftp.archlinux.de/pub/archlinux/extra
|
Server = ftp://ftp.archlinux.de/pub/archlinux/extra
|
||||||
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/extra
|
Server = ftp://ftp.ibiblio.org/pub/linux/distributions/archlinux/extra
|
||||||
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/extra
|
Server = ftp://ftp.mpi-sb.mpg.de/pub/linux/mirror/ftp.ibiblio.org/pub/Linux/distributions/archlinux/extra
|
||||||
Server = ftp://ftp.oit.unc.edu/pub/Linux/distributions/archlinux/extra
|
|
||||||
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/extra
|
Server = ftp://ftp.tu-chemnitz.de/pub/linux/sunsite.unc-mirror/distributions/archlinux/extra
|
||||||
|
Server = ftp://ftp.archlinux.org/extra
|
||||||
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/extra
|
Server = ftp://ftp.parrswood.net/Mirrors/ftp.archlinux.org/extra
|
||||||
Server = ftp://ftp.kegep.tuc.gr/archlinux/extra
|
Server = ftp://ftp.kegep.tuc.gr/archlinux/extra
|
||||||
Server = http://darkstar.ist.utl.pt/archlinux/extra
|
Server = http://darkstar.ist.utl.pt/archlinux/extra
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
# USA.
|
# USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
myver='2.7.3'
|
myver='2.7.4'
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "gensync $myver"
|
echo "gensync $myver"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
# USA.
|
# USA.
|
||||||
#
|
#
|
||||||
|
|
||||||
myver='2.7.3'
|
myver='2.7.4'
|
||||||
startdir=`pwd`
|
startdir=`pwd`
|
||||||
USE_COLOR="n"
|
USE_COLOR="n"
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
toplevel=`pwd`
|
toplevel=`pwd`
|
||||||
version="2.7.3"
|
version="2.7.4"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "makeworld version $version"
|
echo "makeworld version $version"
|
||||||
|
|
9
src/db.c
9
src/db.c
|
@ -41,7 +41,7 @@ pacdb_t* db_open(char *root, char *pkgdir, char *treename)
|
||||||
if(db->dir == NULL) {
|
if(db->dir == NULL) {
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
strncpy(db->treename, treename, 128);
|
strncpy(db->treename, treename, sizeof(db->treename));
|
||||||
|
|
||||||
return(db);
|
return(db);
|
||||||
}
|
}
|
||||||
|
@ -355,13 +355,15 @@ int db_write(pacdb_t *db, pkginfo_t *info)
|
||||||
info->name, info->version);
|
info->name, info->version);
|
||||||
oldmask = umask(0000);
|
oldmask = umask(0000);
|
||||||
mkdir(topdir, 0755);
|
mkdir(topdir, 0755);
|
||||||
umask(oldmask);
|
/* make sure we have a sane umask */
|
||||||
|
umask(0022);
|
||||||
|
|
||||||
/* DESC */
|
/* DESC */
|
||||||
snprintf(path, PATH_MAX, "%s/desc", topdir);
|
snprintf(path, PATH_MAX, "%s/desc", topdir);
|
||||||
fp = fopen(path, "w");
|
fp = fopen(path, "w");
|
||||||
if(fp == NULL) {
|
if(fp == NULL) {
|
||||||
perror("db_write");
|
perror("db_write");
|
||||||
|
umask(oldmask);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
fputs("%NAME%\n", fp);
|
fputs("%NAME%\n", fp);
|
||||||
|
@ -392,6 +394,7 @@ int db_write(pacdb_t *db, pkginfo_t *info)
|
||||||
fp = fopen(path, "w");
|
fp = fopen(path, "w");
|
||||||
if(fp == NULL) {
|
if(fp == NULL) {
|
||||||
perror("db_write");
|
perror("db_write");
|
||||||
|
umask(oldmask);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
fputs("%FILES%\n", fp);
|
fputs("%FILES%\n", fp);
|
||||||
|
@ -411,6 +414,7 @@ int db_write(pacdb_t *db, pkginfo_t *info)
|
||||||
fp = fopen(path, "w");
|
fp = fopen(path, "w");
|
||||||
if(fp == NULL) {
|
if(fp == NULL) {
|
||||||
perror("db_write");
|
perror("db_write");
|
||||||
|
umask(oldmask);
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
fputs("%DEPENDS%\n", fp);
|
fputs("%DEPENDS%\n", fp);
|
||||||
|
@ -438,6 +442,7 @@ int db_write(pacdb_t *db, pkginfo_t *info)
|
||||||
/* INSTALL */
|
/* INSTALL */
|
||||||
/* nothing needed here (script is automatically extracted) */
|
/* nothing needed here (script is automatically extracted) */
|
||||||
|
|
||||||
|
umask(oldmask);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -302,9 +302,9 @@ int is_pkgin(pkginfo_t *needle, PMList *haystack)
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Display the content of a package
|
/* Display the content of an installed package
|
||||||
*/
|
*/
|
||||||
void dump_pkg(pkginfo_t *info)
|
void dump_pkg_full(pkginfo_t *info)
|
||||||
{
|
{
|
||||||
PMList *pm;
|
PMList *pm;
|
||||||
|
|
||||||
|
@ -335,7 +335,41 @@ void dump_pkg(pkginfo_t *info)
|
||||||
pm = list_sort(info->conflicts);
|
pm = list_sort(info->conflicts);
|
||||||
list_display("Conflicts With :", pm);
|
list_display("Conflicts With :", pm);
|
||||||
FREELIST(pm);
|
FREELIST(pm);
|
||||||
printf("Description : %s\n", info->desc);
|
printf("Description : ");
|
||||||
|
indentprint(info->desc, 17);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Display the content of a sync package
|
||||||
|
*/
|
||||||
|
void dump_pkg_sync(pkginfo_t *info)
|
||||||
|
{
|
||||||
|
PMList *pm;
|
||||||
|
|
||||||
|
if(info == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Name : %s\n", info->name);
|
||||||
|
printf("Version : %s\n", info->version);
|
||||||
|
pm = list_sort(info->groups);
|
||||||
|
list_display("Groups :", pm);
|
||||||
|
FREELIST(pm);
|
||||||
|
pm = list_sort(info->provides);
|
||||||
|
list_display("Provides :", pm);
|
||||||
|
FREELIST(pm);
|
||||||
|
pm = list_sort(info->depends);
|
||||||
|
list_display("Depends On :", pm);
|
||||||
|
FREELIST(pm);
|
||||||
|
pm = list_sort(info->conflicts);
|
||||||
|
list_display("Conflicts With :", pm);
|
||||||
|
FREELIST(pm);
|
||||||
|
pm = list_sort(info->replaces);
|
||||||
|
list_display("Replaces :", pm);
|
||||||
|
FREELIST(pm);
|
||||||
|
printf("Description : ");
|
||||||
|
indentprint(info->desc, 17);
|
||||||
|
printf("\nMD5 Sum : %s\n", info->md5sum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vim: set ts=2 sw=2 noet: */
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
|
|
|
@ -80,7 +80,8 @@ pkginfo_t* newpkg();
|
||||||
void freepkg(pkginfo_t *pkg);
|
void freepkg(pkginfo_t *pkg);
|
||||||
int pkgcmp(const void *p1, const void *p2);
|
int pkgcmp(const void *p1, const void *p2);
|
||||||
int is_pkgin(pkginfo_t *needle, PMList *haystack);
|
int is_pkgin(pkginfo_t *needle, PMList *haystack);
|
||||||
void dump_pkg(pkginfo_t *info);
|
void dump_pkg_full(pkginfo_t *info);
|
||||||
|
void dump_pkg_sync(pkginfo_t *info);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
/* vim: set ts=2 sw=2 noet: */
|
/* vim: set ts=2 sw=2 noet: */
|
||||||
|
|
108
src/pacman.c
108
src/pacman.c
|
@ -136,7 +136,8 @@ int main(int argc, char *argv[])
|
||||||
/* check for permission */
|
/* check for permission */
|
||||||
pm_access = READ_ONLY;
|
pm_access = READ_ONLY;
|
||||||
if(pmo_op != PM_MAIN && pmo_op != PM_QUERY && pmo_op != PM_DEPTEST) {
|
if(pmo_op != PM_MAIN && pmo_op != PM_QUERY && pmo_op != PM_DEPTEST) {
|
||||||
if(pmo_op == PM_SYNC && !pmo_s_sync && (pmo_s_search || pmo_group || pmo_q_list)) {
|
if(pmo_op == PM_SYNC && !pmo_s_sync &&
|
||||||
|
(pmo_s_search || pmo_group || pmo_q_list || pmo_q_info)) {
|
||||||
/* special case: PM_SYNC can be used w/ pmo_s_search by any user */
|
/* special case: PM_SYNC can be used w/ pmo_s_search by any user */
|
||||||
} else {
|
} else {
|
||||||
if(geteuid() != 0) {
|
if(geteuid() != 0) {
|
||||||
|
@ -178,7 +179,7 @@ int main(int argc, char *argv[])
|
||||||
/* check for db existence */
|
/* check for db existence */
|
||||||
/* add a trailing '/' if there isn't one */
|
/* add a trailing '/' if there isn't one */
|
||||||
if(pmo_root[strlen(pmo_root)-1] != '/') {
|
if(pmo_root[strlen(pmo_root)-1] != '/') {
|
||||||
MALLOC(ptr, strlen(pmo_root)+1);
|
MALLOC(ptr, strlen(pmo_root)+2);
|
||||||
strcpy(ptr, pmo_root);
|
strcpy(ptr, pmo_root);
|
||||||
strcat(ptr, "/");
|
strcat(ptr, "/");
|
||||||
FREE(pmo_root);
|
FREE(pmo_root);
|
||||||
|
@ -459,6 +460,48 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
FREELIST(pkg);
|
FREELIST(pkg);
|
||||||
}
|
}
|
||||||
FREELIST(groups);
|
FREELIST(groups);
|
||||||
|
} else if(pmo_q_info) {
|
||||||
|
PMList *pkgs = NULL;
|
||||||
|
int found;
|
||||||
|
if(targets) {
|
||||||
|
for(i = targets; i; i = i->next) {
|
||||||
|
pkgs = list_add(pkgs, strdup(i->data));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for(i = databases; i; i = i->next) {
|
||||||
|
dbsync_t *dbs = (dbsync_t *)i->data;
|
||||||
|
for(j = dbs->pkgcache; j; j = j->next) {
|
||||||
|
pkgs = list_add(pkgs, strdup(((pkginfo_t*)j->data)->name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(i = pkgs; i; i = i->next) {
|
||||||
|
found = 0;
|
||||||
|
for(j = databases; j; j = j->next) {
|
||||||
|
dbsync_t *dbs = (dbsync_t *)j->data;
|
||||||
|
for(k = dbs->pkgcache; k; k = k->next) {
|
||||||
|
pkginfo_t *p = (pkginfo_t*)k->data;
|
||||||
|
if(!strcmp(p->name, i->data)) {
|
||||||
|
/* re-fetch with dependency info */
|
||||||
|
p = db_scan(dbs->db, p->name, INFRQ_DESC | INFRQ_DEPENDS);
|
||||||
|
if(p == NULL) {
|
||||||
|
/* wtf */
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
dump_pkg_sync(p);
|
||||||
|
printf("\n");
|
||||||
|
freepkg(p);
|
||||||
|
found = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!found) {
|
||||||
|
fprintf(stderr, "Package \"%s\" was not found.\n", (char *)i->data);
|
||||||
|
allgood = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
FREELIST(pkgs);
|
||||||
} else if(pmo_q_list) {
|
} else if(pmo_q_list) {
|
||||||
PMList *reps = NULL;
|
PMList *reps = NULL;
|
||||||
int found;
|
int found;
|
||||||
|
@ -493,6 +536,8 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
} else if(pmo_s_upgrade) {
|
} else if(pmo_s_upgrade) {
|
||||||
int newer = 0;
|
int newer = 0;
|
||||||
int ignore = 0;
|
int ignore = 0;
|
||||||
|
syncpkg_t *s = NULL;
|
||||||
|
|
||||||
logaction(NULL, "starting full system upgrade");
|
logaction(NULL, "starting full system upgrade");
|
||||||
/* check for "recommended" package replacements */
|
/* check for "recommended" package replacements */
|
||||||
for(i = databases; i && allgood; i = i->next) {
|
for(i = databases; i && allgood; i = i->next) {
|
||||||
|
@ -507,7 +552,7 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
/* if confirmed, add this to the 'final' list, designating 'p' as
|
/* if confirmed, add this to the 'final' list, designating 'p' as
|
||||||
* the package to replace.
|
* the package to replace.
|
||||||
*/
|
*/
|
||||||
if(yesno(":: replace %s with %s from \"%s\"? [Y/n] ", p->name, pkg->name, dbs->db->treename)) {
|
if(yesno(":: Replace %s with %s from \"%s\"? [Y/n] ", p->name, pkg->name, dbs->db->treename)) {
|
||||||
syncpkg_t *sync = NULL;
|
syncpkg_t *sync = NULL;
|
||||||
/* we save the dependency info so we can move p's requiredby stuff
|
/* we save the dependency info so we can move p's requiredby stuff
|
||||||
* over to the replacing package
|
* over to the replacing package
|
||||||
|
@ -523,8 +568,7 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
/* none found -- enter pkg into the final sync list */
|
/* none found -- enter pkg into the final sync list */
|
||||||
MALLOC(sync, sizeof(syncpkg_t));
|
MALLOC(sync, sizeof(syncpkg_t));
|
||||||
sync->dbs = dbs;
|
sync->dbs = dbs;
|
||||||
sync->replaces = NULL;
|
sync->replaces = list_add(NULL, q);
|
||||||
sync->replaces = list_add(sync->replaces, q);
|
|
||||||
sync->pkg = db_scan(sync->dbs->db, pkg->name, INFRQ_DESC | INFRQ_DEPENDS);
|
sync->pkg = db_scan(sync->dbs->db, pkg->name, INFRQ_DESC | INFRQ_DEPENDS);
|
||||||
/* add to the targets list */
|
/* add to the targets list */
|
||||||
allgood = !resolvedeps(db, databases, sync, final, trail);
|
allgood = !resolvedeps(db, databases, sync, final, trail);
|
||||||
|
@ -603,6 +647,27 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
if((newer || ignore) && allgood) {
|
if((newer || ignore) && allgood) {
|
||||||
fprintf(stderr, ":: Above packages will be skipped. To manually upgrade use 'pacman -S <pkg>'\n");
|
fprintf(stderr, ":: Above packages will be skipped. To manually upgrade use 'pacman -S <pkg>'\n");
|
||||||
}
|
}
|
||||||
|
/* check if pacman itself is one of the packages to upgrade. if so, we
|
||||||
|
* we should upgrade ourselves first and then re-exec as the new version.
|
||||||
|
*
|
||||||
|
* this can prevent some of the "syntax error" problems users can have
|
||||||
|
* when sysupgrade'ing with an older version of pacman.
|
||||||
|
*/
|
||||||
|
s = find_pkginsync("pacman", final);
|
||||||
|
if(s && list_count(final) > 1) {
|
||||||
|
fprintf(stderr, "\n:: pacman has detected a newer version of the \"pacman\" package.\n");
|
||||||
|
fprintf(stderr, ":: It is recommended that you allow pacman to upgrade itself\n");
|
||||||
|
fprintf(stderr, ":: first, then you can re-run the operation with the newer version.\n");
|
||||||
|
fprintf(stderr, "::\n");
|
||||||
|
if(yesno(":: Upgrade pacman first? [Y/n] ")) {
|
||||||
|
/* XXX: leaving final un-freed is a big memory leak, but pacman quits
|
||||||
|
* right after this upgrade anyway, so...
|
||||||
|
*/
|
||||||
|
/* and create a new final list with only "pacman" in it */
|
||||||
|
final = list_add(NULL, s);
|
||||||
|
trail = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* process targets */
|
/* process targets */
|
||||||
for(i = targets; i && allgood; i = i->next) {
|
for(i = targets; i && allgood; i = i->next) {
|
||||||
|
@ -664,7 +729,7 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
} else {
|
} else {
|
||||||
PMList *l;
|
PMList *l;
|
||||||
for(l = k; l; l = l->next) {
|
for(l = k; l; l = l->next) {
|
||||||
if(yesno(":: install %s from group %s? [Y/n] ", (char*)l->data, targ)) {
|
if(yesno(":: Install %s from group %s? [Y/n] ", (char*)l->data, targ)) {
|
||||||
targets = list_add(targets, strdup((char*)l->data));
|
targets = list_add(targets, strdup((char*)l->data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -762,7 +827,10 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
/* no unresolvable deps, so look for conflicts */
|
/* no unresolvable deps, so look for conflicts */
|
||||||
for(i = deps; i && !errorout; i = i->next) {
|
for(i = deps; i && !errorout; i = i->next) {
|
||||||
depmissing_t *miss = (depmissing_t*)i->data;
|
depmissing_t *miss = (depmissing_t*)i->data;
|
||||||
if(miss->type == CONFLICT) {
|
if(miss->type != CONFLICT) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* check if the conflicting package is one that's about to be removed/replaced.
|
/* check if the conflicting package is one that's about to be removed/replaced.
|
||||||
* if so, then just ignore it
|
* if so, then just ignore it
|
||||||
*/
|
*/
|
||||||
|
@ -778,6 +846,27 @@ int pacman_sync(pacdb_t *db, PMList *targets)
|
||||||
}
|
}
|
||||||
/* if we didn't find it in any sync->replaces lists, then it's a conflict */
|
/* if we didn't find it in any sync->replaces lists, then it's a conflict */
|
||||||
if(!found && !is_in(miss->depend.name, rmtargs)) {
|
if(!found && !is_in(miss->depend.name, rmtargs)) {
|
||||||
|
int solved = 0;
|
||||||
|
syncpkg_t *sync = find_pkginsync(miss->target, final);
|
||||||
|
for(j = sync->pkg->provides; j && j->data && !solved; j = j->next) {
|
||||||
|
if(!strcmp(j->data, miss->depend.name)) {
|
||||||
|
/* this package also "provides" the package it's conflicting with,
|
||||||
|
* so just treat it like a "replaces" item so the REQUIREDBY
|
||||||
|
* fields are inherited properly.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* we save the dependency info so we can move p's requiredby stuff
|
||||||
|
* over to the replacing package
|
||||||
|
*/
|
||||||
|
pkginfo_t *q = db_scan(db, miss->depend.name, INFRQ_DESC | INFRQ_DEPENDS);
|
||||||
|
/* append to the replaces list */
|
||||||
|
sync->replaces = list_add(sync->replaces, q);
|
||||||
|
solved = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!solved) {
|
||||||
|
/* It's a conflict -- see if they want to remove it
|
||||||
|
*/
|
||||||
pkginfo_t p1;
|
pkginfo_t p1;
|
||||||
/* build a "fake" pkginfo_t so we can search with is_pkgin() */
|
/* build a "fake" pkginfo_t so we can search with is_pkgin() */
|
||||||
snprintf(p1.name, sizeof(p1.name), miss->depend.name);
|
snprintf(p1.name, sizeof(p1.name), miss->depend.name);
|
||||||
|
@ -1705,7 +1794,7 @@ int pacman_remove(pacdb_t *db, PMList *targets)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for(j = pkgs; j; j = j->next) {
|
for(j = pkgs; j; j = j->next) {
|
||||||
if(yesno(":: remove %s from group %s? [Y/n] ", (char*)j->data, (char*)lp->data)) {
|
if(yesno(":: Remove %s from group %s? [Y/n] ", (char*)j->data, (char*)lp->data)) {
|
||||||
info = db_scan(db, (char *)j->data, INFRQ_ALL);
|
info = db_scan(db, (char *)j->data, INFRQ_ALL);
|
||||||
alltargs = list_add(alltargs, info);
|
alltargs = list_add(alltargs, info);
|
||||||
}
|
}
|
||||||
|
@ -2049,7 +2138,7 @@ int pacman_query(pacdb_t *db, PMList *targets)
|
||||||
fprintf(stderr, "Package \"%s\" was not found.\n", package);
|
fprintf(stderr, "Package \"%s\" was not found.\n", package);
|
||||||
return(2);
|
return(2);
|
||||||
}
|
}
|
||||||
dump_pkg(info);
|
dump_pkg_full(info);
|
||||||
if(pmo_q_info > 1 && info->backup) {
|
if(pmo_q_info > 1 && info->backup) {
|
||||||
/* extra info */
|
/* extra info */
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
@ -3049,6 +3138,7 @@ void usage(int op, char *myname)
|
||||||
printf(" -d, --nodeps skip dependency checks\n");
|
printf(" -d, --nodeps skip dependency checks\n");
|
||||||
printf(" -f, --force force install, overwrite conflicting files\n");
|
printf(" -f, --force force install, overwrite conflicting files\n");
|
||||||
printf(" -g, --groups view all members of a package group\n");
|
printf(" -g, --groups view all members of a package group\n");
|
||||||
|
printf(" -i, --info view package information\n");
|
||||||
printf(" -l, --list list all packages belonging to the specified repository\n");
|
printf(" -l, --list list all packages belonging to the specified repository\n");
|
||||||
printf(" -s, --search search sync database for matching strings\n");
|
printf(" -s, --search search sync database for matching strings\n");
|
||||||
printf(" -u, --sysupgrade upgrade all packages that are out of date\n");
|
printf(" -u, --sysupgrade upgrade all packages that are out of date\n");
|
||||||
|
|
3145
src/pacman.c~
3145
src/pacman.c~
File diff suppressed because it is too large
Load diff
|
@ -22,7 +22,7 @@
|
||||||
#define _PAC_PACMAN_H
|
#define _PAC_PACMAN_H
|
||||||
|
|
||||||
#ifndef PACVER
|
#ifndef PACVER
|
||||||
#define PACVER "2.7.3"
|
#define PACVER "2.7.4"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef PKGDIR
|
#ifndef PKGDIR
|
||||||
|
|
Loading…
Add table
Reference in a new issue