From 95b03441ccd5483503d9f5455655c256d0932007 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sun, 27 Jan 2008 16:39:40 +0200 Subject: [PATCH] Rename isCompressed() -> rpmFileIsCompressed() for namespacing --- build.c | 2 +- build/parsePrep.c | 4 ++-- rpmio/macro.c | 2 +- rpmio/rpmfileutil.c | 2 +- rpmio/rpmfileutil.h | 17 ++++++++--------- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/build.c b/build.c index a7dbfa1..940667f 100644 --- a/build.c +++ b/build.c @@ -128,7 +128,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba) (void) mktemp(tmpSpecFile); #endif - (void) isCompressed(arg, &res); + (void) rpmFileIsCompressed(arg, &res); cmd = alloca(strlen(arg) + 50 + strlen(tmpSpecFile)); sprintf(cmd, "%s < '%s' | tar xOvf - Specfile 2>&1 > '%s'", diff --git a/build/parsePrep.c b/build/parsePrep.c index 5d76cfe..04c63f1 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -100,7 +100,7 @@ static char *doPatch(rpmSpec spec, int c, int strip, const char *db, t = stpcpy(t, " -E"); /* XXX On non-build parse's, file cannot be stat'd or read */ - if (!spec->force && (isCompressed(urlfn, &compressed) || checkOwners(urlfn))) { + if (!spec->force && (rpmFileIsCompressed(urlfn, &compressed) || checkOwners(urlfn))) { urlfn = _free(urlfn); return NULL; } @@ -202,7 +202,7 @@ static const char *doUntar(rpmSpec spec, int c, int quietly) #endif /* XXX On non-build parse's, file cannot be stat'd or read */ - if (!spec->force && (isCompressed(urlfn, &compressed) || checkOwners(urlfn))) { + if (!spec->force && (rpmFileIsCompressed(urlfn, &compressed) || checkOwners(urlfn))) { urlfn = _free(urlfn); return NULL; } diff --git a/rpmio/macro.c b/rpmio/macro.c index a27175d..ebf55c4 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -996,7 +996,7 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn, for (be = b; (c = *be) && !isblank(c);) be++; *be++ = '\0'; - (void) isCompressed(b, &compressed); + (void) rpmFileIsCompressed(b, &compressed); switch(compressed) { default: case COMPRESSED_NOT: diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c index 32e95a6..9e141a5 100644 --- a/rpmio/rpmfileutil.c +++ b/rpmio/rpmfileutil.c @@ -368,7 +368,7 @@ int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid) return rc; } -int isCompressed(const char * file, rpmCompressedMagic * compressed) +int rpmFileIsCompressed(const char * file, rpmCompressedMagic * compressed) { FD_t fd; ssize_t nb; diff --git a/rpmio/rpmfileutil.h b/rpmio/rpmfileutil.h index 04824c0..dfeaaca 100644 --- a/rpmio/rpmfileutil.h +++ b/rpmio/rpmfileutil.h @@ -58,15 +58,6 @@ int rpmMkTempFile(const char * prefix, char ** fnptr, FD_t * fdptr); int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid); /** \ingroup rpmfileutil - * Return type of compression used in file. - * @param file name of file - * @retval compressed address of compression type - * @return 0 on success, 1 on I/O error - */ -int isCompressed (const char * file, - rpmCompressedMagic * compressed); - -/** \ingroup rpmfileutil * Canonicalize file path. * @param path path to canonicalize (in-place) * @return pointer to path @@ -111,6 +102,14 @@ int rpmGlob(const char * patterns, int * argcPtr, char *** argvPtr); char * rpmEscapeSpaces(const char * s); /** \ingroup rpmfileutil + * Return type of compression used in file. + * @param file name of file + * @retval compressed address of compression type + * @return 0 on success, 1 on I/O error + */ +int rpmFileIsCompressed (const char * file, rpmCompressedMagic * compressed); + +/** \ingroup rpmfileutil * Check if path (string) ends with given suffix * @param path (path) string * @param suffix suffix string to check for -- 2.7.4