summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-12-14 22:03:14 +0000
committerjbj <devnull@localhost>2002-12-14 22:03:14 +0000
commitbecf1f7abaaf5304384490f8ef256f744f0c8dfc (patch)
tree465bbddc65acf7589504b38be0d06abb31322507 /build
parent96f4a259b507751db2d51b43978ba7b69a149c3a (diff)
downloadlibrpm-tizen-becf1f7abaaf5304384490f8ef256f744f0c8dfc.tar.gz
librpm-tizen-becf1f7abaaf5304384490f8ef256f744f0c8dfc.tar.bz2
librpm-tizen-becf1f7abaaf5304384490f8ef256f744f0c8dfc.zip
- generate Elf provides even if file is not executable.
CVS patchset: 5942 CVS date: 2002/12/14 22:03:14
Diffstat (limited to 'build')
-rw-r--r--build/rpmfc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/build/rpmfc.c b/build/rpmfc.c
index a3e7621a4..9bc236990 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -737,6 +737,7 @@ static int rpmfcELF(rpmfc fc)
char buf[BUFSIZ];
const char * s;
unsigned char deptype;
+ struct stat sb, * st = &sb;
const char * soname = NULL;
rpmds * depsp, this;
int_32 tagN, dsContext;
@@ -744,6 +745,10 @@ static int rpmfcELF(rpmfc fc)
int xx;
int isElf64;
+ /* Files with executable bit set only. */
+ if (stat(fn, st) != 0)
+ return(-1);
+
fdno = open(fn, O_RDONLY);
if (fdno < 0)
return fdno;
@@ -831,7 +836,8 @@ static int rpmfcELF(rpmfc fc)
case SHT_GNU_verneed:
deptype = 'R';
data = NULL;
- if (!fc->skipReq)
+ /* Files with executable bit set only. */
+ if (!fc->skipReq && (st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
while ((data = elf_getdata (scn, data)) != NULL) {
offset = 0;
for (cnt = shdr->sh_info; --cnt >= 0; ) {
@@ -895,9 +901,10 @@ static int rpmfcELF(rpmfc fc)
/*@innercontinue@*/ continue;
/*@notreached@*/ /*@switchbreak@*/ break;
case DT_NEEDED:
- /* Add to package requires. */
- if (fc->skipReq)
+ /* Files with executable bit set only. */
+ if (fc->skipReq || !(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
/*@innercontinue@*/ continue;
+ /* Add to package requires. */
deptype = 'R';
depsp = &fc->requires;
tagN = RPMTAG_REQUIRENAME;
@@ -978,7 +985,6 @@ int rpmfcApply(rpmfc fc)
const char * N;
const char * EVR;
int_32 Flags;
- struct stat sb, * st = &sb;
unsigned char deptype;
int nddict;
int previx;
@@ -992,11 +998,6 @@ int rpmfcApply(rpmfc fc)
for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) {
rpmfcApplyTbl fcat;
- /* Files with executable bit set only. */
- if (stat(fc->fn[fc->ix], st) != 0
- || !(st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
- continue;
-
for (fcat = rpmfcApplyTable; fcat->func != NULL; fcat++) {
if (!(fc->fcolor->vals[fc->ix] & fcat->colormask))
/*@innercontinue@*/ continue;