diff options
author | tron <tron> | 2009-04-23 21:38:02 +0000 |
---|---|---|
committer | tron <tron> | 2009-04-23 21:38:02 +0000 |
commit | 0fa62bff8416a10f1b364367f4265295c762c085 (patch) | |
tree | 18b149fb5692d17a5191a9cbc547eeee63e40ad8 /pkgtools | |
parent | ff1acb51233810a7fbafe0eecde1114cb73fcb16 (diff) | |
download | pkgsrc-0fa62bff8416a10f1b364367f4265295c762c085.tar.gz |
Update "rpm2pkg" package to version 2.2. Changes since version 2.1.1:
- Switch to 2-clause BSD license.
- Compile with extra warnings (again) if GCC is used as the compiler.
- Fix build warnings reported by "-Wsign-compare".
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/rpm2pkg/Makefile | 13 | ||||
-rw-r--r-- | pkgtools/rpm2pkg/files/rpm2pkg.c | 18 |
2 files changed, 15 insertions, 16 deletions
diff --git a/pkgtools/rpm2pkg/Makefile b/pkgtools/rpm2pkg/Makefile index 70dc81963f7..81f86504689 100644 --- a/pkgtools/rpm2pkg/Makefile +++ b/pkgtools/rpm2pkg/Makefile @@ -1,7 +1,6 @@ -# $NetBSD: Makefile,v 1.40 2009/04/09 00:48:14 joerg Exp $ +# $NetBSD: Makefile,v 1.41 2009/04/23 21:38:02 tron Exp $ -DISTNAME= rpm2pkg-2.1.1 -PKGREVISION= 2 +DISTNAME= rpm2pkg-2.2 CATEGORIES= pkgtools MASTER_SITES= # empty DISTFILES= # empty @@ -12,6 +11,8 @@ COMMENT= Convert RPM archives to NetBSD packages CONFLICTS+= suse-base<=6.4 +LICENSE= modified-bsd + PKG_DESTDIR_SUPPORT= user-destdir WRKSRC= ${WRKDIR} @@ -20,10 +21,10 @@ CPPFLAGS+= ${BUILDLINK_CPPFLAGS.bzip2} ${BUILDLINK_CPPFLAGS.rpm} \ ${BUILDLINK_CPPFLAGS.zlib} LIBS+= -lrpm -lintl -lz -lbz2 -.include "../../mk/bsd.prefs.mk" +.include "../../mk/compiler.mk" -.if (${CC} == gcc) -CFLAGS+= -Wall +.if !empty(CC_VERSION:Mgcc-*) +CFLAGS+= -Wall -Wshadow -Wsign-compare -Wunused-value .endif INSTALLATION_DIRS= ${PKGMANDIR}/man8 sbin diff --git a/pkgtools/rpm2pkg/files/rpm2pkg.c b/pkgtools/rpm2pkg/files/rpm2pkg.c index b83285d1f34..00cf7b26d6a 100644 --- a/pkgtools/rpm2pkg/files/rpm2pkg.c +++ b/pkgtools/rpm2pkg/files/rpm2pkg.c @@ -1,7 +1,7 @@ -/* $NetBSD: rpm2pkg.c,v 1.6 2006/01/21 20:46:29 tron Exp $ */ +/* $NetBSD: rpm2pkg.c,v 1.7 2009/04/23 21:38:02 tron Exp $ */ /*- - * Copyright (c) 2004 The NetBSD Foundation, Inc. + * Copyright (c) 2004-2009 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -15,9 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -128,10 +125,10 @@ typedef struct FileHandleStruct { } FileHandle; static int -InitBuffer(void **Buffer, int *BufferSizePtr) +InitBuffer(void **Buffer, size_t *BufferSizePtr) { if (*Buffer == NULL) { - int BufferSize; + size_t BufferSize; BufferSize = sysconf(_SC_PAGESIZE) * 256; while ((*Buffer = malloc(BufferSize)) == NULL) { @@ -236,7 +233,7 @@ SkipAndAlign(FileHandle *fh, off_t Skip) return FALSE; } else { static void *Buffer = NULL; - static int BufferSize = 0; + static size_t BufferSize = 0; if (!InitBuffer(&Buffer, &BufferSize)) return FALSE; @@ -246,7 +243,8 @@ SkipAndAlign(FileHandle *fh, off_t Skip) int Chunk; Length = NewPos - fh->fh_Pos; - Chunk = (Length > BufferSize) ? BufferSize : Length; + Chunk = (Length > (off_t)BufferSize) ? + (off_t)BufferSize : Length; if (!Read(fh, Buffer, Chunk)) return FALSE; } @@ -559,7 +557,7 @@ WriteFile(FileHandle *In, char *Name, mode_t Mode, unsigned long Length, int Out; struct stat Stat; static void *Buffer = NULL; - static int BufferSize = 0; + static size_t BufferSize = 0; if ((lstat(Name, &Stat) == 0) && (!S_ISREG(Stat.st_mode) || (unlink(Name) < 0))) { |