- update to 4.8.1
- drop no longer needed patches - fix source url pointing to testing directory
This commit is contained in:
parent
aaf4885601
commit
154da42107
@ -1 +1 @@
|
||||
rpm-4.8.0.tar.bz2
|
||||
rpm-4.8.1.tar.bz2
|
||||
|
@ -1,46 +0,0 @@
|
||||
commit 4e4aec28c544f2884cb76be37d508f376db5cb7c
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Thu Feb 4 15:55:16 2010 +0200
|
||||
|
||||
Handle erased packages wrt disk-space problem reporting (RhBug:561160)
|
||||
- erased packages in the transaction cause space needs to shrink, which
|
||||
commit 2222e81e1cf74bbf78acb9969592ab06e2289929 failed to take into
|
||||
account, causing false disk space errors from unaffected packages
|
||||
- adjust obneeded and oineeded when the requirements shrink
|
||||
- new disk space problems can only occur when the requirements grow,
|
||||
change the pmtsCheckDSIProblems() check to reflect that (although not
|
||||
strictly necessary)
|
||||
|
||||
diff --git a/lib/transaction.c b/lib/transaction.c
|
||||
index d913258..7d12eeb 100644
|
||||
--- a/lib/transaction.c
|
||||
+++ b/lib/transaction.c
|
||||
@@ -219,6 +219,10 @@ static void rpmtsUpdateDSI(const rpmts ts, dev_t dev, const char *dirName,
|
||||
|
||||
if (fixupSize)
|
||||
dsi->bneeded -= BLOCK_ROUND(fixupSize, dsi->bsize);
|
||||
+
|
||||
+ /* adjust bookkeeping when requirements shrink */
|
||||
+ if (dsi->bneeded < dsi->obneeded) dsi->obneeded = dsi->bneeded;
|
||||
+ if (dsi->ineeded < dsi->oineeded) dsi->oineeded = dsi->ineeded;
|
||||
}
|
||||
|
||||
static void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
|
||||
@@ -238,7 +242,7 @@ static void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
|
||||
for (; dsi->bsize; dsi++) {
|
||||
|
||||
if (dsi->bavail >= 0 && adj_fs_blocks(dsi->bneeded) > dsi->bavail) {
|
||||
- if (dsi->bneeded != dsi->obneeded) {
|
||||
+ if (dsi->bneeded > dsi->obneeded) {
|
||||
rpmpsAppend(ps, RPMPROB_DISKSPACE,
|
||||
rpmteNEVRA(te), rpmteKey(te),
|
||||
dsi->mntPoint, NULL, NULL,
|
||||
@@ -248,7 +252,7 @@ static void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
|
||||
}
|
||||
|
||||
if (dsi->iavail >= 0 && adj_fs_blocks(dsi->ineeded) > dsi->iavail) {
|
||||
- if (dsi->ineeded != dsi->oineeded) {
|
||||
+ if (dsi->ineeded > dsi->oineeded) {
|
||||
rpmpsAppend(ps, RPMPROB_DISKNODES,
|
||||
rpmteNEVRA(te), rpmteKey(te),
|
||||
dsi->mntPoint, NULL, NULL,
|
@ -1,48 +0,0 @@
|
||||
diff -up rpm-4.8.0/lib/fsm.c.fsm-sbits rpm-4.8.0/lib/fsm.c
|
||||
--- rpm-4.8.0/lib/fsm.c.fsm-sbits 2009-12-07 16:36:49.000000000 +0200
|
||||
+++ rpm-4.8.0/lib/fsm.c 2010-06-03 11:14:53.000000000 +0300
|
||||
@@ -1320,6 +1320,21 @@ static const char * rpmteTypeString(rpmt
|
||||
}
|
||||
}
|
||||
|
||||
+static void removeSBITS(const char *path)
|
||||
+{
|
||||
+ struct stat stb;
|
||||
+ if (lstat(path, &stb) == 0 && S_ISREG(stb.st_mode)) {
|
||||
+ if ((stb.st_mode & 06000) != 0) {
|
||||
+ (void) chmod(path, stb.st_mode & 0777);
|
||||
+ }
|
||||
+#if WITH_CAP
|
||||
+ if (stb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) {
|
||||
+ (void) cap_set_file(path, NULL);
|
||||
+ }
|
||||
+#endif
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
#define IS_DEV_LOG(_x) \
|
||||
((_x) != NULL && strlen(_x) >= (sizeof("/dev/log")-1) && \
|
||||
rstreqn((_x), "/dev/log", sizeof("/dev/log")-1) && \
|
||||
@@ -2024,11 +2039,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
|
||||
break;
|
||||
|
||||
case FSM_UNLINK:
|
||||
- if (fsm->mapFlags & CPIO_SBIT_CHECK) {
|
||||
- struct stat stb;
|
||||
- if (lstat(fsm->path, &stb) == 0 && S_ISREG(stb.st_mode) && (stb.st_mode & 06000) != 0)
|
||||
- chmod(fsm->path, stb.st_mode & 0777);
|
||||
- }
|
||||
+ if (fsm->mapFlags & CPIO_SBIT_CHECK)
|
||||
+ removeSBITS(fsm->path);
|
||||
rc = unlink(fsm->path);
|
||||
if (_fsm_debug && (stage & FSM_SYSCALL))
|
||||
rpmlog(RPMLOG_DEBUG, " %8s (%s) %s\n", cur,
|
||||
@@ -2037,6 +2049,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
|
||||
rc = (errno == ENOENT ? CPIOERR_ENOENT : CPIOERR_UNLINK_FAILED);
|
||||
break;
|
||||
case FSM_RENAME:
|
||||
+ if (fsm->mapFlags & CPIO_SBIT_CHECK)
|
||||
+ removeSBITS(fsm->path);
|
||||
rc = rename(fsm->opath, fsm->path);
|
||||
#if defined(ETXTBSY) && defined(__HPUX__)
|
||||
if (rc && errno == ETXTBSY) {
|
@ -1,271 +0,0 @@
|
||||
diff --git a/lib/transaction.c b/lib/transaction.c
|
||||
index 1860dfb..d913258 100644
|
||||
--- a/lib/transaction.c
|
||||
+++ b/lib/transaction.c
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "debug.h"
|
||||
|
||||
struct diskspaceInfo_s {
|
||||
+ char * mntPoint; /*!< File system mount point */
|
||||
dev_t dev; /*!< File system device number. */
|
||||
int64_t bneeded; /*!< No. of blocks needed. */
|
||||
int64_t ineeded; /*!< No. of inodes needed. */
|
||||
@@ -61,83 +62,114 @@ struct diskspaceInfo_s {
|
||||
|
||||
static int rpmtsInitDSI(const rpmts ts)
|
||||
{
|
||||
- rpmDiskSpaceInfo dsi;
|
||||
- struct stat sb;
|
||||
- int rc;
|
||||
- int i;
|
||||
-
|
||||
if (rpmtsFilterFlags(ts) & RPMPROB_FILTER_DISKSPACE)
|
||||
return 0;
|
||||
-
|
||||
- rpmlog(RPMLOG_DEBUG, "mounted filesystems:\n");
|
||||
- rpmlog(RPMLOG_DEBUG,
|
||||
- " i dev bsize bavail iavail mount point\n");
|
||||
-
|
||||
- rc = rpmGetFilesystemList(&ts->filesystems, &ts->filesystemCount);
|
||||
- if (rc || ts->filesystems == NULL || ts->filesystemCount <= 0)
|
||||
- return rc;
|
||||
-
|
||||
- /* Get available space on mounted file systems. */
|
||||
-
|
||||
ts->dsi = _free(ts->dsi);
|
||||
- ts->dsi = xcalloc((ts->filesystemCount + 1), sizeof(*ts->dsi));
|
||||
+ ts->filesystemCount = 0;
|
||||
+ ts->dsi = xcalloc(1, sizeof(*ts->dsi));
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
- dsi = ts->dsi;
|
||||
+static rpmDiskSpaceInfo rpmtsCreateDSI(const rpmts ts, dev_t dev,
|
||||
+ const char * dirName, int count)
|
||||
+{
|
||||
+ rpmDiskSpaceInfo dsi;
|
||||
+ struct stat sb;
|
||||
+ char * resolved_path;
|
||||
+ char mntPoint[PATH_MAX];
|
||||
+ int rc;
|
||||
|
||||
- if (dsi != NULL)
|
||||
- for (i = 0; (i < ts->filesystemCount) && dsi; i++, dsi++) {
|
||||
#if STATFS_IN_SYS_STATVFS
|
||||
- struct statvfs sfb;
|
||||
- memset(&sfb, 0, sizeof(sfb));
|
||||
- rc = statvfs(ts->filesystems[i], &sfb);
|
||||
+ struct statvfs sfb;
|
||||
+ memset(&sfb, 0, sizeof(sfb));
|
||||
+ rc = statvfs(dirName, &sfb);
|
||||
#else
|
||||
- struct statfs sfb;
|
||||
- memset(&sfb, 0, sizeof(sfb));
|
||||
+ struct statfs sfb;
|
||||
+ memset(&sfb, 0, sizeof(sfb));
|
||||
# if STAT_STATFS4
|
||||
/* This platform has the 4-argument version of the statfs call. The last two
|
||||
* should be the size of struct statfs and 0, respectively. The 0 is the
|
||||
* filesystem type, and is always 0 when statfs is called on a mounted
|
||||
* filesystem, as we're doing.
|
||||
*/
|
||||
- rc = statfs(ts->filesystems[i], &sfb, sizeof(sfb), 0);
|
||||
+ rc = statfs(dirName, &sfb, sizeof(sfb), 0);
|
||||
# else
|
||||
- rc = statfs(ts->filesystems[i], &sfb);
|
||||
+ rc = statfs(dirName, &sfb);
|
||||
# endif
|
||||
#endif
|
||||
- if (rc)
|
||||
- break;
|
||||
-
|
||||
- rc = stat(ts->filesystems[i], &sb);
|
||||
- if (rc)
|
||||
- break;
|
||||
- dsi->dev = sb.st_dev;
|
||||
-
|
||||
- dsi->bsize = sfb.f_bsize;
|
||||
- dsi->bneeded = 0;
|
||||
- dsi->ineeded = 0;
|
||||
+ if (rc)
|
||||
+ return NULL;
|
||||
+
|
||||
+ rc = stat(dirName, &sb);
|
||||
+ if (rc)
|
||||
+ return NULL;
|
||||
+ if (sb.st_dev != dev) // XXX WHY?
|
||||
+ return NULL;
|
||||
+
|
||||
+ ts->dsi = xrealloc(ts->dsi, (count + 2) * sizeof(*ts->dsi));
|
||||
+ dsi = ts->dsi + count;
|
||||
+ memset(dsi, 0, 2 * sizeof(*dsi));
|
||||
+
|
||||
+ dsi->dev = sb.st_dev;
|
||||
+ dsi->bsize = sfb.f_bsize;
|
||||
+ if (!dsi->bsize)
|
||||
+ dsi->bsize = 512; /* we need a bsize */
|
||||
+ dsi->bneeded = 0;
|
||||
+ dsi->ineeded = 0;
|
||||
#ifdef STATFS_HAS_F_BAVAIL
|
||||
- dsi->bavail = (sfb.f_flag & ST_RDONLY) ? 0 : sfb.f_bavail;
|
||||
+ dsi->bavail = (sfb.f_flag & ST_RDONLY) ? 0 : sfb.f_bavail;
|
||||
#else
|
||||
/* FIXME: the statfs struct doesn't have a member to tell how many blocks are
|
||||
* available for non-superusers. f_blocks - f_bfree is probably too big, but
|
||||
* it's about all we can do.
|
||||
*/
|
||||
- dsi->bavail = sfb.f_blocks - sfb.f_bfree;
|
||||
+ dsi->bavail = sfb.f_blocks - sfb.f_bfree;
|
||||
#endif
|
||||
- /* XXX Avoid FAT and other file systems that have not inodes. */
|
||||
- /* XXX assigning negative value to unsigned type */
|
||||
- dsi->iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0)
|
||||
- ? sfb.f_ffree : -1;
|
||||
- rpmlog(RPMLOG_DEBUG,
|
||||
- "%5d 0x%08x %8" PRId64 " %12" PRId64 " %12" PRId64" %s\n",
|
||||
- i, (unsigned) dsi->dev, dsi->bsize,
|
||||
- dsi->bavail, dsi->iavail,
|
||||
- ts->filesystems[i]);
|
||||
+ /* XXX Avoid FAT and other file systems that have not inodes. */
|
||||
+ /* XXX assigning negative value to unsigned type */
|
||||
+ dsi->iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0)
|
||||
+ ? sfb.f_ffree : -1;
|
||||
+
|
||||
+ /* Find mount point belonging to this device number */
|
||||
+ resolved_path = realpath(dirName, mntPoint);
|
||||
+ if (!resolved_path) {
|
||||
+ strncpy(mntPoint, dirName, PATH_MAX);
|
||||
+ mntPoint[PATH_MAX-1] = '\0';
|
||||
}
|
||||
- return rc;
|
||||
+ char * end = NULL;
|
||||
+ while (end != mntPoint) {
|
||||
+ end = strrchr(mntPoint, '/');
|
||||
+ if (end == mntPoint) { // reached "/"
|
||||
+ stat("/", &sb);
|
||||
+ if (dsi->dev != sb.st_dev) {
|
||||
+ dsi->mntPoint = xstrdup(mntPoint);
|
||||
+ } else {
|
||||
+ dsi->mntPoint = xstrdup("/");
|
||||
+ }
|
||||
+ break;
|
||||
+ } else if (end) {
|
||||
+ *end = '\0';
|
||||
+ } else { // dirName doesn't start with / - should not happen
|
||||
+ dsi->mntPoint = xstrdup(dirName);
|
||||
+ break;
|
||||
+ }
|
||||
+ stat(mntPoint, &sb);
|
||||
+ if (dsi->dev != sb.st_dev) {
|
||||
+ *end = '/';
|
||||
+ dsi->mntPoint = xstrdup(mntPoint);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ rpmlog(RPMLOG_DEBUG,
|
||||
+ "0x%08x %8" PRId64 " %12" PRId64 " %12" PRId64" %s\n",
|
||||
+ (unsigned) dsi->dev, dsi->bsize,
|
||||
+ dsi->bavail, dsi->iavail,
|
||||
+ dsi->mntPoint);
|
||||
+ return dsi;
|
||||
}
|
||||
|
||||
-static void rpmtsUpdateDSI(const rpmts ts, dev_t dev,
|
||||
+static void rpmtsUpdateDSI(const rpmts ts, dev_t dev, const char *dirName,
|
||||
rpm_loff_t fileSize, rpm_loff_t prevSize, rpm_loff_t fixupSize,
|
||||
rpmFileAction action)
|
||||
{
|
||||
@@ -148,8 +180,10 @@ static void rpmtsUpdateDSI(const rpmts ts, dev_t dev,
|
||||
if (dsi) {
|
||||
while (dsi->bsize && dsi->dev != dev)
|
||||
dsi++;
|
||||
- if (dsi->bsize == 0)
|
||||
- dsi = NULL;
|
||||
+ if (dsi->bsize == 0) {
|
||||
+ /* create new entry */
|
||||
+ dsi = rpmtsCreateDSI(ts, dev, dirName, dsi - ts->dsi);
|
||||
+ }
|
||||
}
|
||||
if (dsi == NULL)
|
||||
return;
|
||||
@@ -192,26 +226,22 @@ static void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
|
||||
rpmDiskSpaceInfo dsi;
|
||||
rpmps ps;
|
||||
int fc;
|
||||
- int i;
|
||||
-
|
||||
- if (ts->filesystems == NULL || ts->filesystemCount <= 0)
|
||||
- return;
|
||||
|
||||
dsi = ts->dsi;
|
||||
- if (dsi == NULL)
|
||||
+ if (dsi == NULL || !dsi->bsize)
|
||||
return;
|
||||
fc = rpmfiFC(rpmteFI(te));
|
||||
if (fc <= 0)
|
||||
return;
|
||||
|
||||
ps = rpmtsProblems(ts);
|
||||
- for (i = 0; i < ts->filesystemCount; i++, dsi++) {
|
||||
+ for (; dsi->bsize; dsi++) {
|
||||
|
||||
if (dsi->bavail >= 0 && adj_fs_blocks(dsi->bneeded) > dsi->bavail) {
|
||||
if (dsi->bneeded != dsi->obneeded) {
|
||||
rpmpsAppend(ps, RPMPROB_DISKSPACE,
|
||||
rpmteNEVRA(te), rpmteKey(te),
|
||||
- ts->filesystems[i], NULL, NULL,
|
||||
+ dsi->mntPoint, NULL, NULL,
|
||||
(adj_fs_blocks(dsi->bneeded) - dsi->bavail) * dsi->bsize);
|
||||
dsi->obneeded = dsi->bneeded;
|
||||
}
|
||||
@@ -221,7 +251,7 @@ static void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
|
||||
if (dsi->ineeded != dsi->oineeded) {
|
||||
rpmpsAppend(ps, RPMPROB_DISKNODES,
|
||||
rpmteNEVRA(te), rpmteKey(te),
|
||||
- ts->filesystems[i], NULL, NULL,
|
||||
+ dsi->mntPoint, NULL, NULL,
|
||||
(adj_fs_blocks(dsi->ineeded) - dsi->iavail));
|
||||
dsi->oineeded = dsi->ineeded;
|
||||
}
|
||||
@@ -230,6 +260,20 @@ static void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
|
||||
ps = rpmpsFree(ps);
|
||||
}
|
||||
|
||||
+static void rpmtsFreeDSI(rpmts ts){
|
||||
+ rpmDiskSpaceInfo dsi;
|
||||
+ if (ts == NULL)
|
||||
+ return;
|
||||
+ dsi = ts->dsi;
|
||||
+ while (dsi && dsi->bsize != 0) {
|
||||
+ dsi->mntPoint = _free(dsi->mntPoint);
|
||||
+ dsi++;
|
||||
+ }
|
||||
+
|
||||
+ ts->dsi = _free(ts->dsi);
|
||||
+}
|
||||
+
|
||||
+
|
||||
/**
|
||||
*/
|
||||
static int archOkay(const char * pkgArch)
|
||||
@@ -543,8 +587,9 @@ assert(otherFi != NULL);
|
||||
}
|
||||
|
||||
/* Update disk space info for a file. */
|
||||
- rpmtsUpdateDSI(ts, fiFps->entry->dev, rpmfiFSize(fi),
|
||||
- rpmfiFReplacedSize(fi), fixupSize, rpmfsGetAction(fs, i));
|
||||
+ rpmtsUpdateDSI(ts, fiFps->entry->dev, fiFps->entry->dirName,
|
||||
+ rpmfiFSize(fi), rpmfiFReplacedSize(fi),
|
||||
+ fixupSize, rpmfsGetAction(fs, i));
|
||||
|
||||
}
|
||||
ps = rpmpsFree(ps);
|
||||
@@ -1338,6 +1383,7 @@ static int rpmtsPrepare(rpmts ts)
|
||||
exit:
|
||||
ht = rpmFpHashFree(ht);
|
||||
fpc = fpCacheFree(fpc);
|
||||
+ rpmtsFreeDSI(ts);
|
||||
return rc;
|
||||
}
|
||||
|
@ -1,96 +0,0 @@
|
||||
commit 35052b96232810cbf0d91a4f1d1d3ff25a142fd0
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Mon Mar 15 11:54:55 2010 +0200
|
||||
|
||||
Add an enhanced argvSplitString() function for splitting strings to argv's
|
||||
- Returns the newly created argv instead of useless "this always returns 0"
|
||||
- By default make a "real" split, including empty strings
|
||||
- Flags argument allows controlling behavior, for now only flag is to
|
||||
preserve argvSplit() behavior but leaves room for future enhancements
|
||||
such as quoted splitting etc
|
||||
|
||||
commit 12802c36c9a3b7260d9f788afc826b1cc5ee05e2
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Mon Mar 15 12:00:55 2010 +0200
|
||||
|
||||
Avoid eating empty lines in spec %prep section (RhBug:573339)
|
||||
- In spec %prep context empty lines don't usually matter but they can
|
||||
be significant in eg here-documents.
|
||||
- Fixes regression from commit 94ff22b129aeb31c38848231e40f87aa4a5613a1
|
||||
|
||||
diff --git a/rpmio/argv.c b/rpmio/argv.c
|
||||
index d633462..f21da1c 100644
|
||||
--- a/rpmio/argv.c
|
||||
+++ b/rpmio/argv.c
|
||||
@@ -168,7 +168,7 @@ int argvAppend(ARGV_t * argvp, ARGV_const_t av)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-int argvSplit(ARGV_t * argvp, const char * str, const char * seps)
|
||||
+ARGV_t argvSplitString(const char * str, const char * seps, argvFlags flags)
|
||||
{
|
||||
char *dest = xmalloc(strlen(str) + 1);
|
||||
ARGV_t argv;
|
||||
@@ -189,14 +189,22 @@ int argvSplit(ARGV_t * argvp, const char * str, const char * seps)
|
||||
argv = xmalloc( (argc + 1) * sizeof(*argv));
|
||||
|
||||
for (c = 0, s = dest; s < t; s+= strlen(s) + 1) {
|
||||
- if (*s == '\0')
|
||||
+ if (*s == '\0' && (flags & ARGV_SKIPEMPTY))
|
||||
continue;
|
||||
argv[c] = xstrdup(s);
|
||||
c++;
|
||||
}
|
||||
argv[c] = NULL;
|
||||
- *argvp = argv;
|
||||
free(dest);
|
||||
+ return argv;
|
||||
+}
|
||||
+
|
||||
+/* Backwards compatibility */
|
||||
+int argvSplit(ARGV_t * argvp, const char * str, const char * seps)
|
||||
+{
|
||||
+ if (argvp) {
|
||||
+ *argvp = argvSplitString(str, seps, ARGV_SKIPEMPTY);
|
||||
+ }
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/rpmio/argv.h b/rpmio/argv.h
|
||||
index 6a6fc7f..86ec137 100644
|
||||
--- a/rpmio/argv.h
|
||||
+++ b/rpmio/argv.h
|
||||
@@ -138,6 +138,20 @@ int argvAddNum(ARGV_t * argvp, int val);
|
||||
*/
|
||||
int argvAppend(ARGV_t * argvp, ARGV_const_t av);
|
||||
|
||||
+typedef enum argvFlags_e {
|
||||
+ ARGV_NONE = 0,
|
||||
+ ARGV_SKIPEMPTY = (1 << 0), /* omit empty strings from result */
|
||||
+} argvFlags;
|
||||
+
|
||||
+/** \ingroup rpmargv
|
||||
+ * Split a string into an argv array.
|
||||
+ * @param str string arg to split
|
||||
+ * @param seps seperator characters
|
||||
+ * @param flags flags to control behavior
|
||||
+ * @return argv array
|
||||
+ */
|
||||
+ARGV_t argvSplitString(const char * str, const char * seps, argvFlags flags);
|
||||
+
|
||||
/** \ingroup rpmargv
|
||||
* Split a string into an argv array.
|
||||
* @retval *argvp argv array
|
||||
diff --git a/build/parsePrep.c b/build/parsePrep.c
|
||||
index 8e10c00..394c162 100644
|
||||
--- a/build/parsePrep.c
|
||||
+++ b/build/parsePrep.c
|
||||
@@ -522,7 +522,7 @@ int parsePrep(rpmSpec spec)
|
||||
}
|
||||
}
|
||||
|
||||
- argvSplit(&saveLines, getStringBuf(sb), "\n");
|
||||
+ saveLines = argvSplitString(getStringBuf(sb), "\n", ARGV_NONE);
|
||||
for (lines = saveLines; *lines; lines++) {
|
||||
res = 0;
|
||||
if (rstreqn(*lines, "%setup", sizeof("%setup")-1)) {
|
@ -1,36 +0,0 @@
|
||||
commit 0e0e332b466a9784620c483faa374067381e96ce
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Wed May 19 10:12:43 2010 +0300
|
||||
|
||||
Handle non-existent dependency sets in python (RhBug:593553)
|
||||
- rpmdsNew() returns NULL if the requested dependency type doesn't
|
||||
exist in the header. The C-side API can handle NULL to all rpmds
|
||||
"methods" and this is how librpm deals with non-existent sets rather
|
||||
than waste memory on for empty ds structures. However the python side
|
||||
wasn't expecting NULL for legal requests (but not setting error either)
|
||||
and thus blowing up with SystemError exception.
|
||||
- Raise TypeError on illegal arguments to rpm.ds constructor, and present
|
||||
non-existent dependency sets as empty rpm.ds objects to python. This
|
||||
lets python callers use iteration over ds items regardless of whether
|
||||
the dependency actually exists or not. The alternative of returning
|
||||
None (or raising exceptions) would break existing code for no
|
||||
particularly good reason.
|
||||
|
||||
diff --git a/python/rpmds-py.c b/python/rpmds-py.c
|
||||
index 771cd06..4587201 100644
|
||||
--- a/python/rpmds-py.c
|
||||
+++ b/python/rpmds-py.c
|
||||
@@ -288,10 +288,11 @@ static PyObject * rpmds_new(PyTypeObject * subtype, PyObject *args, PyObject *kw
|
||||
} else {
|
||||
ds = rpmdsNew(h, tagN, 0);
|
||||
}
|
||||
+ } else {
|
||||
+ PyErr_SetString(PyExc_TypeError, "header or tuple expected");
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
- if (ds == NULL) return NULL;
|
||||
-
|
||||
return rpmds_Wrap(subtype, ds);
|
||||
}
|
||||
|
@ -1,57 +0,0 @@
|
||||
commit 40f788a7bf3741f9c613ff302d4e1b0ceec2658c
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Wed Mar 24 09:53:25 2010 +0200
|
||||
|
||||
Add __bool__() / __nonzero__() method to python rpmmi objects (ticket #153)
|
||||
- Objects supporting __len__() use (len > 0) for boolean representation,
|
||||
which normally makes sense but as the match iterator count is often
|
||||
zero despite the iterator actually existing and returning something,
|
||||
and breaks existing code (rpmlint at least)
|
||||
- Adding a __bool__() (known as __nonzero__() in Python < 3) method
|
||||
returning true for non-NULL iterator fixes this and gives more
|
||||
meaningful answers than pre 4.8.0 which simply always returned True
|
||||
|
||||
diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c
|
||||
index f6dd802..b7bfb1b 100644
|
||||
--- a/python/rpmmi-py.c
|
||||
+++ b/python/rpmmi-py.c
|
||||
@@ -137,11 +137,30 @@ static Py_ssize_t rpmmi_length(rpmmiObject * s)
|
||||
return s->mi ? rpmdbGetIteratorCount(s->mi) : 0;
|
||||
}
|
||||
|
||||
+static int rpmmi_bool(rpmmiObject *s)
|
||||
+{
|
||||
+ return (s->mi != NULL);
|
||||
+}
|
||||
+
|
||||
PyMappingMethods rpmmi_as_mapping = {
|
||||
(lenfunc) rpmmi_length, /* mp_length */
|
||||
0,
|
||||
};
|
||||
|
||||
+static PyNumberMethods rpmmi_as_number = {
|
||||
+ 0, /* nb_add */
|
||||
+ 0, /* nb_subtract */
|
||||
+ 0, /* nb_multiply */
|
||||
+ 0, /* nb_divide */
|
||||
+ 0, /* nb_remainder */
|
||||
+ 0, /* nb_divmod */
|
||||
+ 0, /* nb_power */
|
||||
+ 0, /* nb_negative */
|
||||
+ 0, /* nb_positive */
|
||||
+ 0, /* nb_absolute */
|
||||
+ (inquiry)rpmmi_bool, /* nb_bool/nonzero */
|
||||
+};
|
||||
+
|
||||
static char rpmmi_doc[] =
|
||||
"";
|
||||
|
||||
@@ -156,7 +175,7 @@ PyTypeObject rpmmi_Type = {
|
||||
0, /* tp_setattr */
|
||||
0, /* tp_compare */
|
||||
0, /* tp_repr */
|
||||
- 0, /* tp_as_number */
|
||||
+ &rpmmi_as_number, /* tp_as_number */
|
||||
0, /* tp_as_sequence */
|
||||
&rpmmi_as_mapping, /* tp_as_mapping */
|
||||
0, /* tp_hash */
|
@ -1,18 +0,0 @@
|
||||
commit 8c5332984e32d27d28f9a440947b070af0d14c45
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Mon Mar 15 09:45:49 2010 +0200
|
||||
|
||||
Tell python about RPMTRANS_FLAG_NOCONTEXTS
|
||||
|
||||
diff --git a/python/rpmmodule.c b/python/rpmmodule.c
|
||||
index 4ace4bc..6159aee 100644
|
||||
--- a/python/rpmmodule.c
|
||||
+++ b/python/rpmmodule.c
|
||||
@@ -386,6 +386,7 @@ static int initModule(PyObject *m)
|
||||
REGISTER_ENUM(RPMTRANS_FLAG_NODOCS);
|
||||
REGISTER_ENUM(RPMTRANS_FLAG_ALLFILES);
|
||||
REGISTER_ENUM(RPMTRANS_FLAG_KEEPOBSOLETE);
|
||||
+ REGISTER_ENUM(RPMTRANS_FLAG_NOCONTEXTS);
|
||||
REGISTER_ENUM(RPMTRANS_FLAG_REPACKAGE);
|
||||
REGISTER_ENUM(RPMTRANS_FLAG_REVERSE);
|
||||
REGISTER_ENUM(RPMTRANS_FLAG_NOPRE);
|
@ -1,19 +0,0 @@
|
||||
commit daec6ebf58331776279f389738af4788b865033d
|
||||
Author: Michael Schroeder <mls@suse.de>
|
||||
Date: Mon Apr 12 12:10:20 2010 +0200
|
||||
|
||||
readLineFromOFI may modify the fileStack, thus we have to re-set
|
||||
ofi after calling it
|
||||
|
||||
diff --git a/build/parseSpec.c b/build/parseSpec.c
|
||||
index 06b5a3d..f45022b 100644
|
||||
--- a/build/parseSpec.c
|
||||
+++ b/build/parseSpec.c
|
||||
@@ -274,6 +274,7 @@ int readLine(rpmSpec spec, int strip)
|
||||
retry:
|
||||
if ((rc = readLineFromOFI(spec, ofi)) != 0)
|
||||
return rc;
|
||||
+ ofi = spec->fileStack;
|
||||
|
||||
/* Copy next file line into the spec line buffer */
|
||||
rc = copyNextLineFromOFI(spec, ofi);
|
@ -1,19 +0,0 @@
|
||||
commit ce1d2e87157f4a7ebc4f4d6f26024ac597400367
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Thu Jan 21 13:45:34 2010 +0200
|
||||
|
||||
Fix double-free segfault on url retrieve to read-only media (RhBug:557118)
|
||||
|
||||
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
|
||||
index 6b3dde7..568e13f 100644
|
||||
--- a/lib/rpminstall.c
|
||||
+++ b/lib/rpminstall.c
|
||||
@@ -458,7 +458,7 @@ restart:
|
||||
case URL_IS_HTTPS:
|
||||
case URL_IS_HTTP:
|
||||
case URL_IS_FTP:
|
||||
- { char *tfn;
|
||||
+ { char *tfn = NULL;
|
||||
FD_t tfd;
|
||||
|
||||
if (rpmIsVerbose())
|
@ -1,22 +0,0 @@
|
||||
commit 04ad4b1155ec4b082fbac425a575a0ba05337ab1
|
||||
Author: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Thu Jan 21 14:14:28 2010 +0200
|
||||
|
||||
Really fix verification error code to not depend on verbosity (RhBug:557101)
|
||||
- earlier fix from commit 6649c23cac5823d0c7415df5cfd66e5aac5eebd2 was
|
||||
broken as it could reset return code to zero after detecting errors
|
||||
earlier
|
||||
|
||||
diff --git a/lib/verify.c b/lib/verify.c
|
||||
index 44ab314..1068cfe 100644
|
||||
--- a/lib/verify.c
|
||||
+++ b/lib/verify.c
|
||||
@@ -353,7 +353,7 @@ static int verifyHeader(QVA_t qva, const rpmts ts, Header h)
|
||||
static const char *const aok = ".";
|
||||
static const char *const unknown = "?";
|
||||
|
||||
- ec = (verifyResult != 0);
|
||||
+ if (verifyResult) ec = 1;
|
||||
|
||||
#define _verify(_RPMVERIFY_F, _C) \
|
||||
((verifyResult & _RPMVERIFY_F) ? _C : aok)
|
43
rpm.spec
43
rpm.spec
@ -11,7 +11,7 @@
|
||||
|
||||
%define rpmhome /usr/lib/rpm
|
||||
|
||||
%define rpmver 4.8.0
|
||||
%define rpmver 4.8.1
|
||||
%define snapver %{nil}
|
||||
%define srcver %{rpmver}
|
||||
|
||||
@ -21,10 +21,10 @@
|
||||
Summary: The RPM package management system
|
||||
Name: rpm
|
||||
Version: %{rpmver}
|
||||
Release: 19%{?dist}
|
||||
Release: 1%{?dist}
|
||||
Group: System Environment/Base
|
||||
Url: http://www.rpm.org/
|
||||
Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
|
||||
Source0: http://rpm.org/releases/rpm-4.8.x/%{name}-%{srcver}.tar.bz2
|
||||
%if %{with int_bdb}
|
||||
Source1: db-%{bdbver}.tar.gz
|
||||
%endif
|
||||
@ -41,19 +41,9 @@ Patch4: rpm-4.8.0-psdriver-deps.patch
|
||||
Patch5: rpm-4.8.0-no-man-dirs.patch
|
||||
|
||||
# Patches already in upstream
|
||||
Patch200: rpm-4.8.0-url-segfault.patch
|
||||
Patch201: rpm-4.8.0-verify-exitcode.patch
|
||||
Patch202: rpm-4.8.0-pythondeps-parallel.patch
|
||||
Patch203: rpm-4.8.0-python-bytecompile.patch
|
||||
Patch204: rpm-4.8.0-lazy-statfs.patch
|
||||
Patch205: rpm-4.8.0-erasure-dsi.patch
|
||||
Patch206: rpm-4.8.0-prep-keep-empty.patch
|
||||
Patch207: rpm-4.8.0-python-nocontexts.patch
|
||||
Patch208: rpm-4.8.0-python-mibool.patch
|
||||
Patch209: rpm-4.8.0-python-emptyds.patch
|
||||
Patch210: rpm-4.8.0-findlang-localedirs.patch
|
||||
Patch211: rpm-4.8.0-spec-readline.patch
|
||||
Patch212: rpm-4.8.0-fsm-sbits.patch
|
||||
Patch200: rpm-4.8.0-pythondeps-parallel.patch
|
||||
Patch201: rpm-4.8.0-python-bytecompile.patch
|
||||
Patch202: rpm-4.8.0-findlang-localedirs.patch
|
||||
|
||||
# These are not yet upstream
|
||||
Patch301: rpm-4.6.0-niagara.patch
|
||||
@ -201,19 +191,9 @@ packages on a system.
|
||||
%patch4 -p1 -b .psdriver-deps
|
||||
%patch5 -p1 -b .no-man-dirs
|
||||
|
||||
%patch200 -p1 -b .url-segfault
|
||||
%patch201 -p1 -b .verify-exitcode
|
||||
%patch202 -p1 -b .pythondeps-parallel
|
||||
%patch203 -p1 -b .python-bytecompile
|
||||
%patch204 -p1 -b .lazy-statfs
|
||||
%patch205 -p1 -b .erasure-dsi
|
||||
%patch206 -p1 -b .prep-keep-empty
|
||||
%patch207 -p1 -b .python-nocontexts
|
||||
%patch208 -p1 -b .python-mibool
|
||||
%patch209 -p1 -b .python-emptyds
|
||||
%patch210 -p1 -b .findlang-localedirs
|
||||
%patch211 -p1 -b .spec-readline
|
||||
%patch212 -p1 -b .fsm-sbits
|
||||
%patch200 -p1 -b .pythondeps-parallel
|
||||
%patch201 -p1 -b .python-bytecompile
|
||||
%patch202 -p1 -b .findlang-localedirs
|
||||
|
||||
%patch301 -p1 -b .niagara
|
||||
%patch302 -p1 -b .geode
|
||||
@ -430,6 +410,11 @@ exit 0
|
||||
%doc doc/librpm/html/*
|
||||
|
||||
%changelog
|
||||
* Fri Jun 11 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.1-1
|
||||
- update to 4.8.1 (http://rpm.org/wiki/Releases/4.8.1)
|
||||
- drop no longer needed patches
|
||||
- fix source url pointing to testing directory
|
||||
|
||||
* Thu Jun 03 2010 Panu Matilainen <pmatilai@redhat.com> - 4.8.0-19
|
||||
- also strip POSIX file capabilities from hardlinks on upgrade/erase (#598775)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user