From a2ee533f84aa858df5710d799c52b7d06a77b1de Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Fri, 30 Apr 2004 03:37:13 +0000 Subject: Imported from pacman-2.7.9.tar.gz --- ChangeLog | 2 ++ Makefile.in | 2 +- doc/makepkg.8.in | 7 ++++++- scripts/gensync | 8 ++++++-- scripts/makepkg | 4 ++-- scripts/makeworld | 2 +- src/db.c | 10 ++++++---- src/package.c | 1 + src/package.h | 1 + src/pacman.c | 2 +- src/pacman.h | 2 +- 11 files changed, 28 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c511a06..defa4407 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ VERSION DESCRIPTION ----------------------------------------------------------------------------- +2.7.9 - added the "force" option to packages, so --sysupgrade can + downgrade packages when it needs to 2.7.8 - added post_remove scriptlet support - added -Qs option (bug #854) - a provisio does not imply conflict, to make a provisio target diff --git a/Makefile.in b/Makefile.in index 8bfeae36..c5238b6f 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.7.8 +PACVER = 2.7.9 TOPDIR = @srcdir@ SRCDIR = $(TOPDIR)/src/ diff --git a/doc/makepkg.8.in b/doc/makepkg.8.in index 6547cb7e..27461315 100644 --- a/doc/makepkg.8.in +++ b/doc/makepkg.8.in @@ -1,4 +1,4 @@ -.TH makepkg 8 "April 27, 2004" "makepkg #VERSION#" "" +.TH makepkg 8 "April 29, 2004" "makepkg #VERSION#" "" .SH NAME makepkg \- package build utility .SH SYNOPSIS @@ -210,6 +210,11 @@ This is the release number specific to Arch Linux packages. .B pkgdesc This should be a brief description of the package and its functionality. +.TP +.B force +This is used to force the package to be upgraded by \fB--sysupgrade\fP, even +if its an older version. + .TP .B url This field contains an optional URL that is associated with the piece of software diff --git a/scripts/gensync b/scripts/gensync index 23347630..665135f6 100755 --- a/scripts/gensync +++ b/scripts/gensync @@ -20,7 +20,7 @@ # USA. # -myver='2.7.8' +myver='2.7.9' usage() { echo "gensync $myver" @@ -63,7 +63,7 @@ get_md5checksum() db_write_entry() { - unset pkgname pkgver pkgrel pkgdesc + unset pkgname pkgver pkgrel pkgdesc force unset groups replaces provides depends conflicts source $1 || return 1 cd $gstmpdir @@ -99,6 +99,10 @@ db_write_entry() done echo "" >>desc fi + if [ "$force" = "y" -o "$force" = "Y" ]; then + echo "%FORCE%" >>desc + echo "" >>desc + fi # depends : >depends if [ ${#depends[*]} -gt 0 ]; then diff --git a/scripts/makepkg b/scripts/makepkg index c0977b9f..d4ce6e32 100755 --- a/scripts/makepkg +++ b/scripts/makepkg @@ -20,7 +20,7 @@ # USA. # -myver='2.7.8' +myver='2.7.9' startdir=`pwd` PKGDEST=$startdir USE_COLOR="n" @@ -294,7 +294,7 @@ if [ "$CLEANCACHE" = "1" ]; then fi fi -unset pkgname pkgver pkgrel pkgdesc url license groups provides md5sums +unset pkgname pkgver pkgrel pkgdesc url license groups provides md5sums force unset replaces depends conflicts backup source install build makedepends umask 0022 diff --git a/scripts/makeworld b/scripts/makeworld index 0397aa56..16dd9f32 100755 --- a/scripts/makeworld +++ b/scripts/makeworld @@ -21,7 +21,7 @@ # toplevel=`pwd` -version="2.7.8" +version="2.7.9" usage() { echo "makeworld version $version" 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 -- cgit v1.2.3-24-g4f1b