summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJudd Vinet <judd@archlinux.org>2004-04-30 05:37:13 +0200
committerJudd Vinet <judd@archlinux.org>2004-04-30 05:37:13 +0200
commita2ee533f84aa858df5710d799c52b7d06a77b1de (patch)
treef07ca99457d38b776cb91d78754e80d0d227db90 /src
parent4ad864462043c61d19861e4b7cacf6610ae9ce7f (diff)
downloadpacman-a2ee533f84aa858df5710d799c52b7d06a77b1de.tar.gz
pacman-a2ee533f84aa858df5710d799c52b7d06a77b1de.tar.xz
Imported from pacman-2.7.9.tar.gz
Diffstat (limited to 'src')
-rw-r--r--src/db.c10
-rw-r--r--src/package.c1
-rw-r--r--src/package.h1
-rw-r--r--src/pacman.c2
-rw-r--r--src/pacman.h2
5 files changed, 10 insertions, 6 deletions
diff --git a/src/db.c b/src/db.c
index 3a208bea..33b1ea56 100644
--- a/src/db.c
+++ b/src/db.c
@@ -250,20 +250,22 @@ pkginfo_t* db_read(pacdb_t *db, struct dirent *ent, unsigned int inforeq)
info->size = atol(tmp);
} else if(!strcmp(line, "%REPLACES%")) {
/* the REPLACES tag is special -- it only appears in sync repositories,
- * not the local one.
- */
+ * not the local one. */
while(fgets(line, 512, fp) && strlen(trim(line))) {
char *s = strdup(line);
info->replaces = list_add(info->replaces, s);
}
} else if(!strcmp(line, "%MD5SUM%")) {
/* MD5SUM tag only appears in sync repositories,
- * not the local one.
- */
+ * not the local one. */
if(fgets(info->md5sum, sizeof(info->md5sum), fp) == NULL) {
FREEPKG(info);
return(NULL);
}
+ } else if(!strcmp(line, "%FORCE%")) {
+ /* FORCE tag only appears in sync repositories,
+ * not the local one. */
+ info->force = 1;
}
}
fclose(fp);
diff --git a/src/package.c b/src/package.c
index e7567d23..b9087d85 100644
--- a/src/package.c
+++ b/src/package.c
@@ -241,6 +241,7 @@ pkginfo_t* newpkg()
pkg->md5sum[0] = '\0';
pkg->size = 0;
pkg->scriptlet = 0;
+ pkg->force = 0;
pkg->requiredby = NULL;
pkg->conflicts = NULL;
pkg->files = NULL;
diff --git a/src/package.h b/src/package.h
index 6dcd8cf3..91d2fdc9 100644
--- a/src/package.h
+++ b/src/package.h
@@ -53,6 +53,7 @@ typedef struct __pkginfo_t {
char md5sum[33];
unsigned long size;
unsigned short scriptlet;
+ unsigned short force;
PMList *replaces;
PMList *groups;
PMList *files;
diff --git a/src/pacman.c b/src/pacman.c
index 3b5d3ddb..2670ede5 100644
--- a/src/pacman.c
+++ b/src/pacman.c
@@ -667,7 +667,7 @@ int pacman_sync(pacdb_t *db, PMList *targets)
}
/* compare versions and see if we need to upgrade */
cmp = rpmvercmp(local->version, sync->pkg->version);
- if(cmp > 0) {
+ if(cmp > 0 && !sync->pkg->force) {
/* local version is newer */
fprintf(stderr, ":: %s-%s: local version is newer\n",
local->name, local->version);
diff --git a/src/pacman.h b/src/pacman.h
index bc8e530e..a36d690c 100644
--- a/src/pacman.h
+++ b/src/pacman.h
@@ -22,7 +22,7 @@
#define _PAC_PACMAN_H
#ifndef PACVER
-#define PACVER "2.7.8"
+#define PACVER "2.7.9"
#endif
#ifndef PKGDIR