Imported from pacman-2.8.2.tar.gz

This commit is contained in:
Judd Vinet 2004-07-22 17:11:19 +00:00
parent 75ace390f7
commit 62913fba63
8 changed files with 17 additions and 16 deletions

View file

@ -1,5 +1,7 @@
VERSION DESCRIPTION VERSION DESCRIPTION
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
2.8.2 - Fixed a segfault bug in file-conflict checks
- Made --confirm actually work. Go me.
2.8.1 - Added a HoldPkg option in pacman.conf, for the more 2.8.1 - Added a HoldPkg option in pacman.conf, for the more
exploratory users who run things like "pacman -R pacman". It exploratory users who run things like "pacman -R pacman". It
will ask for confirmation before removing any packages listed will ask for confirmation before removing any packages listed

View file

@ -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.8.1 PACVER = 2.8.2
TOPDIR = @srcdir@ TOPDIR = @srcdir@
SRCDIR = $(TOPDIR)/src/ SRCDIR = $(TOPDIR)/src/

View file

@ -20,7 +20,7 @@
# USA. # USA.
# #
myver='2.8.1' myver='2.8.2'
usage() { usage() {
echo "gensync $myver" echo "gensync $myver"

View file

@ -20,7 +20,7 @@
# USA. # USA.
# #
myver='2.8.1' myver='2.8.2'
startdir=`pwd` startdir=`pwd`
PKGDEST=$startdir PKGDEST=$startdir
USE_COLOR="n" USE_COLOR="n"

View file

@ -21,7 +21,7 @@
# #
toplevel=`pwd` toplevel=`pwd`
version="2.8.1" version="2.8.2"
usage() { usage() {
echo "makeworld version $version" echo "makeworld version $version"

View file

@ -621,7 +621,6 @@ PMList* db_find_conflicts(pacdb_t *db, PMList *targets, char *root)
/* Make sure that the supposedly-conflicting file is not actually just /* Make sure that the supposedly-conflicting file is not actually just
* a symlink that points to a path that used to exist in the package. * a symlink that points to a path that used to exist in the package.
*/ */
/* XXX: Chu */
/* Check if any part of the conflicting file's path is a symlink */ /* Check if any part of the conflicting file's path is a symlink */
if(dbpkg && !ok) { if(dbpkg && !ok) {
if(!sym) MALLOC(sym, PATH_MAX); if(!sym) MALLOC(sym, PATH_MAX);
@ -636,20 +635,21 @@ PMList* db_find_conflicts(pacdb_t *db, PMList *targets, char *root)
memset(symlink, 0, PATH_MAX); memset(symlink, 0, PATH_MAX);
readlink(sym, symlink, PATH_MAX); readlink(sym, symlink, PATH_MAX);
if(symlink[0] != '/') { if(symlink[0] != '/') {
char *temp = NULL; char *temp = strdup(sym);
MALLOC(temp, PATH_MAX);
strncpy(tempsym, symlink, PATH_MAX); strncpy(tempsym, symlink, PATH_MAX);
strncpy(temp, sym, PATH_MAX);
snprintf(symlink, PATH_MAX, "%s/%s", dirname(temp), tempsym); snprintf(symlink, PATH_MAX, "%s/%s", dirname(temp), tempsym);
FREE(temp); FREE(temp);
} }
/* If it's a directory, tack on a '/' */
if(!stat(symlink, &buf) && S_ISDIR(buf.st_mode)) {
strcat(symlink, "/");
}
if(strstr(symlink, root) == symlink) { if(strstr(symlink, root) == symlink) {
strncpy(tempsym, symlink+strlen(root), PATH_MAX-strlen(root)); strncpy(tempsym, symlink+strlen(root), PATH_MAX-strlen(root));
/* If that part of the path used to exist in the package */ /* If that part of the path used to exist in the package */
if(is_in(tempsym, dbpkg->files)) { if(is_in(tempsym, dbpkg->files)) {
/* See if the modified path used to */ /* See if the modified path used to */
snprintf(tempsym, PATH_MAX, "%s%s", symlink+strlen(root), path+strlen(sym)+strlen(root)); snprintf(tempsym, PATH_MAX, "%s%s", symlink+strlen(root), path+strlen(sym)+strlen(root));
printf("check1: is_in(%s, %s->files)\n", tempsym, p->name);
if(is_in(tempsym, dbpkg->files)) { if(is_in(tempsym, dbpkg->files)) {
ok = 1; ok = 1;
break; break;
@ -662,7 +662,6 @@ PMList* db_find_conflicts(pacdb_t *db, PMList *targets, char *root)
if(is_in(tempsym, dbpkg->files)) { if(is_in(tempsym, dbpkg->files)) {
/* See if the modified path used to */ /* See if the modified path used to */
snprintf(tempsym, PATH_MAX, "%s%s", symlink+strlen(root), path+strlen(sym)+strlen(root)); snprintf(tempsym, PATH_MAX, "%s%s", symlink+strlen(root), path+strlen(sym)+strlen(root));
printf("check2: is_in(%s, %s->files)\n", tempsym, p->name);
if(is_in(tempsym, dbpkg->files)) { if(is_in(tempsym, dbpkg->files)) {
ok = 1; ok = 1;
break; break;
@ -699,7 +698,6 @@ PMList* db_find_conflicts(pacdb_t *db, PMList *targets, char *root)
{ {
/* Replace one with the other and check if it really did exist in the old package */ /* Replace one with the other and check if it really did exist in the old package */
snprintf(tempsym, PATH_MAX, "%s%s", symlink, path+strlen(symlink)); snprintf(tempsym, PATH_MAX, "%s%s", symlink, path+strlen(symlink));
printf("check3: !strncmp(%s, %s)\n", tempsym, path);
if(!strncmp(tempsym, path, PATH_MAX)) { if(!strncmp(tempsym, path, PATH_MAX)) {
ok = 1; ok = 1;
break; break;
@ -718,14 +716,13 @@ PMList* db_find_conflicts(pacdb_t *db, PMList *targets, char *root)
pkginfo_t *dbpkg2 = NULL; pkginfo_t *dbpkg2 = NULL;
dbpkg2 = db_scan(db, p1->name, INFRQ_DESC | INFRQ_FILES); dbpkg2 = db_scan(db, p1->name, INFRQ_DESC | INFRQ_FILES);
/* If it used to exist in there, but doesn't anymore */ /* If it used to exist in there, but doesn't anymore */
if(!is_in(filestr, p1->files) && is_in(filestr, dbpkg2->files)) { if(dbpkg2 && !is_in(filestr, p1->files) && is_in(filestr, dbpkg2->files)) {
ok = 1; ok = 1;
} }
FREE(dbpkg2); FREE(dbpkg2);
} }
} }
} }
/* XXX: Chu */
if(!ok) { if(!ok) {
MALLOC(str, 512); MALLOC(str, 512);
snprintf(str, 512, "%s: exists in filesystem", path); snprintf(str, 512, "%s: exists in filesystem", path);

View file

@ -1081,7 +1081,8 @@ int pacman_sync(pacdb_t *db, PMList *targets)
if(allgood && final && final->data) { if(allgood && final && final->data) {
if(pmo_s_downloadonly) { if(pmo_s_downloadonly) {
if(pmo_noconfirm) { if(pmo_noconfirm) {
printf("\nBeginning upgrade process...\n"); printf("\nBeginning download...\n");
confirm = 1;
} else { } else {
confirm = yesno("\nProceed with download? [Y/n] "); confirm = yesno("\nProceed with download? [Y/n] ");
} }
@ -1091,7 +1092,8 @@ int pacman_sync(pacdb_t *db, PMList *targets)
confirm = 1; confirm = 1;
} else { } else {
if(pmo_noconfirm) { if(pmo_noconfirm) {
printf("\nBeginning download...\n"); printf("\nBeginning upgrade process...\n");
confirm = 1;
} else { } else {
confirm = yesno("\nProceed with upgrade? [Y/n] "); confirm = yesno("\nProceed with upgrade? [Y/n] ");
} }

View file

@ -22,7 +22,7 @@
#define _PAC_PACMAN_H #define _PAC_PACMAN_H
#ifndef PACVER #ifndef PACVER
#define PACVER "2.8.1" #define PACVER "2.8.2"
#endif #endif
#ifndef PKGDIR #ifndef PKGDIR