summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2004-07-22 19:11:19 +0200
committerJudd Vinet <judd@archlinux.org>2004-07-22 19:11:19 +0200
commit62913fba63000dd9a7f1ff12c6cd40362ad56f3a (patch)
treec251bf8379bca421b20bbccd1a65e57afacdb92d /src
parent75ace390f7f497300adb59b3597f1cec2f31c21f (diff)
downloadpacman-62913fba63000dd9a7f1ff12c6cd40362ad56f3a.tar.gz
pacman-62913fba63000dd9a7f1ff12c6cd40362ad56f3a.tar.xz
Imported from pacman-2.8.2.tar.gz
Diffstat (limited to 'src')
-rw-r--r--src/db.c15
-rw-r--r--src/pacman.c6
-rw-r--r--src/pacman.h2
3 files changed, 11 insertions, 12 deletions
diff --git a/src/db.c b/src/db.c
index c6bc3df8..0442eb55 100644
--- a/src/db.c
+++ b/src/db.c
@@ -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
* 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 */
if(dbpkg && !ok) {
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);
readlink(sym, symlink, PATH_MAX);
if(symlink[0] != '/') {
- char *temp = NULL;
- MALLOC(temp, PATH_MAX);
+ char *temp = strdup(sym);
strncpy(tempsym, symlink, PATH_MAX);
- strncpy(temp, sym, PATH_MAX);
snprintf(symlink, PATH_MAX, "%s/%s", dirname(temp), tempsym);
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) {
strncpy(tempsym, symlink+strlen(root), PATH_MAX-strlen(root));
/* If that part of the path used to exist in the package */
if(is_in(tempsym, dbpkg->files)) {
/* See if the modified path used to */
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)) {
ok = 1;
break;
@@ -662,7 +662,6 @@ PMList* db_find_conflicts(pacdb_t *db, PMList *targets, char *root)
if(is_in(tempsym, dbpkg->files)) {
/* See if the modified path used to */
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)) {
ok = 1;
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 */
snprintf(tempsym, PATH_MAX, "%s%s", symlink, path+strlen(symlink));
- printf("check3: !strncmp(%s, %s)\n", tempsym, path);
if(!strncmp(tempsym, path, PATH_MAX)) {
ok = 1;
break;
@@ -718,14 +716,13 @@ PMList* db_find_conflicts(pacdb_t *db, PMList *targets, char *root)
pkginfo_t *dbpkg2 = NULL;
dbpkg2 = db_scan(db, p1->name, INFRQ_DESC | INFRQ_FILES);
/* 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;
}
FREE(dbpkg2);
}
}
}
-/* XXX: Chu */
if(!ok) {
MALLOC(str, 512);
snprintf(str, 512, "%s: exists in filesystem", path);
diff --git a/src/pacman.c b/src/pacman.c
index 8e6e4d19..c8f46fcd 100644
--- a/src/pacman.c
+++ b/src/pacman.c
@@ -1081,7 +1081,8 @@ int pacman_sync(pacdb_t *db, PMList *targets)
if(allgood && final && final->data) {
if(pmo_s_downloadonly) {
if(pmo_noconfirm) {
- printf("\nBeginning upgrade process...\n");
+ printf("\nBeginning download...\n");
+ confirm = 1;
} else {
confirm = yesno("\nProceed with download? [Y/n] ");
}
@@ -1091,7 +1092,8 @@ int pacman_sync(pacdb_t *db, PMList *targets)
confirm = 1;
} else {
if(pmo_noconfirm) {
- printf("\nBeginning download...\n");
+ printf("\nBeginning upgrade process...\n");
+ confirm = 1;
} else {
confirm = yesno("\nProceed with upgrade? [Y/n] ");
}
diff --git a/src/pacman.h b/src/pacman.h
index f4b93138..2c8ddd09 100644
--- a/src/pacman.h
+++ b/src/pacman.h
@@ -22,7 +22,7 @@
#define _PAC_PACMAN_H
#ifndef PACVER
-#define PACVER "2.8.1"
+#define PACVER "2.8.2"
#endif
#ifndef PKGDIR