fixed rpmExpand usage

This commit is contained in:
Дмитрий Левин 2005-09-29 17:10:24 +00:00
parent 4086557633
commit 6a14cbc258
4 changed files with 22 additions and 22 deletions

View File

@ -82,36 +82,36 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test)
case RPMBUILD_PREP:
name = "%prep";
sb = spec->prep;
mTemplate = "%{__spec_prep_template}";
mPost = "%{__spec_prep_post}";
mTemplate = "%{?__spec_prep_template}";
mPost = "%{?__spec_prep_post}";
break;
case RPMBUILD_BUILD:
name = "%build";
sb = spec->build;
mTemplate = "%{__spec_build_template}";
mPost = "%{__spec_build_post}";
mTemplate = "%{?__spec_build_template}";
mPost = "%{?__spec_build_post}";
break;
case RPMBUILD_INSTALL:
name = "%install";
sb = spec->install;
mTemplate = "%{__spec_install_template}";
mPost = "%{__spec_install_post}";
mTemplate = "%{?__spec_install_template}";
mPost = "%{?__spec_install_post}";
break;
case RPMBUILD_CLEAN:
name = "%clean";
sb = spec->clean;
mTemplate = "%{__spec_clean_template}";
mPost = "%{__spec_clean_post}";
mTemplate = "%{?__spec_clean_template}";
mPost = "%{?__spec_clean_post}";
break;
case RPMBUILD_RMBUILD:
name = "--clean";
mTemplate = "%{__spec_clean_template}";
mPost = "%{__spec_clean_post}";
mTemplate = "%{?__spec_clean_template}";
mPost = "%{?__spec_clean_post}";
break;
case RPMBUILD_STRINGBUF:
default:
mTemplate = "%{___build_template}";
mPost = "%{___build_post}";
mTemplate = "%{?___build_template}";
mPost = "%{?___build_post}";
break;
}
/*@=branchstate@*/

View File

@ -2493,8 +2493,8 @@ static int generateDepends(Spec spec, Package pkg, TFI_t cpioList, int multiLib)
const char *runCmd = NULL;
const char *runTemplate = NULL;
const char *runPost = NULL;
const char *mTemplate = "%{__spec_autodep_template}";
const char *mPost = "%{__spec_autodep_post}";
const char *mTemplate = "%{?__spec_autodep_template}";
const char *mPost = "%{?__spec_autodep_post}";
urlinfo u = NULL;
if (!(fi && fi->fc > 0))
@ -2836,8 +2836,8 @@ static int checkFiles(Spec spec, StringBuf fileList, int fileListLen)
const char *runCmd = NULL;
const char *rootDir;
const char *runScript;
const char *mTemplate = "%{__spec_autodep_template}";
const char *mPost = "%{__spec_autodep_post}";
const char *mTemplate = "%{?__spec_autodep_template}";
const char *mPost = "%{?__spec_autodep_post}";
urlinfo u = NULL;
FD_t fd, xfd;
FILE *fp = 0;

View File

@ -1460,8 +1460,8 @@ assert(psm->mi == NULL);
headerSprintf(fi->h, bfmt, rpmTagTable, rpmHeaderFormats, NULL);
bfmt = _free(bfmt);
psm->pkgURL = rpmGenPath("%{?_repackage_root:%{_repackage_root}}",
"%{?_repackage_dir:%{_repackage_dir}}",
psm->pkgURL = rpmGenPath("%{?_repackage_root}",
"%{?_repackage_dir}",
pkgbn);
pkgbn = _free(pkgbn);
(void) urlPath(psm->pkgURL, &psm->pkgfn);

View File

@ -3390,9 +3390,9 @@ int rpmdbRebuild(const char * prefix)
_dbapi_rebuild = rpmExpandNumeric("%{?_dbapi_rebuild}");
/*@-nullpass@*/
tfn = rpmGetPath("%{_dbpath}", NULL);
tfn = rpmGetPath("%{?_dbpath}", NULL);
/*@=nullpass@*/
if (!(tfn && tfn[0] != '%')) {
if (!(tfn && tfn[0])) {
rpmMessage(RPMMESS_DEBUG, _("no dbpath has been set"));
rc = 1;
goto exit;
@ -3403,9 +3403,9 @@ int rpmdbRebuild(const char * prefix)
tfn = _free(tfn);
/*@-nullpass@*/
tfn = rpmGetPath("%{_dbpath_rebuild}", NULL);
tfn = rpmGetPath("%{?_dbpath_rebuild}", NULL);
/*@=nullpass@*/
if (!(tfn && tfn[0] != '%' && strcmp(tfn, dbpath))) {
if (!(tfn && tfn[0] && strcmp(tfn, dbpath))) {
char *pidbuf;
char *t;
asprintf(&pidbuf, "rebuilddb.%u", getpid());