[Glibc-bsd-commits] r1881 - in trunk/ufsutils/debian: . patches
Petr Salinger
ps-guest at alioth.debian.org
Fri Jan 19 12:41:36 UTC 2007
Author: ps-guest
Date: 2007-01-19 13:41:36 +0100 (Fri, 19 Jan 2007)
New Revision: 1881
Modified:
trunk/ufsutils/debian/changelog
trunk/ufsutils/debian/patches/00_libport.patch
trunk/ufsutils/debian/patches/01_libufs.patch
trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch
trunk/ufsutils/debian/patches/02_fsck.ufs.patch
trunk/ufsutils/debian/patches/02_fsdb.ufs.patch
trunk/ufsutils/debian/patches/02_growfs.ufs.patch
trunk/ufsutils/debian/patches/02_mkfs.ufs.patch
trunk/ufsutils/debian/patches/99_makefiles.patch
Log:
* ufsutils - make it build much cleanly on kfreebsd (it might broke linux)
ino_t is int32 on kfreebsd-any !!!
Modified: trunk/ufsutils/debian/changelog
===================================================================
--- trunk/ufsutils/debian/changelog 2007-01-18 13:34:26 UTC (rev 1880)
+++ trunk/ufsutils/debian/changelog 2007-01-19 12:41:36 UTC (rev 1881)
@@ -1,3 +1,13 @@
+ufsutils (6.2-0.1) UNRELEASED; urgency=low
+
+ [Petr Salinger]
+ * upgrade to 6.2 release
+ * include all needed sources in debian/upstream.sh
+ * make it build much cleanly on kfreebsd (it might broke linux)
+ ino_t is int32 on kfreebsd-any !!!
+
+ -- Guillem Jover <guillem at debian.org> Fri, 19 Jan 2007 08:29:58 +0100
+
ufsutils (0.0+2004.06.26-5) UNRELEASED; urgency=low
* Fix Subversion repository address.
Modified: trunk/ufsutils/debian/patches/00_libport.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_libport.patch 2007-01-18 13:34:26 UTC (rev 1880)
+++ trunk/ufsutils/debian/patches/00_libport.patch 2007-01-19 12:41:36 UTC (rev 1881)
@@ -181,22 +181,23 @@
+
+static const int sector_size = 512;
+
-+off_t
++int64_t
+get_block_device_size(int fd)
+{
-+ off_t device_size = 0;
-+ struct stat st;
++ int64_t size = 0;
++ struct stat64 st;
+
+#if defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__)
+ {
+ struct disklabel disklabel;
++ off_t device_size;
+
+ if (!ioctl(fd, DIOCGMEDIASIZE, &device_size))
+ return device_size;
+
+ if (!ioctl(fd, DIOCGDINFO, &disklabel)) {
-+ device_size = (off_t)disklabel.d_secperunit * sector_size;
-+ return device_size;
++ size = ((int64_t)disklabel.d_secperunit) * sector_size;
++ return size;
+ }
+ }
+#elif defined(__linux__)
@@ -204,8 +205,8 @@
+ long int device_sectors;
+
+ if (!ioctl(fd, BLKGETSIZE, &device_sectors)) {
-+ device_size = (off_t)device_sectors * sector_size;
-+ return device_size;
++ size = ((int64_t)device_sectors) * sector_size;
++ return size;
+ }
+ }
+#else
@@ -216,13 +217,12 @@
+#endif
+
+ /* Regular files or devices under the Hurd. */
-+ if (fstat(fd, &st) == 0) {
++ if (fstat64(fd, &st) == 0) {
+ return st.st_size;
+ }
+
-+ return device_size;
++ return size;
+}
-+
diff -Naur ufsutils.orig/include/port/blockdev.h ufsutils.new/include/port/blockdev.h
--- ufsutils.orig/include/port/blockdev.h 1970-01-01 01:00:00.000000000 +0100
+++ ufsutils.new/include/port/blockdev.h 2004-06-29 22:17:29.000000000 +0200
@@ -232,7 +232,7 @@
+
+#include <sys/types.h>
+
-+off_t get_block_device_size(int fd);
++int64_t get_block_device_size(int fd);
+
+#endif
+
Modified: trunk/ufsutils/debian/patches/01_libufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/01_libufs.patch 2007-01-18 13:34:26 UTC (rev 1880)
+++ trunk/ufsutils/debian/patches/01_libufs.patch 2007-01-19 12:41:36 UTC (rev 1881)
@@ -1,17 +1,4 @@
#DPATCHLEVEL=1
-diff -Naur ufsutils.orig/libufs/block.c ufsutils.new/libufs/block.c
---- ufsutils.orig/libufs/block.c 2003-10-07 09:12:22.000000000 +0200
-+++ ufsutils.new/libufs/block.c 2004-05-13 07:56:42.000000000 +0200
-@@ -25,6 +25,9 @@
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-+#define _BSD_SOURCE
-+#define _XOPEN_SOURCE 500
-+
- #include <sys/cdefs.h>
- __FBSDID("$FreeBSD: src/lib/libufs/block.c,v 1.10 2003/10/07 07:12:22 phk Exp $");
-
diff -Naur ufsutils.orig/include/ufs/ffs/fs.h ufsutils.new/include/ufs/ffs/fs.h
--- ufsutils.orig/include/ufs/ffs/fs.h 2004-04-07 05:47:20.000000000 +0200
+++ ufsutils.new/include/ufs/ffs/fs.h 2004-05-13 08:43:33.000000000 +0200
Modified: trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch 2007-01-18 13:34:26 UTC (rev 1880)
+++ trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch 2007-01-19 12:41:36 UTC (rev 1881)
@@ -2,15 +2,6 @@
diff -Naur ufsutils.orig/bsdlabel/bsdlabel.c ufsutils.new/bsdlabel/bsdlabel.c
--- ufsutils.orig/bsdlabel/bsdlabel.c 2004-03-31 01:15:03.000000000 +0200
+++ ufsutils.new/bsdlabel/bsdlabel.c 2004-05-21 05:18:50.000000000 +0200
-@@ -40,6 +40,8 @@
- * from: $NetBSD: disksubr.c,v 1.13 2000/12/17 22:39:18 pk $
- */
-
-+#define _GNU_SOURCE
-+
- #if 0
- #ifndef lint
- static const char copyright[] =
@@ -60,7 +62,9 @@
#include <sys/file.h>
#include <sys/stat.h>
Modified: trunk/ufsutils/debian/patches/02_fsck.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsck.ufs.patch 2007-01-18 13:34:26 UTC (rev 1880)
+++ trunk/ufsutils/debian/patches/02_fsck.ufs.patch 2007-01-19 12:41:36 UTC (rev 1881)
@@ -37,40 +37,6 @@
.Xr fsdb 8 ,
-.Xr newfs 8 ,
.Xr reboot 8
-Index: uf-a/fsck.ufs/fsck.h
-===================================================================
---- uf-a.orig/fsck.ufs/fsck.h 2005-03-07 09:42:49.000000000 +0100
-+++ uf-a/fsck.ufs/fsck.h 2007-01-18 10:36:53.000000000 +0100
-@@ -76,6 +76,18 @@
- #define DIP(dp, field) \
- ((sblock.fs_magic == FS_UFS1_MAGIC) ? \
- (dp)->dp1.field : (dp)->dp2.field)
-+#define DIP_set(dp, field, value) \
-+ {if (sblock.fs_magic == FS_UFS1_MAGIC) \
-+ (dp)->dp1.field = (value); else (dp)->dp2.field = (value);}
-+#define DIP_add(dp, field, value) \
-+ {if (sblock.fs_magic == FS_UFS1_MAGIC) \
-+ (dp)->dp1.field += (value); else (dp)->dp2.field += (value);}
-+#define DIP_and(dp, field, value) \
-+ {if (sblock.fs_magic == FS_UFS1_MAGIC) \
-+ (dp)->dp1.field &= (value); else (dp)->dp2.field &= (value);}
-+#define DIP_or(dp, field, value) \
-+ {if (sblock.fs_magic == FS_UFS1_MAGIC) \
-+ (dp)->dp1.field |= (value); else (dp)->dp2.field |= (value);}
-
- #define DIP_SET(dp, field, val) do { \
- if (sblock.fs_magic == FS_UFS1_MAGIC) \
-@@ -148,6 +160,10 @@
- #define IBLK(bp, i) \
- ((sblock.fs_magic == FS_UFS1_MAGIC) ? \
- (bp)->b_un.b_indir1[i] : (bp)->b_un.b_indir2[i])
-+#define IBLK_set(bp, i, value) \
-+ {if (sblock.fs_magic == FS_UFS1_MAGIC) \
-+ (bp)->b_un.b_indir1[i] = (value); \
-+ else (bp)->b_un.b_indir2[i] = (value);}
-
- #define IBLK_SET(bp, i, val) do { \
- if (sblock.fs_magic == FS_UFS1_MAGIC) \
Index: uf-a/fsck.ufs/fsutil.c
===================================================================
--- uf-a.orig/fsck.ufs/fsutil.c 2004-10-08 22:44:47.000000000 +0200
@@ -93,15 +59,6 @@
#include <unistd.h>
#include "fsck.h"
-@@ -136,7 +139,7 @@
- int iloff;
-
- if (inum > maxino)
-- errx(EEXIT, "inoinfo: inumber %d out of range", inum);
-+ errx(EEXIT, "inoinfo: inumber %ld out of range", inum);
- ilp = &inostathead[inum / sblock.fs_ipg];
- iloff = inum % sblock.fs_ipg;
- if (iloff >= ilp->il_numalloced)
@@ -277,11 +280,13 @@
if (bkgrdflag) {
unlink(snapname);
@@ -185,42 +142,6 @@
#include "fsck.h"
-@@ -285,7 +286,7 @@
- ufs2_daddr_t iblk;
-
- if (inumber < ROOTINO || inumber > maxino)
-- errx(EEXIT, "bad inode number %d to ginode", inumber);
-+ errx(EEXIT, "bad inode number %ld to ginode", inumber);
- if (startinum == 0 ||
- inumber < startinum || inumber >= startinum + INOPB(&sblock)) {
- iblk = ino_to_fsba(&sblock, inumber);
-@@ -317,7 +318,7 @@
- static caddr_t nextinop;
-
- if (inumber != nextino++ || inumber > lastvalidinum)
-- errx(EEXIT, "bad inode number %d to nextinode", inumber);
-+ errx(EEXIT, "bad inode number %ld to nextinode", inumber);
- if (inumber >= lastinum) {
- readcnt++;
- dblk = fsbtodb(&sblock, ino_to_fsba(&sblock, lastinum));
-@@ -348,7 +349,7 @@
- {
-
- if (inum % sblock.fs_ipg != 0)
-- errx(EEXIT, "bad inode number %d to setinodebuf", inum);
-+ errx(EEXIT, "bad inode number %ld to setinodebuf", inum);
- lastvalidinum = inum + sblock.fs_ipg - 1;
- startinum = 0;
- nextino = inum;
-@@ -439,7 +440,7 @@
- continue;
- return (inp);
- }
-- errx(EEXIT, "cannot find inode %d", inumber);
-+ errx(EEXIT, "cannot find inode %ld", inumber);
- return ((struct inoinfo *)0);
- }
-
Index: uf-a/fsck.ufs/main.c
===================================================================
--- uf-a.orig/fsck.ufs/main.c 2005-02-10 10:19:29.000000000 +0100
@@ -392,15 +313,6 @@
printf("** Phase 1 - Check Blocks and Sizes\n");
}
pass1();
-@@ -415,7 +446,7 @@
- n_ffree * 100.0 / sblock.fs_dsize);
- if (debug) {
- if (files < 0)
-- printf("%d inodes missing\n", -files);
-+ printf("%ld inodes missing\n", -files);
- if (blks < 0)
- printf("%lld blocks missing\n", -(long long)blks);
- if (duplist != NULL) {
@@ -447,8 +478,13 @@
/*
* Check to see if the file system is mounted read-write.
@@ -488,19 +400,6 @@
idesc->id_type = ADDR;
(void)ckinode(dp, idesc);
if (sblock.fs_magic == FS_UFS2_MAGIC && dp->dp2.di_extsize > 0) {
-Index: uf-a/fsck.ufs/pass4.c
-===================================================================
---- uf-a.orig/fsck.ufs/pass4.c 2004-10-08 22:44:47.000000000 +0200
-+++ uf-a/fsck.ufs/pass4.c 2007-01-18 10:36:53.000000000 +0100
-@@ -111,7 +111,7 @@
- break;
-
- default:
-- errx(EEXIT, "BAD STATE %d FOR INODE I=%d",
-+ errx(EEXIT, "BAD STATE %d FOR INODE I=%ld",
- inoinfo(inumber)->ino_state, inumber);
- }
- }
Index: uf-a/fsck.ufs/setup.c
===================================================================
--- uf-a.orig/fsck.ufs/setup.c 2005-03-07 09:42:49.000000000 +0100
Modified: trunk/ufsutils/debian/patches/02_fsdb.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsdb.ufs.patch 2007-01-18 13:34:26 UTC (rev 1880)
+++ trunk/ufsutils/debian/patches/02_fsdb.ufs.patch 2007-01-19 12:41:36 UTC (rev 1881)
@@ -50,33 +50,6 @@
static void
usage(void)
{
-@@ -211,7 +223,7 @@
- prompt(EditLine *el)
- {
- static char pstring[64];
-- snprintf(pstring, sizeof(pstring), "fsdb (inum: %d)> ", curinum);
-+ snprintf(pstring, sizeof(pstring), "fsdb (inum: %ld)> ", curinum);
- return pstring;
- }
-
-@@ -298,7 +310,7 @@
-
- #define GETINUM(ac,inum) inum = strtoul(argv[ac], &cp, 0); \
- if (inum < ROOTINO || inum > maxino || cp == argv[ac] || *cp != '\0' ) { \
-- printf("inode %d out of range; range is [%d,%d]\n", \
-+ printf("inode %ld out of range; range is [%ld,%ld]\n", \
- inum, ROOTINO, maxino); \
- return 1; \
- }
-@@ -750,7 +762,7 @@
- return 1;
- rval = makeentry(curinum, inum, argv[2]);
- if (rval)
-- printf("Ino %d entered as `%s'\n", inum, argv[2]);
-+ printf("Ino %ld entered as `%s'\n", inum, argv[2]);
- else
- printf("could not enter name? weird.\n");
- curinode = ginode(curinum);
Index: uf-a/fsdb.ufs/fsdbutil.c
===================================================================
--- uf-a.orig/fsdb.ufs/fsdbutil.c 2006-09-22 13:20:10.000000000 +0200
@@ -89,7 +62,7 @@
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
-@@ -51,6 +50,12 @@
+@@ -51,6 +50,18 @@
#include "fsdb.h"
#include "fsck.h"
@@ -99,70 +72,15 @@
+ return((time_t)t64);
+}
+
++static inline time_t
++_time32_to_time(int32_t t32)
++{
++ return((time_t)t32);
++}
++
static int charsperline(void);
static int printindir(ufs2_daddr_t blk, int level, char *bufp);
static void printblocks(ino_t inum, union dinode *dp);
-@@ -163,23 +168,23 @@
- dp->dp2.di_birthnsec);
- }
- if (sblock.fs_magic == FS_UFS1_MAGIC)
-- t = _time32_to_time(dp->dp1.di_mtime);
-+ t = (time_t)dp->dp1.di_mtime;
- else
-- t = _time64_to_time(dp->dp2.di_mtime);
-+ t = (time_t)dp->dp2.di_mtime;
- p = ctime(&t);
- printf("\n\tMTIME=%15.15s %4.4s [%d nsec]", &p[4], &p[20],
- DIP(dp, di_mtimensec));
- if (sblock.fs_magic == FS_UFS1_MAGIC)
-- t = _time32_to_time(dp->dp1.di_ctime);
-+ t = (time_t)dp->dp1.di_ctime;
- else
-- t = _time64_to_time(dp->dp2.di_ctime);
-+ t = (time_t)dp->dp2.di_ctime;
- p = ctime(&t);
- printf("\n\tCTIME=%15.15s %4.4s [%d nsec]", &p[4], &p[20],
- DIP(dp, di_ctimensec));
- if (sblock.fs_magic == FS_UFS1_MAGIC)
-- t = _time32_to_time(dp->dp1.di_atime);
-+ t = (time_t)dp->dp1.di_atime;
- else
-- t = _time64_to_time(dp->dp2.di_atime);
-+ t = (time_t)dp->dp2.di_atime;
- p = ctime(&t);
- printf("\n\tATIME=%15.15s %4.4s [%d nsec]\n", &p[4], &p[20],
- DIP(dp, di_atimensec));
-@@ -291,7 +296,7 @@
- long ndb, offset;
- ufs2_daddr_t blkno;
-
-- printf("Blocks for inode %d:\n", inum);
-+ printf("Blocks for inode %ld:\n", inum);
- printf("Direct blocks:\n");
- ndb = howmany(DIP(dp, di_size), sblock.fs_bsize);
- for (i = 0; i < NDADDR; i++) {
-@@ -341,7 +346,7 @@
- return 0;
- }
- if ((DIP(curinode, di_mode) & IFMT) != IFDIR) {
-- warnx("inode %d not a directory", curinum);
-+ warnx("inode %ld not a directory", curinum);
- return 0;
- }
- return 1;
-@@ -366,10 +371,10 @@
- printstat("current inode", curinum, curinode);
- break;
- case 0:
-- printf("current inode %d: unallocated inode\n", curinum);
-+ printf("current inode %ld: unallocated inode\n", curinum);
- break;
- default:
-- printf("current inode %d: screwy itype 0%o (mode 0%o)?\n",
-+ printf("current inode %ld: screwy itype 0%o (mode 0%o)?\n",
- curinum, DIP(curinode, di_mode) & IFMT, DIP(curinode, di_mode));
- break;
- }
Index: uf-a/fsdb.ufs/Makefile
===================================================================
--- uf-a.orig/fsdb.ufs/Makefile 2004-10-09 17:56:34.000000000 +0200
@@ -192,4 +110,3 @@
-.include <bsd.prog.mk>
+include ../Makefile.common
+
-\ No newline at end of file
Modified: trunk/ufsutils/debian/patches/02_growfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_growfs.ufs.patch 2007-01-18 13:34:26 UTC (rev 1880)
+++ trunk/ufsutils/debian/patches/02_growfs.ufs.patch 2007-01-19 12:41:36 UTC (rev 1881)
@@ -78,4 +78,3 @@
-.include <bsd.prog.mk>
+include ../Makefile.common
+
-\ No newline at end of file
Modified: trunk/ufsutils/debian/patches/02_mkfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_mkfs.ufs.patch 2007-01-18 13:34:26 UTC (rev 1880)
+++ trunk/ufsutils/debian/patches/02_mkfs.ufs.patch 2007-01-19 12:41:36 UTC (rev 1881)
@@ -10,15 +10,6 @@
#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
-@@ -902,7 +903,7 @@
- sblock.fs_cstotal.cs_nifree--;
- fscs[0].cs_nifree--;
- if (ino >= (unsigned long)sblock.fs_ipg * sblock.fs_ncg) {
-- printf("fsinit: inode value out of range (%d).\n", ino);
-+ printf("fsinit: inode value out of range (%ld).\n", ino);
- exit(32);
- }
- d = fsbtodb(&sblock, ino_to_fsba(&sblock, ino));
diff -Naur ufsutils.orig/mkfs.ufs/newfs.c ufsutils.new/mkfs.ufs/newfs.c
--- ufsutils.orig/mkfs.ufs/newfs.c 2004-04-09 21:58:34.000000000 +0200
+++ ufsutils.new/mkfs.ufs/newfs.c 2004-06-29 22:43:50.000000000 +0200
Modified: trunk/ufsutils/debian/patches/99_makefiles.patch
===================================================================
--- trunk/ufsutils/debian/patches/99_makefiles.patch 2007-01-18 13:34:26 UTC (rev 1880)
+++ trunk/ufsutils/debian/patches/99_makefiles.patch 2007-01-19 12:41:36 UTC (rev 1881)
@@ -47,8 +47,8 @@
+mandir = $(datadir)/man
+man8dir = $(mandir)/man8
+
-+CFLAGS = -Wall -g
-+ALL_CFLAGS += -I../include -include port/port.h -D_FILE_OFFSET_BITS=64
++CFLAGS = -Wall -g -O2
++ALL_CFLAGS += -I../include -include port/port.h -D_GNU_SOURCE
+
+INSTALL = install
+INSTALL_PROG = $(INSTALL)
More information about the Glibc-bsd-commits
mailing list