sys-fs/dosfstools: upgrade from 3.0.9 to 3.0.26

This CL imports dosfstools 3.0.26 from upstream Gentoo and modifies the
ebuild to specify KEYWORDS="*".

BUG=None
TEST=`emerge-{x86,amd64,arm}-generic dosfstools`
TEST=Run platform_CrosDisksFilesystem test.

Change-Id: I16b1578f50378695cc501f1b19a87c06ebaf8f8e
Reviewed-on: https://chromium-review.googlesource.com/191184
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
diff --git a/sys-fs/dosfstools/Manifest b/sys-fs/dosfstools/Manifest
index eb0df80..6020840 100644
--- a/sys-fs/dosfstools/Manifest
+++ b/sys-fs/dosfstools/Manifest
@@ -1 +1 @@
-DIST dosfstools-3.0.9.tar.bz2 69186 RMD160 3706dfc175ab19b058e4b7fb185a55bbfcd39e37 SHA1 9e2b458e6aa4fabb152a49dc6367a50a625d08dd SHA256 3f63676faeac507e909d84c8920ddb6597da1eb688577c2fc9c756b821d0458f
+DIST dosfstools-3.0.26.tar.xz 79196 SHA256 468442fe8cd93961047d5cd67f7b67793126575103a67cd131330512b4893e75 SHA512 52b04950268ed4750d5c4d61b613f0f0e9083e91301499b8bf82efd125c75ecaeb444fdd682fa11ec1ce525d32a70937f621430b9995ea920f14d7b35a07b4ca WHIRLPOOL 6a581e8d0fef575c76330a69c063f46bccc7cbc673247228f7b4565e381cd93d7b847ff9afe4ed4c4318a86d456a65829dea2da3016e786c34e3d0f32b0ea399
diff --git a/sys-fs/dosfstools/dosfstools-3.0.26.ebuild b/sys-fs/dosfstools/dosfstools-3.0.26.ebuild
new file mode 100644
index 0000000..a00c68a
--- /dev/null
+++ b/sys-fs/dosfstools/dosfstools-3.0.26.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/dosfstools/dosfstools-3.0.26.ebuild,v 1.1 2014/03/08 04:16:13 radhermit Exp $
+
+EAPI="5"
+
+inherit toolchain-funcs flag-o-matic eutils
+
+DESCRIPTION="DOS filesystem tools - provides mkdosfs, mkfs.msdos, mkfs.vfat"
+HOMEPAGE="http://www.daniel-baumann.ch/software/dosfstools/"
+SRC_URI="http://www.daniel-baumann.ch/files/software/${PN}/${P}.tar.xz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="*"
+RESTRICT="test" # there is no test target #239071
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-3.0.20-name-ext.patch
+	sed -i \
+		-e "/^PREFIX/s:=.*:= ${EPREFIX}/usr:" \
+		-e '/^OPTFLAGS/d' \
+		-e '/^DEBUGFLAGS/d' \
+		-e "/\$(DOCDIR)/s:${PN}:${PF}:" \
+		Makefile || die
+	append-lfs-flags
+	tc-export CC
+}
diff --git a/sys-fs/dosfstools/dosfstools-3.0.9.ebuild b/sys-fs/dosfstools/dosfstools-3.0.9.ebuild
deleted file mode 100644
index 3eca690..0000000
--- a/sys-fs/dosfstools/dosfstools-3.0.9.ebuild
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/dosfstools/dosfstools-3.0.9.ebuild,v 1.8 2010/10/12 17:12:56 armin76 Exp $
-
-EAPI="2"
-
-inherit toolchain-funcs flag-o-matic
-
-DESCRIPTION="DOS filesystem tools - provides mkdosfs, mkfs.msdos, mkfs.vfat"
-HOMEPAGE="http://www.daniel-baumann.ch/software/dosfstools/"
-SRC_URI="http://www.daniel-baumann.ch/software/dosfstools/${P}.tar.bz2"
-
-LICENSE="GPL-3"
-SLOT="0"
-KEYWORDS="*"
-IUSE=""
-RESTRICT="test" # there is no test target #239071
-
-src_prepare() {
-	sed -i \
-		-e '/^PREFIX/s:/local::' \
-		-e '/^OPTFLAGS/s:=.*:=:' \
-		Makefile || die "sed Makefile"
-	append-lfs-flags
-	tc-export CC
-}
-
-src_install() {
-	emake DESTDIR="${D}" install || die
-	dodir /sbin
-	mv "${D}"/usr/sbin/*fsck* "${D}"/sbin/ || die
-	mv "${D}"/usr/share/doc/{${PN},${PF}} || die
-	prepalldocs
-}
diff --git a/sys-fs/dosfstools/files/dosfstools-3.0.20-name-ext.patch b/sys-fs/dosfstools/files/dosfstools-3.0.20-name-ext.patch
new file mode 100644
index 0000000..71149bd
--- /dev/null
+++ b/sys-fs/dosfstools/files/dosfstools-3.0.20-name-ext.patch
@@ -0,0 +1,29 @@
+avoid fortify warnings about going beyond array bounds as the strcmp
+assumes name[8] and ext[3] are together
+
+--- dosfstools-3.0.20/src/check.c
++++ dosfstools-3.0.20/src/check.c
+@@ -264,7 +264,7 @@
+ {
+     int i, spc, suspicious = 0;
+     const char *bad_chars = atari_format ? "*?\\/:" : "*?<>|\"\\/:";
+-    const unsigned char *name = file->dir_ent.name;
++    const unsigned char *name = file->dir_ent.name_ext;
+     const unsigned char *ext = file->dir_ent.ext;
+ 
+     /* Do not complain about (and auto-correct) the extended attribute files
+--- dosfstools-3.0.20/src/fsck.fat.h
++++ dosfstools-3.0.20/src/fsck.fat.h
+@@ -126,7 +126,12 @@
+ };
+ 
+ typedef struct {
++    union {
++    struct {
+     __u8 name[8], ext[3];	/* name and extension */
++    };
++    __u8 name_ext[11];
++    };
+     __u8 attr;			/* attribute bits */
+     __u8 lcase;			/* Case for base and extension */
+     __u8 ctime_ms;		/* Creation time, milliseconds */