summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2003-01-06 23:55:44 +0000
committerjbj <devnull@localhost>2003-01-06 23:55:44 +0000
commitb4ca0ec8b20851e331578b7191d8562e3f0de17f (patch)
tree5d4c9f6cc4ceb7d5317f69f84893bc0ccff4a73f /build
parentc4e0fdbf2120af5017e0c2c08ecdfa943e7c330d (diff)
downloadlibrpm-tizen-b4ca0ec8b20851e331578b7191d8562e3f0de17f.tar.gz
librpm-tizen-b4ca0ec8b20851e331578b7191d8562e3f0de17f.tar.bz2
librpm-tizen-b4ca0ec8b20851e331578b7191d8562e3f0de17f.zip
- for DSO's, provide the file basename if DT_SONAME not found.
CVS patchset: 5998 CVS date: 2003/01/06 23:55:44
Diffstat (limited to 'build')
-rw-r--r--build/rpmfc.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 4322d06fc..af1caa67b 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -753,7 +753,6 @@ static int rpmfcELF(rpmfc fc)
int cnt;
char buf[BUFSIZ];
const char * s;
- unsigned char deptype;
struct stat sb, * st = &sb;
const char * soname = NULL;
rpmds * depsp, ds;
@@ -761,6 +760,8 @@ static int rpmfcELF(rpmfc fc)
char * t;
int xx;
int isElf64;
+ int isDSO;
+ int gotSONAME = 0;
/* Files with executable bit set only. */
if (stat(fn, st) != 0)
@@ -782,6 +783,7 @@ static int rpmfcELF(rpmfc fc)
/*@=evalorder@*/
isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64;
+ isDSO = ehdr->e_type == ET_DYN;
/*@-branchstate -uniondef @*/
scn = NULL;
@@ -796,7 +798,6 @@ static int rpmfcELF(rpmfc fc)
continue;
/*@notreached@*/ /*@switchbreak@*/ break;
case SHT_GNU_verdef:
- deptype = 'P';
data = NULL;
if (!fc->skipProv)
while ((data = elf_getdata (scn, data)) != NULL) {
@@ -851,7 +852,6 @@ static int rpmfcELF(rpmfc fc)
}
/*@switchbreak@*/ break;
case SHT_GNU_verneed:
- deptype = 'R';
data = NULL;
/* Files with executable bit set only. */
if (!fc->skipReq && (st->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
@@ -923,7 +923,6 @@ static int rpmfcELF(rpmfc fc)
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;
dsContext = RPMSENSE_FIND_REQUIRES;
@@ -931,10 +930,10 @@ static int rpmfcELF(rpmfc fc)
assert(s != NULL);
/*@switchbreak@*/ break;
case DT_SONAME:
+ gotSONAME = 1;
/* Add to package provides. */
if (fc->skipProv)
/*@innercontinue@*/ continue;
- deptype = 'P';
depsp = &fc->provides;
tagN = RPMTAG_PROVIDENAME;
dsContext = RPMSENSE_FIND_PROVIDES;
@@ -972,6 +971,37 @@ assert(s != NULL);
}
/*@=branchstate =uniondef @*/
+ /* For DSO's, provide the basename of the file if DT_SONAME not found. */
+ if (!fc->skipProv && isDSO && !gotSONAME) {
+ depsp = &fc->provides;
+ tagN = RPMTAG_PROVIDENAME;
+
+ s = strrchr(fn, '/');
+ if (s)
+ s++;
+ else
+ s = fn;
+
+ buf[0] = '\0';
+ t = buf;
+ t = stpcpy(t, s);
+
+#if !defined(__alpha__)
+ if (isElf64)
+ t = stpcpy(t, "()(64bit)");
+#endif
+ t++;
+
+ /* Add to package dependencies. */
+ ds = rpmdsSingle(tagN, buf, "", dsContext);
+ xx = rpmdsMerge(depsp, ds);
+
+ /* Add to file dependencies. */
+ xx = rpmfcSaveArg(&fc->ddict, rpmfcFileDep(t, fc->ix, ds));
+
+ ds = rpmdsFree(ds);
+ }
+
exit:
soname = _free(soname);
if (elf) (void) elf_end(elf);