any time
- added --changelog alias to query a packages changelog entry
- added mntctl() support for AIX (I think, I can't test this)
+ - fflags query type displays 's' for specfiles, 'm' for missingok
+ files, and 'n' for noreplace files
+ - implemented %config(missingok) flag in install
+ - added --allfiles flag for -i and -U, which forces all files (even
+ missingok files) to be installed
2.4 -> 2.4.1:
- take advantage of lchown() if it's available
static char * fflagsFormat(int_32 type, const void * data,
char * formatPrefix, int padding, int element) {
char * val;
- char buf[10];
+ char buf[15];
int anint = *((int_32 *) data);
if (type != RPM_INT32_TYPE) {
strcat(buf, "d");
if (anint & RPMFILE_CONFIG)
strcat(buf, "c");
+ if (anint & RPMFILE_SPECFILE)
+ strcat(buf, "s");
+ if (anint & RPMFILE_MISSINGOK)
+ strcat(buf, "m");
+ if (anint & RPMFILE_NOREPLACE)
+ strcat(buf, "n");
val = malloc(5 + padding);
strcat(formatPrefix, "s");
short mode2, char * md52, char * link2);
static enum instActions decideFileFate(char * filespec, short dbMode,
char * dbMd5, char * dbLink, short newMode,
- char * newMd5, char * newLink, int brokenMd5);
+ char * newMd5, char * newLink, int newFlags,
+ int instFlags, int brokenMd5);
static int installArchive(int fd, struct fileInfo * files,
int fileCount, rpmNotifyFunction notify,
char ** specFile, int archiveSize);
static enum instActions decideFileFate(char * filespec, short dbMode,
char * dbMd5, char * dbLink, short newMode,
- char * newMd5, char * newLink, int brokenMd5) {
+ char * newMd5, char * newLink, int newFlags,
+ int instFlags, int brokenMd5) {
char buffer[1024];
char * dbAttr, * newAttr;
enum fileTypes dbWhat, newWhat, diskWhat;
int i, rc;
if (lstat(filespec, &sb)) {
- /* the file doesn't exist on the disk - might as well make it */
- return CREATE;
+ /* the file doesn't exist on the disk create it unless the new
+ package has marked it as missingok */
+ if (!(instFlags & RPMINSTALL_ALLFILES) &&
+ (newFlags & RPMFILE_MISSINGOK)) {
+ rpmMessage(RPMMESS_DEBUG, "%s skipped due to missingok flag\n",
+ filespec);
+ return SKIP;
+ } else
+ return CREATE;
}
diskWhat = whatis(sb.st_mode);
secFileMd5List[secNum], secFileLinksList[secNum],
files[mainNum].mode, files[mainNum].md5,
files[mainNum].link,
+ files[sharedList[i].mainFileNumber].flags,
+ flags,
!headerIsEntry(sech, RPMTAG_RPMVERSION));
}
}
#define RPMINSTALL_NOSCRIPTS (1 << 6)
#define RPMINSTALL_NOARCH (1 << 7)
#define RPMINSTALL_NOOS (1 << 8)
+#define RPMINSTALL_ALLFILES (1 << 9)
#define RPMUNINSTALL_TEST (1 << 0)
#define RPMUNINSTALL_NOSCRIPTS (1 << 1)
puts(_(" [--replacepkgs] [--replacefiles] [--root <dir>]"));
puts(_(" [--excludedocs] [--includedocs] [--noscripts]"));
puts(_(" [--rcfile <file>] [--ignorearch] [--dbpath <dir>]"));
- puts(_(" [--prefix <dir>] [--ignoreos] [--nodeps]"));
+ puts(_(" [--prefix <dir>] [--ignoreos] [--nodeps] [--allfiles]"));
puts(_(" [--ftpproxy <host>] [--ftpport <port>]"));
puts(_(" file1.rpm ... fileN.rpm"));
puts(_(" rpm {--upgrade -U} [-v] [--hash -h] [--percent] [--force] [--test]"));
puts(_(" [--excludedocs] [--includedocs] [--rcfile <file>]"));
puts(_(" [--ignorearch] [--dbpath <dir>] [--prefix <dir>] "));
puts(_(" [--ftpproxy <host>] [--ftpport <port>]"));
- puts(_(" [--ignoreos] [--nodeps] file1.rpm ... fileN.rpm"));
+ puts(_(" [--ignoreos] [--nodeps] [--allfiles]"));
+ puts(_(" file1.rpm ... fileN.rpm"));
puts(_(" rpm {--query -q} [-afpg] [-i] [-l] [-s] [-d] [-c] [-v] [-R]"));
puts(_(" [--scripts] [--root <dir>] [--rcfile <file>]"));
puts(_(" [--whatprovides] [--whatrequires] [--requires]"));
puts( " -h");
printHelpLine(" --hash ",
_("print hash marks as package installs (good with -v)"));
+ printHelpLine(" --allfiles ",
+ _("install all files, even configurations which might "
+ "otherwise be skipped"));
printHelpLine(" --ignorearch ",
_("don't verify package architecture"));
printHelpLine(" --ignoreos ",
int incldocs = 0, noScripts = 0, noDeps = 0, allMatches = 0;
int noPgp = 0, dump = 0, initdb = 0, ignoreArch = 0, showrc = 0;
int gotDbpath = 0, building = 0, ignoreOs = 0, noFiles = 0, verifyFlags;
- int noMd5 = 0;
+ int noMd5 = 0, allFiles = 0;
int checksigFlags = 0;
char *tce;
int timeCheck = 0;
struct poptOption optionsTable[] = {
{ "addsign", '\0', 0, 0, GETOPT_ADDSIGN },
{ "all", 'a', 0, 0, 'a' },
+ { "allfiles", '\0', 0, &allFiles, 0 },
{ "allmatches", 'a', 0, &allMatches, 0 },
{ "build", 'b', POPT_ARG_STRING, 0, 'b' },
{ "buildarch", '\0', POPT_ARG_STRING, 0, 0 },
argerror(_("--allmatches may only be specified during package "
"erasure"));
+ if (allFiles && bigMode != MODE_INSTALL)
+ argerror(_("--allfiles may only be specified during package "
+ "installation"));
+
if (bigMode != MODE_INSTALL && bigMode != MODE_UNINSTALL &&
bigMode != MODE_VERIFY && noScripts)
argerror(_("--noscripts may only be specified during package "
if (noScripts) installFlags |= RPMINSTALL_NOSCRIPTS;
if (ignoreArch) installFlags |= RPMINSTALL_NOARCH;
if (ignoreOs) installFlags |= RPMINSTALL_NOOS;
+ if (allFiles) installFlags |= RPMINSTALL_ALLFILES;
if (showPercents) interfaceFlags |= INSTALL_PERCENT;
if (showHash) interfaceFlags |= INSTALL_HASH;