]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-chroot-hack.patch
- compress debuginfo sections with zlib (reduce /usr/lib/debug size).
[packages/rpm.git] / rpm-chroot-hack.patch
1 --- rpm-4.5/rpmio/rpmrpc.c~     2009-10-16 01:18:18.566743349 +0300
2 +++ rpm-4.5/rpmio/rpmrpc.c      2009-10-16 01:18:21.863999841 +0300
3 @@ -179,5 +179,6 @@
4  {
5      const char * lpath;
6      int ut = urlPath(path, &lpath);
7 +    int fdno;
8  
9  if (_rpmio_debug)
10 @@ -212,7 +213,17 @@
11      if (mode == 0)
12         mode = 0644;
13  #endif
14 -    return open(path, flags, mode);
15 +    fdno = open(path, flags, mode);
16 +    /* XXX if the open(2) fails, try to strip a possible chroot(2) prefix. */
17 +    if (fdno < 0 && errno == ENOENT) {
18 +        const char *dbpath = rpmExpand("%{_dbpath}", "/", NULL);
19 +        const char *fn = strstr(path + 1, dbpath);
20 +        if (fn)
21 +            fdno = open(fn, flags, mode);
22 +        if (dbpath)
23 +                dbpath = _free(dbpath);
24 +    }
25 +    return fdno;
26  }
27  
28  /* XXX rpmdb.c: analogue to rename(2). */
This page took 0.026323 seconds and 3 git commands to generate.