RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 31-May-2009 21:56:59 Branch: HEAD Handle: 2009053119565801 Modified files: rpm CHANGES macros.in rpm/lib psm.c psm.h rpm/rpmio url.c Log: - performance tweaks. - change default dep whiteout to ensure filessystem before setup. - prepare to save install scriptlet states/metrics. Summary: Revision Changes Path 1.3006 +3 -0 rpm/CHANGES 2.371 +5 -5 rpm/lib/psm.c 2.77 +2 -1 rpm/lib/psm.h 1.287 +3 -2 rpm/macros.in 1.71 +33 -55 rpm/rpmio/url.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.3005 -r1.3006 CHANGES --- rpm/CHANGES 30 May 2009 20:37:19 -0000 1.3005 +++ rpm/CHANGES 31 May 2009 19:56:58 -0000 1.3006 @@ -1,5 +1,8 @@ 5.2b1 -> 5.3a1 + - jbj: performance tweaks. + - jbj: change default dep whiteout to ensure filessystem before setup. + - jbj: prepare to save install scriptlet states/metrics. - jbj: build: add build scriptlet status/duration to SRPM headers. - jbj: build: use rpmsqExecve to run build scriptlets. - jbj: build: tear down _pkgPool/_specPool before exiting. @@ . patch -p0 <<'@@ .' Index: rpm/lib/psm.c ============================================================================ $ cvs diff -u -r2.370 -r2.371 psm.c --- rpm/lib/psm.c 30 May 2009 18:58:48 -0000 2.370 +++ rpm/lib/psm.c 31 May 2009 19:56:59 -0000 2.371 @@ -496,7 +496,7 @@ (unsigned)msecs/1000, (unsigned)msecs%1000); if (psm->sstates != NULL) - { int * ssp = psm->sstates + tag2slx(psm->scriptTag); + { rpmuint32_t * ssp = psm->sstates + tag2slx(psm->scriptTag); *ssp &= ~0xffff; *ssp |= (psm->sq.status & 0xffff); *ssp |= RPMSCRIPT_STATE_REAPED; @@ -646,7 +646,7 @@ int rootFdno = -1; rpmRC rc = RPMRC_OK; int xx = 0; - int * ssp = NULL; + rpmuint32_t * ssp = NULL; int inChroot = enterChroot(psm, &rootFdno); if (psm->sstates != NULL) @@ -773,7 +773,7 @@ FD_t out = NULL; /* exit: expects this to be initialized. */ rpmRC rc = RPMRC_FAIL; /* assume failure */ const char * body = NULL; - int * ssp = NULL; + rpmuint32_t * ssp = NULL; pid_t pid; int xx; int i; @@ -1697,7 +1697,6 @@ psm->ts = NULL; /*...@=internalglobs@*/ - psm->sstates = _free(psm->sstates); psm->IPhe->p.ptr = _free(psm->IPhe->p.ptr); psm->IPhe = _free(psm->IPhe); psm->NVRA = _free(psm->NVRA); @@ -1744,7 +1743,8 @@ psm->triggers = NULL; psm->NVRA = NULL; psm->IPhe = xcalloc(1, sizeof(*psm->IPhe)); - psm->sstates = xcalloc(RPMSCRIPT_MAX, sizeof(*psm->sstates)); + memset(psm->sstates, 0, sizeof(psm->sstates)); + memset(psm->smetrics, 0, sizeof(psm->smetrics)); return rpmpsmLink(psm, msg); } @@ . patch -p0 <<'@@ .' Index: rpm/lib/psm.h ============================================================================ $ cvs diff -u -r2.76 -r2.77 psm.h --- rpm/lib/psm.h 30 May 2009 19:41:58 -0000 2.76 +++ rpm/lib/psm.h 31 May 2009 19:56:59 -0000 2.77 @@ -119,7 +119,8 @@ /*...@dependent@*/ const char * pkgfn; /*!< Repackage file name. */ /*...@only@*/ /*...@null@*/ - int *sstates; /*!< Scriptlet states and return codes. */ + rpmuint32_t sstates[RPMSCRIPT_MAX]; /*!< Scriptlet return codes. */ + rpmuint32_t smetrics[RPMSCRIPT_MAX];/*!< Scriptlet time metrics. */ rpmTag scriptTag; /*!< Scriptlet data tag. */ rpmTag progTag; /*!< Scriptlet interpreter tag. */ int npkgs_installed; /*!< No. of installed instances. */ @@ . patch -p0 <<'@@ .' Index: rpm/macros.in ============================================================================ $ cvs diff -u -r1.286 -r1.287 macros.in --- rpm/macros.in 30 May 2009 14:35:29 -0000 1.286 +++ rpm/macros.in 31 May 2009 19:56:58 -0000 1.287 @@ -1,7 +1,7 @@ #/*! \page config_macros Default configuration: @USRLIBRPM@/macros # \verbatim # -# $Id: macros.in,v 1.286 2009/05/30 14:35:29 jbj Exp $ +# $Id: macros.in,v 1.287 2009/05/31 19:56:58 jbj Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -984,7 +984,8 @@ pam>coreutils \ pam>initscripts \ glibc-common>glibc \ - glibc>nscd + glibc>nscd \ + filesystem>setup %_dependency_whiteout \ %{?_dependency_whiteout_caos_core} \ @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/url.c ============================================================================ $ cvs diff -u -r1.70 -r1.71 url.c --- rpm/rpmio/url.c 6 Apr 2009 00:21:23 -0000 1.70 +++ rpm/rpmio/url.c 31 May 2009 19:56:59 -0000 1.71 @@ -362,79 +362,57 @@ /*...@observer@*/ /*...@unchecked@*/ static struct urlstring { /*...@observer@*/ /*...@null@*/ - const char * leadin; + const char *leadin; + size_t len; urltype ret; } urlstrings[] = { - { "file://", URL_IS_PATH }, - { "ftp://", URL_IS_FTP }, - { "hkp://", URL_IS_HKP }, - { "http://", URL_IS_HTTP }, - { "https://", URL_IS_HTTPS }, - { "-", URL_IS_DASH }, - { NULL, URL_IS_UNKNOWN } + { "file://", sizeof("file://")-1, URL_IS_PATH }, + { "ftp://", sizeof("ftp://")-1, URL_IS_FTP }, + { "hkp://", sizeof("hkp://")-1, URL_IS_HKP }, + { "http://", sizeof("http://")-1, URL_IS_HTTP }, + { "https://", sizeof("https://")-1, URL_IS_HTTPS }, + { "-", sizeof("-")-1, URL_IS_DASH }, + { NULL, 0, URL_IS_UNKNOWN } }; urltype urlIsURL(const char * url) { struct urlstring *us; + int ut = URL_IS_UNKNOWN;; - if (url && *url) { - for (us = urlstrings; us->leadin != NULL; us++) { - if (strncmp(url, us->leadin, strlen(us->leadin))) - continue; - return us->ret; - } + if (url && *url && *url != '/') + for (us = urlstrings; us->leadin != NULL; us++) { + if (strncmp(url, us->leadin, us->len)) + continue; + ut = us->ret; + break; } - - return URL_IS_UNKNOWN; + return ut; } /* Return path portion of url (or pointer to NUL if url == NULL) */ urltype urlPath(const char * url, const char ** pathp) { - const char *path; - int urltype; + static const char empty[] = ""; + const char *path = (url ? url : empty); + int ut = URL_IS_UNKNOWN; - path = url; - urltype = urlIsURL(url); - switch (urltype) { - case URL_IS_FTP: - url += sizeof("ftp://") - 1; - path = strchr(url, '/'); - if (path == NULL) path = url + strlen(url); - break; - case URL_IS_PATH: - url += sizeof("file://") - 1; - path = strchr(url, '/'); - if (path == NULL) path = url + strlen(url); - break; - case URL_IS_HKP: - url += sizeof("hkp://") - 1; - path = strchr(url, '/'); - if (path == NULL) path = url + strlen(url); - break; - case URL_IS_HTTP: - url += sizeof("http://") - 1; - path = strchr(url, '/'); - if (path == NULL) path = url + strlen(url); - break; - case URL_IS_HTTPS: - url += sizeof("https://") - 1; - path = strchr(url, '/'); - if (path == NULL) path = url + strlen(url); - break; - case URL_IS_UNKNOWN: - if (path == NULL) path = ""; - break; - case URL_IS_DASH: - path = ""; - break; + if (*path != '\0' && *path != '/') { + struct urlstring *us; + for (us = urlstrings; us->leadin != NULL; us++) { + if (strncmp(url, us->leadin, us->len)) + continue; + if ((path = strchr(url+us->len, '/')) == NULL) + path = empty; + ut = us->ret; + break; + } } +/*...@-observertrans@*/ if (pathp) - /*...@-observertrans@*/ *pathp = path; - /*...@=observertrans@*/ - return urltype; +/*...@=observertrans@*/ + return ut; } /** @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org