summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2003-10-17 06:18:01 +0200
committerJudd Vinet <judd@archlinux.org>2003-10-17 06:18:01 +0200
commit5aa3a24b17c5b1d2b43274e530259dab7711b9b0 (patch)
tree0f2421a372da3fc535e2e9fd1f9a6e428226eb72
parent24b934e8868e1162c44ee06b2cb2990b6a434a98 (diff)
downloadpacman-5aa3a24b17c5b1d2b43274e530259dab7711b9b0.tar.gz
pacman-5aa3a24b17c5b1d2b43274e530259dab7711b9b0.tar.xz
Imported from pacman-2.6.4.tar.gz
-rw-r--r--ChangeLog1
-rw-r--r--Makefile.in2
-rwxr-xr-xscripts/gensync2
-rwxr-xr-xscripts/makepkg2
-rwxr-xr-xscripts/makeworld2
-rw-r--r--src/pacman.c26
-rw-r--r--src/pacman.h2
7 files changed, 20 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 732bad08..02afc1dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
VERSION DESCRIPTION
-----------------------------------------------------------------------------
+2.6.4 - Altered pacman_upgrade() to allow a package to replace itself
2.6.3 - A couple memory fixes in the new replaces code
2.6.2 - Fixed a memory cleanup bug
- Aurelien's patch:
diff --git a/Makefile.in b/Makefile.in
index 60d1bdeb..7eda945f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -34,7 +34,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
-PACVER = 2.6.3
+PACVER = 2.6.4
TOPDIR = @srcdir@
SRCDIR = $(TOPDIR)/src/
diff --git a/scripts/gensync b/scripts/gensync
index 1839655d..045c4f38 100755
--- a/scripts/gensync
+++ b/scripts/gensync
@@ -20,7 +20,7 @@
# USA.
#
-myver='2.6.3'
+myver='2.6.4'
usage() {
echo "gensync $myver"
diff --git a/scripts/makepkg b/scripts/makepkg
index 5ca04a1a..7cc8b992 100755
--- a/scripts/makepkg
+++ b/scripts/makepkg
@@ -20,7 +20,7 @@
# USA.
#
-myver='2.6.3'
+myver='2.6.4'
startdir=`pwd`
# source Arch's abs.conf if it's present
diff --git a/scripts/makeworld b/scripts/makeworld
index 16d79923..4ce1a772 100755
--- a/scripts/makeworld
+++ b/scripts/makeworld
@@ -21,7 +21,7 @@
#
toplevel=`pwd`
-version="2.6.3"
+version="2.6.4"
usage() {
echo "makeworld version $version"
diff --git a/src/pacman.c b/src/pacman.c
index 8aa7037a..03051f92 100644
--- a/src/pacman.c
+++ b/src/pacman.c
@@ -1226,16 +1226,18 @@ int pacman_add(pacdb_t *db, PMList *targets)
/* we'll need the full record for backup checks later */
oldpkg = db_scan(db, info->name, INFRQ_ALL);
- list_add(tmp, strdup(info->name));
- vprint("removing old package first...\n");
- retcode = pacman_remove(db, tmp);
- list_free(tmp);
- if(retcode == 1) {
- fprintf(stderr, "\nupgrade aborted.\n");
- return(1);
+ if(oldpkg) {
+ list_add(tmp, strdup(info->name));
+ vprint("removing old package first...\n");
+ retcode = pacman_remove(db, tmp);
+ list_free(tmp);
+ if(retcode == 1) {
+ fprintf(stderr, "\nupgrade aborted.\n");
+ return(1);
+ }
+ /* reload package cache */
+ pm_packages = db_loadpkgs(db, pm_packages);
}
- /* reload package cache */
- pm_packages = db_loadpkgs(db, pm_packages);
} else {
/* no previous package version is installed, so this is actually just an
* install
@@ -1280,7 +1282,7 @@ int pacman_add(pacdb_t *db, PMList *targets)
if(is_in(pathname, pmo_noupgrade)) {
notouch = 1;
} else {
- if(!pmo_upgrade) {
+ if(!pmo_upgrade || oldpkg == NULL) {
nb = is_in(pathname, info->backup);
} else {
/* op == PM_UPGRADE */
@@ -1465,7 +1467,7 @@ int pacman_add(pacdb_t *db, PMList *targets)
}
vprint("done.\n");
if(pmo_usesyslog) {
- if(pmo_upgrade) {
+ if(pmo_upgrade && oldpkg) {
syslog(LOG_INFO, "upgraded %s (%s -> %s)\n", info->name,
oldpkg->version, info->version);
} else {
@@ -1509,7 +1511,7 @@ int pacman_add(pacdb_t *db, PMList *targets)
snprintf(pm_install, PATH_MAX, "%s/%s/%s-%s/install", pmo_dbpath, db->treename, info->name, info->version);
vprint("Executing post-install script...\n");
snprintf(cmdline, PATH_MAX, "chroot %s /bin/sh %s post_%s %s %s", pmo_root, pm_install,
- (pmo_upgrade ? "upgrade" : "install"), info->version, (pmo_upgrade ? oldpkg->version : ""));
+ (pmo_upgrade ? "upgrade" : "install"), info->version, ((pmo_upgrade && oldpkg) ? oldpkg->version : ""));
system(cmdline);
}
}
diff --git a/src/pacman.h b/src/pacman.h
index cd231dc1..f5d8ca3d 100644
--- a/src/pacman.h
+++ b/src/pacman.h
@@ -22,7 +22,7 @@
#define _PAC_PACMAN_H
#ifndef PACVER
-#define PACVER "2.6.3"
+#define PACVER "2.6.4"
#endif
#ifndef PKGDIR