Package-Name: e2fsprogs
Gentoo-Package: sys-fs/e2fsprogs
Homepage: http://e2fsprogs.sourceforge.net/
Source: sourceforge:///e2fsprogs/e2fsprogs-(\d+.\d+).tar.gz $1
Repack:
	tar xzvfp "$(SOURCE)"
Compile:
	mv -f COPYING ChangeLog* README RELEASE-NOTES "$(PREFIX)/"
	$(MAKE) -f ../Makefile configure CONFIGURE_OPTS="--disable-swapfs --enable-fsck --enable-nls"
	$(MAKE)
	mkdir -p "$(PREFIX)"/{bin,etc,include,info,lib,man/man{1,3,5,8},sbin,share}
	$(MAKE) install install-libs
	ln -fs e2fsck "$(PREFIX)"/sbin/fsck.ext2
	ln -fs e2fsck "$(PREFIX)"/sbin/fsck.ext3
	ln -fs mke2fs "$(PREFIX)"/sbin/mkfs.ext2
	ln -fs mke2fs "$(PREFIX)"/sbin/mkfs.ext3
	ln -fs tune2fs "$(PREFIX)"/sbin/e2label
	ln -fs tune2fs "$(PREFIX)"/sbin/findfs
	ln -fs e2fsck.8 "$(PREFIX)"/man/man8/fsck.ext2.8
	ln -fs e2fsck.8 "$(PREFIX)"/man/man8/fsck.ext3.8
	ln -fs mke2fs.8 "$(PREFIX)"/man/man8/mkfs.ext2.8
	ln -fs mke2fs.8 "$(PREFIX)"/man/man8/mkfs.ext3.8
Install:
	mv "$(PREFIX)"/sbin/{badblocks,blkid,debugfs,dumpe2fs,e2fsck,e2image,e2label,findfs,fsck{,.ext{2,3}},logsave,mke2fs,mkfs.ext{2,3},mklost+found,resize2fs,tune2fs} /sbin/
	$(MAKE) instbin BIN="chattr lsattr uuidgen"
	$(MAKE) instinfo INFO=libext2fs
	$(MAKE) instman SECTION=1 MAN="chattr lsattr uuidgen"
	$(MAKE) instman SECTION=3 MAN="com_err libblkid uuid uuid_clear uuid_compare uuid_copy uuid_generate uuid_generate_random uuid_generate_time uuid_is_null uuid_parse uuid_time uuid_unparse"
	$(MAKE) instman SECTION=8 MAN="badblocks debugfs dumpe2fs e2fsck e2image e2label findfs fsck fsck.ext2 fsck.ext3 mke2fs mkfs.ext2 mkfs.ext3 mklost+found resize2fs tune2fs"
	$(MAKE) instpc PC="blkid com_err e2p ext2fs ss uuid"
	$(MAKE) instlocale FILE=e2fsprogs
Patch: <<EOT
######## begin lsdel big files patch
--- ../e2fsprogs-1.40-orig/debugfs/lsdel.c	2007-05-08 12:41:04 +0900
+++ debugfs/lsdel.c	2007-12-23 22:14:15 +0900
@@ -49,7 +49,9 @@
 
 static int lsdel_proc(ext2_filsys fs,
 		      blk_t	*block_nr,
-		      int blockcnt EXT2FS_ATTR((unused)),
+		      e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
+		      blk_t ref_block EXT2FS_ATTR((unused)),
+		      int ref_offset EXT2FS_ATTR((unused)),
 		      void *private)
 {
 	struct lsdel_struct *lsd = (struct lsdel_struct *) private;
@@ -138,8 +140,8 @@
 		lsd.free_blocks = 0;
 		lsd.bad_blocks = 0;
 		
-		retval = ext2fs_block_iterate(current_fs, ino, 0, block_buf,
-					      lsdel_proc, &lsd);
+		retval = ext2fs_block_iterate2(current_fs, ino, 0, block_buf,
+					       lsdel_proc, &lsd);
 		if (retval) {
 			com_err("ls_deleted_inodes", retval,
 				"while calling ext2fs_block_iterate");
######## end lsdel big files patch
######## begin error-retry patch
--- ../e2fsprogs-1.40-orig/e2fsck/ehandler.c	2005-09-06 18:40:14 +0900
+++ e2fsck/ehandler.c	2007-12-23 22:17:27 +0900
@@ -60,6 +60,9 @@
 		if (ask(ctx, _("Force rewrite"), 1))
 			io_channel_write_blk(channel, block, 1, data);
 		return 0;
+	} else {
+		if (ask_yn(_("Retry"), 0))
+			return io_channel_read_blk(channel, block, 1, p);
 	}
 
 	return error;
######## end error-retry patch
######## begin no gzipped manpages patch
--- ../e2fsprogs-1.36-orig/doc/Makefile.in	2005-01-19 14:25:25 +0900
+++ doc/Makefile.in	2005-02-15 03:19:20 +0900
@@ -26,8 +26,6 @@
 		echo "	INSTALL_DATA $(infodir)/$$i" ; \
 		$(INSTALL_DATA) $$i $(DESTDIR)$(infodir)/$$i ; \
 	done
-	@echo "	GZIP $(infodir)/libext2fs.info*"
-	@gzip -9 $(DESTDIR)$(infodir)/libext2fs.info*
 
 uninstall-doc-libs:
 	$(RM) -rf $(DESTDIR)$(infodir)/libext2fs.info*
######## end no gzipped manpages patch
EOT
NoPatch: <<EOT
######## begin percentage patch -- this is broken; some groups have inode
######## processing split into 2 or more parts, and we don't know the total
######## number of inodes in the group until we finish
--- e2fsck/pass1.c.old	2004-01-18 07:53:15 +0900
+++ e2fsck/pass1.c	2004-04-04 12:11:13 +0900
@@ -68,7 +68,7 @@
 static void alloc_imagic_map(e2fsck_t ctx);
 static void mark_inode_bad(e2fsck_t ctx, ino_t ino);
 static void handle_fs_bad_blocks(e2fsck_t ctx);
-static void process_inodes(e2fsck_t ctx, char *block_buf);
+static void process_inodes(e2fsck_t ctx, char *block_buf, dgrp_t group);
 static EXT2_QSORT_TYPE process_inode_cmp(const void *a, const void *b);
 static errcode_t scan_callback(ext2_filsys fs, ext2_inode_scan scan,
 				  dgrp_t group, void * priv_data);
@@ -110,6 +110,9 @@
 static __u64 ext2_max_sizes[EXT2_MAX_BLOCK_LOG_SIZE -
 			    EXT2_MIN_BLOCK_LOG_SIZE + 1];
 
+/* Current group number, updated by scan_inodes callback. */
+static dgrp_t cur_group;
+
 /*
  * Free all memory allocated by pass1 in preparation for restarting
  * things.
@@ -379,6 +382,7 @@
 	scan_struct.ctx = ctx;
 	scan_struct.block_buf = block_buf;
 	ext2fs_set_inode_callback(scan, scan_callback, &scan_struct);
+	cur_group = 0;
 	if (ctx->progress)
 		if ((ctx->progress)(ctx, 1, 0, ctx->fs->group_desc_count))
 			return;
@@ -685,13 +689,13 @@
 			return;
 
 		if (process_inode_count >= ctx->process_inode_size) {
-			process_inodes(ctx, block_buf);
+			process_inodes(ctx, block_buf, cur_group);
 
 			if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
 				return;
 		}
 	}
-	process_inodes(ctx, block_buf);
+	process_inodes(ctx, block_buf, cur_group);
 	ext2fs_close_inode_scan(scan);
 	ehandler_operation(0);
 
@@ -768,11 +772,12 @@
 	scan_struct = (struct scan_callback_struct *) priv_data;
 	ctx = scan_struct->ctx;
 	
-	process_inodes((e2fsck_t) fs->priv_data, scan_struct->block_buf);
+	process_inodes((e2fsck_t) fs->priv_data, scan_struct->block_buf, group);
+	cur_group = group+1;
 
 	if (ctx->progress)
-		if ((ctx->progress)(ctx, 1, group+1,
-				    ctx->fs->group_desc_count))
+		if ((ctx->progress)(ctx, 1, cur_group*100,
+				    ctx->fs->group_desc_count*100))
 			return EXT2_ET_CANCEL_REQUESTED;
 
 	return 0;
@@ -781,7 +786,7 @@
 /*
  * Process the inodes in the "inodes to process" list.
  */
-static void process_inodes(e2fsck_t ctx, char *block_buf)
+static void process_inodes(e2fsck_t ctx, char *block_buf, dgrp_t group)
 {
 	int			i;
 	struct ext2_inode	*old_stashed_inode;
@@ -814,6 +819,12 @@
 		check_blocks(ctx, &pctx, block_buf);
 		if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
 			break;
+		if (ctx->progress)
+			if ((ctx->progress)(ctx, 1,
+					    group*100 + (i*100)/process_inode_count,
+					    ctx->fs->group_desc_count*100))
+				break;
+
 	}
 	ctx->stashed_inode = old_stashed_inode;
 	ctx->stashed_ino = old_stashed_ino;
######## end percentage patch
EOT

/pkg/e2fsprogs/
/sbin/badblocks
/sbin/blkid
/sbin/debugfs
/sbin/dumpe2fs
/sbin/e2fsck
/sbin/e2image
/sbin/e2label
/sbin/findfs
/sbin/fsck
/sbin/fsck.ext2
/sbin/fsck.ext3
/sbin/logsave
/sbin/mke2fs
/sbin/mkfs.ext2
/sbin/mkfs.ext3
/sbin/mklost+found
/sbin/resize2fs
/sbin/tune2fs
/usr/bin/chattr
/usr/bin/lsattr
/usr/bin/uuidgen
/usr/info/libext2fs.info*
/usr/lib/pkgconfig/blkid.pc
/usr/lib/pkgconfig/com_err.pc
/usr/lib/pkgconfig/e2p.pc
/usr/lib/pkgconfig/ext2fs.pc
/usr/lib/pkgconfig/ss.pc
/usr/lib/pkgconfig/uuid.pc
/usr/man/man1/chattr.1.gz
/usr/man/man1/lsattr.1.gz
/usr/man/man1/uuidgen.1.gz
/usr/man/man3/com_err.3.gz
/usr/man/man3/libblkid.3.gz
/usr/man/man3/uuid.3.gz
/usr/man/man3/uuid_clear.3.gz
/usr/man/man3/uuid_compare.3.gz
/usr/man/man3/uuid_copy.3.gz
/usr/man/man3/uuid_generate.3.gz
/usr/man/man3/uuid_generate_random.3.gz
/usr/man/man3/uuid_generate_time.3.gz
/usr/man/man3/uuid_is_null.3.gz
/usr/man/man3/uuid_parse.3.gz
/usr/man/man3/uuid_time.3.gz
/usr/man/man3/uuid_unparse.3.gz
/usr/man/man8/badblocks.8.gz
/usr/man/man8/debugfs.8.gz
/usr/man/man8/dumpe2fs.8.gz
/usr/man/man8/e2fsck.8.gz
/usr/man/man8/e2image.8.gz
/usr/man/man8/e2label.8.gz
/usr/man/man8/findfs.8.gz
/usr/man/man8/fsck.8.gz
/usr/man/man8/fsck.ext2.8.gz
/usr/man/man8/fsck.ext3.8.gz
/usr/man/man8/mke2fs.8.gz
/usr/man/man8/mkfs.ext2.8.gz
/usr/man/man8/mkfs.ext3.8.gz
/usr/man/man8/mklost+found.8.gz
/usr/man/man8/resize2fs.8.gz
/usr/man/man8/tune2fs.8.gz
/usr/share/locale/*/LC_MESSAGES/e2fsprogs.mo
