summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-fs/udftools
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-fs/udftools')
-rw-r--r--sys-fs/udftools/Manifest2
-rw-r--r--sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch22
-rw-r--r--sys-fs/udftools/files/pktcdvd.init62
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch28
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch15
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch23
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b-openflags.patch15
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch44
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch57
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch115
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch164
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch94
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch160
-rw-r--r--sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch52
-rw-r--r--sys-fs/udftools/metadata.xml8
-rw-r--r--sys-fs/udftools/udftools-1.0.0b-r10.ebuild49
-rw-r--r--sys-fs/udftools/udftools-1.0.0b-r9.ebuild43
17 files changed, 953 insertions, 0 deletions
diff --git a/sys-fs/udftools/Manifest b/sys-fs/udftools/Manifest
new file mode 100644
index 000000000000..3c09d3367e13
--- /dev/null
+++ b/sys-fs/udftools/Manifest
@@ -0,0 +1,2 @@
+DIST udftools-1.0.0b3.patch.bz2 3372 SHA256 4c35eb06da92677203137ee407ba29bdf0bec574550567cc6cecb63158099dbb SHA512 2b30741ffb7bab0139f6a3fb55911517c7f0489b76bc3453c3e0c519356689a8a9ad9c2b7e954267e8e14a6840498cd3c93641c5eb69f373f7bb19d35ffe9f19 WHIRLPOOL 43d096e0959da24f2b272ee60ba753c45346c12139627c5a6721b6db71f4dd85ca62d97799c79fca5b6d3e2222ff86262bb3ac62c9a3f3fe1f1fbd387bcc34c9
+DIST udftools-1.0.0b3.tar.gz 293257 SHA256 c5079e878d4d8e03de0fd75bfecf485a299689b8289a5288f18b2e793e0904a0 SHA512 4b45ff2e389ce93c3ac372f74daa3e2a43e02434c1e3d9df8cf050e137799491ac88d7aedd2b61c6d79a7ab8878042689c948c0b2aeb4be0a172c64844f07068 WHIRLPOOL 157ff4b18ef7497067b8398e0d57a25e6549c3c8637633fe3648c42d446562cd9c2f2533a25895cf628343223eb1ccbb59511df40606525486c6e4e58c0dc0d3
diff --git a/sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch b/sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch
new file mode 100644
index 000000000000..602c808a1b0b
--- /dev/null
+++ b/sys-fs/udftools/files/cdrwtool-linux2.6-fix-v2.patch
@@ -0,0 +1,22 @@
+Fix CD blanking for kernels 2.6.8 and newer
+(write access is required to perform blanking commands)
+
+The original version broke support on Linux 2.4, thanks to Ben Peddell for pointing
+this out to me, and for the updated patch.
+
+ - Daniel Drake <dsd@gentoo.org>
+ - Ben Peddell <klightspeed@klightspeed.is-a-geek.net>
+
+--- udftools-1.0.0b3/cdrwtool/main.c.orig 2004-12-30 22:53:52.000000000 +0000
++++ udftools-1.0.0b3/cdrwtool/main.c 2004-12-30 22:54:36.000000000 +0000
+@@ -242,7 +242,9 @@ int main(int argc, char *argv[])
+ udf_init_disc(&disc.udf_disc);
+ strcpy(filename, CDROM_DEVICE);
+ parse_args(argc, argv, &disc, filename);
+- if ((fd = open(filename, O_RDONLY | O_NONBLOCK)) < 0)
++ if (((fd = open(filename, O_RDWR | O_NONBLOCK)) < 0) &&
++ ((errno != EROFS) ||
++ ((fd = open(filename, O_RDONLY | O_NONBLOCK)) < 0)))
+ {
+ perror("open cdrom device");
+ return fd;
diff --git a/sys-fs/udftools/files/pktcdvd.init b/sys-fs/udftools/files/pktcdvd.init
new file mode 100644
index 000000000000..81eb917b355c
--- /dev/null
+++ b/sys-fs/udftools/files/pktcdvd.init
@@ -0,0 +1,62 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2
+# $Id$
+
+depend() {
+ need localmount modules
+}
+
+checkconfig() {
+ if ! [ -e /dev/pktcdvd/control ]; then
+ eerror "Could not find packet-writing control device at /dev/pktcdvd/control"
+ eerror "Please ensure that your kernel includes packet writing support,"
+ eerror "and if modular, ensure that the module is loaded."
+ return 1
+ fi
+}
+
+get_rw_devices() {
+ devices_raw=$(sed -re '/^drive name:/I!d; s/.*:\s+//' /proc/sys/dev/cdrom/info)
+ count=0
+ for i in $devices_raw; do
+ eval "devices_$count=\"\$i\""
+ count=$(( $count + 1 ))
+ done
+ devs=""
+
+ cdrw_caps=$(sed -re '/^Can write CD-RW:/I!d; s/.*:\s+//' /proc/sys/dev/cdrom/info)
+
+ count=0
+ for i in $cdrw_caps; do
+ [ "$i" -eq 1 ] && eval "devs=\"\$devs \$devices_$count\""
+ count=$(( $count + 1 ))
+ done
+
+ echo ${devs}
+}
+
+start() {
+ checkconfig || return 1
+
+ for i in $(get_rw_devices)
+ do
+ devnode="/dev/${i}"
+ [ -e "${devnode}" ] || continue
+
+ /usr/bin/pktsetup "${i}" "${devnode}" > /dev/null
+ [ -e "/dev/pktcdvd/${i}" ] || continue
+ chmod 660 "/dev/pktcdvd/${i}"
+ chgrp cdrw "/dev/pktcdvd/${i}"
+ done
+}
+
+stop() {
+ checkconfig || return 1
+
+ for i in $(get_rw_devices)
+ do
+ /usr/bin/pktsetup -d "${i}" > /dev/null
+ done
+}
+
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch b/sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch
new file mode 100644
index 000000000000..d49b2561e4e9
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-bigendian.patch
@@ -0,0 +1,28 @@
+http://bugs.gentoo.org/120245
+
+BE fix
+
+===================================================================
+RCS file: /cvsroot/linux-udf/udftools/mkudffs/mkudffs.c,v
+retrieving revision 1.3
+retrieving revision 1.4
+diff -u -r1.3 -r1.4
+--- linux-udf/udftools/mkudffs/mkudffs.c 2004/02/23 03:35:33 1.3
++++ linux-udf/udftools/mkudffs/mkudffs.c 2004/03/02 02:09:39 1.4
+@@ -250,14 +250,14 @@
+ if (size % offsets[PSPACE_SIZE])
+ size -= (size % offsets[PSPACE_SIZE]);
+ set_extent(disc, PSPACE, start, size);
+- for (i=0; i<disc->udf_lvd[0]->numPartitionMaps; i++)
++ for (i=0; i<le32_to_cpu(disc->udf_lvd[0]->numPartitionMaps); i++)
+ {
+ if (i == 1)
+ disc->udf_lvid->freeSpaceTable[i] = cpu_to_le32(0xFFFFFFFF);
+ else
+ disc->udf_lvid->freeSpaceTable[i] = cpu_to_le32(size);
+ }
+- for (j=0; j<disc->udf_lvd[0]->numPartitionMaps; j++)
++ for (j=0; j<le32_to_cpu(disc->udf_lvd[0]->numPartitionMaps); j++)
+ {
+ if (j == 1)
+ disc->udf_lvid->sizeTable[i+j] = cpu_to_le32(0xFFFFFFFF);
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch b/sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch
new file mode 100644
index 000000000000..3b58f20f0173
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-gcc4.patch
@@ -0,0 +1,15 @@
+http://bugs.gentoo.org/112122
+
+gcc4 compat
+
+--- a/wrudf/wrudf.c
++++ b/wrudf/wrudf.c
+@@ -245,7 +245,7 @@
+ } else if( strncmp( spm->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL)) == 0 )
+ virtualPartitionNum = i;
+ }
+- (char*)spm += spm->partitionMapLength;
++ spm = (char*)spm + spm->partitionMapLength;
+ }
+
+ if( medium == CDR ) {
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch b/sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch
new file mode 100644
index 000000000000..74dddf9e012c
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-limits_h.patch
@@ -0,0 +1,23 @@
+http://bugs.gentoo.org/335511
+
+--- cdrwtool/cdrwtool.c
++++ cdrwtool/cdrwtool.c
+@@ -31,6 +31,7 @@
+ #include <sys/ioctl.h>
+ #include <asm/param.h>
+
++#include <limits.h> /* INT_MAX */
+ #include <linux/cdrom.h>
+
+ #include "cdrwtool.h"
+--- pktsetup/pktsetup.c
++++ pktsetup/pktsetup.c
+@@ -26,6 +26,8 @@
+ #include <bits/types.h>
+ #include <sys/types.h>
+
++#include <limits.h> /* INT_MAX */
++#include <stdlib.h> /* system */
+ #include <linux/cdrom.h>
+
+ /*
diff --git a/sys-fs/udftools/files/udftools-1.0.0b-openflags.patch b/sys-fs/udftools/files/udftools-1.0.0b-openflags.patch
new file mode 100644
index 000000000000..88803e43d6fb
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b-openflags.patch
@@ -0,0 +1,15 @@
+From: Magnus Granberg <zorry@ume.nu>
+https://bugs.gentoo.org/232100
+Remove nonsense O_CREAT flag
+
+--- pktsetup/pktsetup.c 2008-06-19 00:27:08.000000000 +0200
++++ pktsetup/pktsetup.c 2008-06-19 00:20:31.000000000 +0200
+@@ -85,7 +85,7 @@
+ {
+ int pkt_fd, dev_fd, cmd;
+
+- if ((pkt_fd = open(pkt_device, O_RDONLY | O_CREAT)) == -1) {
++ if ((pkt_fd = open(pkt_device, O_RDONLY)) == -1) {
+ perror("open packet device");
+ return;
+ }
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch b/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch
new file mode 100644
index 000000000000..8e7e0d13a7f2
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-extsize.patch
@@ -0,0 +1,44 @@
+taken from Fedora, but with minor return type fixes: changed NULL to 0
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-extsize.patch?h=f22
+
+diff -up udftools-1.0.0b3/libudffs/extent.c.extsize udftools-1.0.0b3/libudffs/extent.c
+--- udftools-1.0.0b3/libudffs/extent.c.extsize 2012-01-26 09:45:22.217856499 +0100
++++ udftools-1.0.0b3/libudffs/extent.c 2012-01-26 09:45:43.142855067 +0100
+@@ -50,7 +50,7 @@ cont:
+ while (start_ext != NULL && start_ext->blocks < blocks)
+ start_ext = next_extent(start_ext->next, type);
+
+- if (start_ext->start % offset)
++ if (start_ext != NULL && start_ext->start % offset)
+ {
+ inc = offset - (start_ext->start % offset);
+ if (start_ext->blocks - inc < blocks)
+@@ -62,7 +62,7 @@ cont:
+ else
+ inc = 0;
+
+- return start_ext->start + inc;
++ return start_ext ? start_ext->start + inc : 0;
+ }
+
+ struct udf_extent *prev_extent(struct udf_extent *start_ext, enum udf_space_type type)
+@@ -81,7 +81,7 @@ cont:
+ while (start_ext != NULL && start_ext->blocks < blocks)
+ start_ext = prev_extent(start_ext->prev, type);
+
+- if ((start_ext->start + start_ext->blocks) % offset)
++ if (start_ext != NULL && (start_ext->start + start_ext->blocks) % offset)
+ {
+ dec = (start_ext->start + start_ext->blocks) % offset;
+ if (start_ext->blocks - dec < blocks)
+@@ -93,7 +93,7 @@ cont:
+ else
+ dec = 0;
+
+- return start_ext->start + start_ext->blocks - dec - blocks;
++ return start_ext ? start_ext->start + start_ext->blocks - dec - blocks : 0;
+ }
+
+ struct udf_extent *find_extent(struct udf_disc *disc, uint32_t start)
+
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch b/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch
new file mode 100644
index 000000000000..afda3bd00d3a
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-man-missing-options.patch
@@ -0,0 +1,57 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-man-missing-options.patch?h=f22
+
+diff -up wrk/doc/cdrwtool.1.wrk wrk/doc/cdrwtool.1
+--- wrk/doc/cdrwtool.1.wrk 2014-01-29 15:23:18.623940293 +0100
++++ wrk/doc/cdrwtool.1 2014-01-29 15:24:27.027471222 +0100
+@@ -97,6 +97,10 @@ Close track.
+ .IP "\fB\-r \fItrack\fP"
+ Reserve track.
+
++.IP "\fB\-z \fIlength\fP"
++Fixed packet length.
++
++
+ .IP \fB\-s\fP
+ Set write parameters determined by
+ .BR "\-l" , " \-w" ", and" " \-p"
+diff -up wrk/doc/mkudffs.8.wrk wrk/doc/mkudffs.8
+--- wrk/doc/mkudffs.8.wrk 2014-01-29 15:47:54.095408327 +0100
++++ wrk/doc/mkudffs.8 2014-01-29 15:51:18.115200882 +0100
+@@ -151,6 +151,13 @@ Use 16-bit unicode for file names
+ .TP
+ .B \-\-utf8
+ Use UTF-8 for file names
++.TP
++.B \-\-closed
++.TP
++.B \-\-bridge
++.TP
++.BI \-\-packetlen= " length "
++
+
+ .SH "EXIT STATUS"
+ .B mkudffs
+diff -up wrk/doc/pktsetup.8.wrk wrk/doc/pktsetup.8
+--- wrk/doc/pktsetup.8.wrk 2002-11-26 08:18:51.000000000 +0100
++++ wrk/doc/pktsetup.8 2014-01-29 15:36:29.509665177 +0100
+@@ -37,6 +37,9 @@ pktsetup \- set up and tear down packet
+ .B pktsetup
+ .B \-d
+ .I packet_device
++.br
++.B pktsetup
++.B \-s
+ .ad b
+ .SH DESCRIPTION
+ .B Pktsetup
+@@ -58,6 +61,8 @@ returns 0 on success, nonzero on failure
+ .IP "\fB\-d \fIpacket-device\fP"
+ Delete the association between the specified \fIpacket-device\fP
+ and its block device.
++.IP "\fB\-s"
++Show device mappings.
+
+ .SH EXAMPLE
+ The following commands provide an example of using the
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch b/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch
new file mode 100644
index 000000000000..68c637cd89f4
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-mkudffs-bigendian.patch
@@ -0,0 +1,115 @@
+taken from Fedora, but parts removed due to conflicts w/udftools-1.0.0b-bigendian.patch
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-mkudffs-bigendian.patch?h=f22
+
+diff -up udftools-1.0.0b3/mkudffs/defaults.c.mkudffs-bigendian udftools-1.0.0b3/mkudffs/defaults.c
+--- udftools-1.0.0b3/mkudffs/defaults.c.mkudffs-bigendian 2007-08-23 13:41:29.000000000 +0200
++++ udftools-1.0.0b3/mkudffs/defaults.c 2007-08-23 13:42:16.000000000 +0200
+@@ -69,7 +69,7 @@ struct primaryVolDesc default_pvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_PVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(1),
+@@ -119,7 +119,7 @@ struct logicalVolDesc default_lvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct logicalVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(2),
+@@ -157,7 +157,7 @@ struct volDescPtr default_vdp =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_VDP),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct volDescPtr) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(3),
+@@ -192,7 +192,7 @@ struct impUseVolDesc default_iuvd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_IUVD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct impUseVolDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(4),
+@@ -215,7 +215,7 @@ struct partitionDesc default_pd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_PD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct partitionDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(5),
+@@ -242,7 +242,7 @@ struct unallocSpaceDesc default_usd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_USD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct unallocSpaceDesc) - sizeof(tag)),
+ },
+ volDescSeqNum : constant_cpu_to_le32(6),
+@@ -254,7 +254,7 @@ struct terminatingDesc default_td =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_TD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct terminatingDesc) - sizeof(tag)),
+ },
+ };
+@@ -265,7 +265,7 @@ struct logicalVolIntegrityDesc default_l
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct logicalVolIntegrityDesc) - sizeof(tag)),
+ },
+ integrityType : constant_cpu_to_le32(LVID_INTEGRITY_TYPE_CLOSE),
+@@ -295,7 +295,7 @@ struct sparingTable default_stable =
+ {
+ tagIdent : constant_cpu_to_le16(0),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct sparingTable) - sizeof(tag)),
+ },
+ sparingIdent :
+@@ -387,7 +387,7 @@ struct fileSetDesc default_fsd =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_FSD),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct fileSetDesc) - sizeof(tag)),
+ },
+ interchangeLvl : constant_cpu_to_le16(2),
+@@ -426,7 +426,7 @@ struct fileEntry default_fe =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ icbTag :
+@@ -458,7 +458,7 @@ struct extendedFileEntry default_efe =
+ {
+ tagIdent : constant_cpu_to_le16(TAG_IDENT_LVID),
+ descVersion : constant_cpu_to_le16(3),
+- tagSerialNum : 1,
++ tagSerialNum : constant_cpu_to_le16(1),
+ descCRC : constant_cpu_to_le16(sizeof(struct primaryVolDesc) - sizeof(tag)),
+ },
+ icbTag :
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch b/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch
new file mode 100644
index 000000000000..9ff411b24528
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-staticanal.patch
@@ -0,0 +1,164 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-staticanal.patch?h=f22
+
+Error: CONSTANT_EXPRESSION_RESULT:
+/builddir/build/BUILD/udftools-1.0.0b3/cdrwtool/cdrwtool.c:626: result_independent_of_operands: (ret == ioctl(fd, 21289, 1)) < 0 is always false regardless of the values of its operands. This occurs as the logical operand of if.
+
+Possible buffer overflow of static allocated variable "device".
+
+diff -up udftools-1.0.0b3/cdrwtool/cdrwtool.c.staticanal udftools-1.0.0b3/cdrwtool/cdrwtool.c
+--- udftools-1.0.0b3/cdrwtool/cdrwtool.c.staticanal 2012-01-26 16:20:44.518234366 +0100
++++ udftools-1.0.0b3/cdrwtool/cdrwtool.c 2012-01-26 16:20:44.537234366 +0100
+@@ -623,7 +623,7 @@ int cdrom_open_check(int fd)
+ if ((ret = ioctl(fd, CDROM_CLEAR_OPTIONS, CDO_LOCK)) < 0)
+ return ret;
+
+- if ((ret == ioctl(fd, CDROM_LOCKDOOR, 1)) < 0) {
++ if ((ret = ioctl(fd, CDROM_LOCKDOOR, 1)) < 0) {
+ fprintf(stderr, "CD-ROM appears to already be opened\n");
+ return 1;
+ }
+diff -up udftools-1.0.0b3/cdrwtool/options.c.staticanal udftools-1.0.0b3/cdrwtool/options.c
+--- udftools-1.0.0b3/cdrwtool/options.c.staticanal 2012-01-26 16:26:11.288212023 +0100
++++ udftools-1.0.0b3/cdrwtool/options.c 2012-01-26 16:27:24.125207040 +0100
+@@ -135,7 +135,8 @@ void parse_args(int argc, char *argv[],
+ }
+ case 'd':
+ {
+- strcpy(device, optarg);
++ strncpy(device, optarg, NAME_MAX-1);
++ device[NAME_MAX-1] = '\0';
+ printf("using device %s\n", device);
+ break;
+ }
+
+
+==========================================================================
+Error: NEGATIVE_RETURNS:
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:161: negative_return_fn: Function "open64(filename, 66, 432)" returns a negative number.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:161: var_assign: Assigning: signed variable "fd" = "open64".
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:165: negative_returns: "fd" is passed to a parameter that cannot be negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:85: neg_sink_parm_call: Passing "fd" to "valid_offset", which cannot accept a negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:55: neg_sink_parm_call: Passing "fd" to "udf_lseek64", which cannot accept a negative.
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/main.c:43: neg_sink_parm_call: Passing "fd" to "lseek64", which cannot accept a negative.
+
+diff -up udftools-1.0.0b3/mkudffs/main.c.staticanal udftools-1.0.0b3/mkudffs/main.c
+--- udftools-1.0.0b3/mkudffs/main.c.staticanal 2004-02-23 04:33:11.000000000 +0100
++++ udftools-1.0.0b3/mkudffs/main.c 2012-01-26 16:29:17.605199282 +0100
+@@ -162,6 +162,10 @@ int main(int argc, char *argv[])
+ #else
+ fd = open(filename, O_RDWR | O_CREAT | O_LARGEFILE, 0660);
+ #endif
++ if (fd == NULL) {
++ fprintf(stderr, "mkudffs: cannot open '%s' for writing\n", filename);
++ exit(1);
++ }
+ disc.head->blocks = get_blocks(fd, disc.blocksize, disc.head->blocks);
+ disc.write = write_func;
+ disc.write_data = &fd;
+
+
+==========================================================================
+Error: BAD_SIZEOF:
+/builddir/build/BUILD/udftools-1.0.0b3/mkudffs/mkudffs.c:45: bad_sizeof: Taking the size of pointer parameter "disc" is suspicious.
+
+Possible buffer overflow of static allocated variable "device".
+
+diff -up udftools-1.0.0b3/mkudffs/mkudffs.c.staticanal udftools-1.0.0b3/mkudffs/mkudffs.c
+--- udftools-1.0.0b3/mkudffs/mkudffs.c.staticanal 2012-01-26 16:20:44.526234367 +0100
++++ udftools-1.0.0b3/mkudffs/mkudffs.c 2012-01-26 16:20:44.539234366 +0100
+@@ -42,7 +42,7 @@ void udf_init_disc(struct udf_disc *disc
+ struct tm *tm;
+ int altzone;
+
+- memset(disc, 0x00, sizeof(disc));
++ memset(disc, 0x00, sizeof(*disc));
+
+ disc->blocksize = 2048;
+ disc->blocksize_bits = 11;
+diff -up udftools-1.0.0b3/mkudffs/options.c.staticanal udftools-1.0.0b3/mkudffs/options.c
+--- udftools-1.0.0b3/mkudffs/options.c.staticanal 2012-01-26 16:24:14.082220036 +0100
++++ udftools-1.0.0b3/mkudffs/options.c 2012-01-26 16:27:29.086206703 +0100
+@@ -320,7 +320,8 @@ void parse_args(int argc, char *argv[],
+ }
+ if (optind == argc)
+ usage();
+- strcpy(device, argv[optind]);
++ strncpy(device, argv[optind], NAME_MAX-1);
++ device[NAME_MAX-1] = '\0';
+ optind ++;
+ if (optind < argc)
+ disc->head->blocks = strtoul(argv[optind++], NULL, 0);
+
+
+==========================================================================
+Error: OVERRUN_STATIC:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:378: overrun-local: Overrunning static array "spm->locSparingTable", with 4 elements, at position 4 with index variable "i".
+
+Error: NEGATIVE_RETURNS:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:769: negative_return_fn: Function "open(filename, 2)" returns a negative number.
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:769: var_assign: Assigning: signed variable "device" = "open".
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cdrw.c:773: negative_returns: "device" is passed to a parameter that cannot be negative.
+
+diff -up udftools-1.0.0b3/wrudf/wrudf-cdrw.c.staticanal udftools-1.0.0b3/wrudf/wrudf-cdrw.c
+--- udftools-1.0.0b3/wrudf/wrudf-cdrw.c.staticanal 2012-01-26 16:20:44.529234367 +0100
++++ udftools-1.0.0b3/wrudf/wrudf-cdrw.c 2012-01-26 16:35:29.729173836 +0100
+@@ -374,7 +374,7 @@ void updateSparingTable() {
+ struct packetbuf *pb;
+ struct sparablePartitionMap *spm = (struct sparablePartitionMap*)lvd->partitionMaps;
+
+- for( i = 0; i <= 4; i++ ) {
++ for( i = 0; i < sizeof(spm->locSparingTable); i++ ) {
+ pbn = spm->locSparingTable[i];
+ if( pbn == 0 )
+ return;
+@@ -682,6 +682,8 @@ readExtents(char* dest, int usesShort, v
+ dest += 2048;
+ if( len < 2048 )
+ break;
++ /* dead code, len couldn't be 0 at this point
++ (break was called in this case) */
+ if( len == 0 ) {
+ if( usesShort ) {
+ sh++;
+@@ -766,8 +768,10 @@ initIO(char *filename)
+
+ if( S_ISREG(filestat.st_mode) ) { /* disk image of a UDF volume */
+ devicetype = DISK_IMAGE;
+- if( !(device = open(filename, O_RDWR)) )
++ if( !(device = open(filename, O_RDWR)) ) {
+ fail("initIO: open %s failed\n", filename);
++ return 0;
++ }
+
+ /* heuristically determine medium imitated on disk image based on VAT FileEntry in block 512 */
+ rv = lseek(device, 2048 * 512, SEEK_SET);
+
+==========================================================================
+Error: CONSTANT_EXPRESSION_RESULT:
+/builddir/build/BUILD/udftools-1.0.0b3/wrudf/wrudf-cmnd.c:699: missing_parentheses: !(*fid)->fileCharacteristics & 2 is always 0 regardless of the values of its operands. This occurs as the logical operand of if. Did you intend to apply '&' to (*fid)->fileCharacteristics and 2? If so, parentheses would be required to force this interpretation.
+
+diff -up udftools-1.0.0b3/wrudf/wrudf-cmnd.c.staticanal udftools-1.0.0b3/wrudf/wrudf-cmnd.c
+--- udftools-1.0.0b3/wrudf/wrudf-cmnd.c.staticanal 2012-01-26 16:20:44.530234366 +0100
++++ udftools-1.0.0b3/wrudf/wrudf-cmnd.c 2012-01-26 16:20:44.543234366 +0100
+@@ -696,7 +696,7 @@ analyzeDest(char* arg, struct fileIdentD
+ *fid = findFileIdentDesc(curDir, comp);
+ if( *fid == NULL )
+ return DIR_INVALID;
+- if( ! (*fid)->fileCharacteristics & FID_FILE_CHAR_DIRECTORY )
++ if( ! ((*fid)->fileCharacteristics & FID_FILE_CHAR_DIRECTORY ))
+ return DIR_INVALID;
+ if( (*fid)->fileCharacteristics & FID_FILE_CHAR_DELETED )
+ return DIR_INVALID;
+diff -up udftools-1.0.0b3/wrudf/wrudf.c.staticanal udftools-1.0.0b3/wrudf/wrudf.c
+--- udftools-1.0.0b3/wrudf/wrudf.c.staticanal 2012-01-26 16:20:44.528234367 +0100
++++ udftools-1.0.0b3/wrudf/wrudf.c 2012-01-26 16:20:44.545234365 +0100
+@@ -158,6 +158,7 @@ initialise(char *devicename)
+
+ if( (p = readTaggedBlock(blkno, ABSOLUTE)) == NULL ) {
+ if( !inMainSeq )
++ /* dead code - the condition "inMainSeq" cannot be false */
+ fail("Volume Descriptor Sequences read failure\n");
+ blkno = extentRsrvVolDescSeq.extLocation;
+ len = extentRsrvVolDescSeq.extLength;
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch
new file mode 100644
index 000000000000..5b530c6041e1
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes.patch
@@ -0,0 +1,94 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-warningfixes.patch?h=f22
+
+diff -Naupr udftools-1.0.0b3.orig/cdrwtool/cdrwtool.h udftools-1.0.0b3/cdrwtool/cdrwtool.h
+--- udftools-1.0.0b3.orig/cdrwtool/cdrwtool.h 2002-11-26 08:18:50.000000000 +0100
++++ udftools-1.0.0b3/cdrwtool/cdrwtool.h 2006-07-27 14:16:06.000000000 +0200
+@@ -226,6 +226,7 @@ int read_disc_info(int, disc_info_t *);
+ int read_track_info(int, track_info_t *, int);
+ int reserve_track(int, struct cdrw_disc *);
+ int close_track(int, unsigned int);
++int close_session(int, unsigned int);
+ int read_buffer_cap(int, struct cdrw_disc *);
+ int set_cd_speed(int, int);
+ void cdrom_close(int);
+@@ -236,5 +237,6 @@ int print_disc_track_info(int);
+ void make_write_page(write_params_t *, struct cdrw_disc *);
+ void print_params(write_params_t *);
+ void cdrw_init_disc(struct cdrw_disc *);
++int udf_set_version(struct udf_disc *, int);
+
+ #endif /* _CDRWTOOL_H */
+diff -Naupr udftools-1.0.0b3.orig/include/udf_endian.h udftools-1.0.0b3/include/udf_endian.h
+--- udftools-1.0.0b3.orig/include/udf_endian.h 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/include/udf_endian.h 2006-07-27 14:09:30.000000000 +0200
+@@ -23,6 +23,8 @@
+ #ifndef __UDF_ENDIAN_H
+ #define __UDF_ENDIAN_H
+
++#include <string.h>
++
+ #include "bswap.h"
+
+ static inline lb_addr lelb_to_cpu(lb_addr in)
+diff -Naupr udftools-1.0.0b3.orig/libudffs/unicode.c udftools-1.0.0b3/libudffs/unicode.c
+--- udftools-1.0.0b3.orig/libudffs/unicode.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/libudffs/unicode.c 2006-07-27 14:11:17.000000000 +0200
+@@ -169,8 +169,6 @@ error_out:
+
+ int decode_string(struct udf_disc *disc, char *in, char *out, int inlen)
+ {
+- int i;
+-
+ if (disc->flags & FLAG_UTF8)
+ return decode_utf8(in, out, inlen);
+ else if (disc->flags & (FLAG_UNICODE8 | FLAG_UNICODE16))
+diff -Naupr udftools-1.0.0b3.orig/pktsetup/pktsetup.c udftools-1.0.0b3/pktsetup/pktsetup.c
+--- udftools-1.0.0b3.orig/pktsetup/pktsetup.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/pktsetup/pktsetup.c 2006-07-27 14:18:24.000000000 +0200
+@@ -23,6 +23,7 @@
+ #include <getopt.h>
+ #include <bits/types.h>
+ #include <sys/types.h>
++#include <string.h>
+
+ #include <linux/cdrom.h>
+
+diff -Naupr udftools-1.0.0b3.orig/wrudf/Makefile.am udftools-1.0.0b3/wrudf/Makefile.am
+--- udftools-1.0.0b3.orig/wrudf/Makefile.am 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/wrudf/Makefile.am 2006-07-27 14:21:24.000000000 +0200
+@@ -1,5 +1,5 @@
+ bin_PROGRAMS = wrudf
+ wrudf_LDADD = $(top_builddir)/libudffs/libudffs.la -lreadline -lncurses
+-wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h
++wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h ../include/libudffs.h
+
+ AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DDEBUG
+diff -Naupr udftools-1.0.0b3.orig/wrudf/Makefile.in udftools-1.0.0b3/wrudf/Makefile.in
+--- udftools-1.0.0b3.orig/wrudf/Makefile.in 2004-02-23 10:33:48.000000000 +0100
++++ udftools-1.0.0b3/wrudf/Makefile.in 2006-07-27 14:21:44.000000000 +0200
+@@ -85,7 +85,7 @@ am__quote = @am__quote@
+ install_sh = @install_sh@
+ bin_PROGRAMS = wrudf
+ wrudf_LDADD = $(top_builddir)/libudffs/libudffs.la -lreadline -lncurses
+-wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h
++wrudf_SOURCES = wrudf.c wrudf-cmnd.c wrudf-desc.c wrudf-cdrw.c wrudf-cdr.c ide-pc.c wrudf.h ide-pc.h ../include/ecma_167.h ../include/osta_udf.h ../include/bswap.h ../include/libudffs.h
+
+ AM_CPPFLAGS = -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DDEBUG
+ subdir = wrudf
+diff -Naupr udftools-1.0.0b3.orig/wrudf/wrudf.h udftools-1.0.0b3/wrudf/wrudf.h
+--- udftools-1.0.0b3.orig/wrudf/wrudf.h 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3/wrudf/wrudf.h 2006-07-27 14:22:33.000000000 +0200
+@@ -23,9 +23,11 @@
+ #include <sys/time.h>
+ #include <time.h>
+ #include <stdint.h>
++#include <string.h>
+
+ #include "ecma_167.h"
+ #include "osta_udf.h"
++#include "libudffs.h"
+
+ struct generic_desc
+ {
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch
new file mode 100644
index 000000000000..1593eb600fae
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-warningfixes2.patch
@@ -0,0 +1,160 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-warningfixes2.patch?h=f22
+
+diff -ur udftools-1.0.0b3/libudffs/file.c udftools-1.0.0b3-new/libudffs/file.c
+--- udftools-1.0.0b3/libudffs/file.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/libudffs/file.c 2007-08-23 14:02:07.000000000 +0200
+@@ -576,7 +576,7 @@
+ tmp = leBPL_to_cpup(p);
+ found_first:
+ tmp |= (~0UL << size);
+- if (tmp == ~0UL) /* Are any bits zero? */
++ if (tmp == (uintBPL)~0UL) /* Are any bits zero? */
+ return result + size; /* Nope. */
+ found_middle:
+ return result + ffz(tmp);
+diff -ur udftools-1.0.0b3/mkudffs/mkudffs.c udftools-1.0.0b3-new/mkudffs/mkudffs.c
+--- udftools-1.0.0b3/mkudffs/mkudffs.c 2007-08-23 14:32:38.000000000 +0200
++++ udftools-1.0.0b3-new/mkudffs/mkudffs.c 2007-08-23 14:14:42.000000000 +0200
+@@ -72,7 +72,7 @@
+ disc->udf_pvd[0] = malloc(sizeof(struct primaryVolDesc));
+ memcpy(disc->udf_pvd[0], &default_pvd, sizeof(struct primaryVolDesc));
+ memcpy(&disc->udf_pvd[0]->recordingDateAndTime, &ts, sizeof(timestamp));
+- sprintf(&disc->udf_pvd[0]->volSetIdent[1], "%08lx%s",
++ sprintf((char *)&disc->udf_pvd[0]->volSetIdent[1], "%08lx%s",
+ mktime(tm), &disc->udf_pvd[0]->volSetIdent[9]);
+ disc->udf_pvd[0]->volIdent[31] = strlen(disc->udf_pvd[0]->volIdent);
+ disc->udf_pvd[0]->volSetIdent[127] = strlen(disc->udf_pvd[0]->volSetIdent);
+@@ -289,7 +289,7 @@
+ int write_disc(struct udf_disc *disc)
+ {
+ struct udf_extent *start_ext;
+- int ret;
++ int ret=0;
+
+ start_ext = disc->head;
+
+@@ -299,6 +299,7 @@
+ return ret;
+ start_ext = start_ext->next;
+ }
++ return ret;
+ }
+
+ void setup_vrs(struct udf_disc *disc)
+@@ -450,7 +451,7 @@
+ struct unallocSpaceEntry *use;
+ short_ad *sad;
+ int max = (0x3FFFFFFF / disc->blocksize) * disc->blocksize;
+- int pos;
++ int pos=0;
+ long long rem;
+
+ if (disc->flags & FLAG_STRATEGY4096)
+diff -ur udftools-1.0.0b3/wrudf/ide-pc.c udftools-1.0.0b3-new/wrudf/ide-pc.c
+--- udftools-1.0.0b3/wrudf/ide-pc.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/ide-pc.c 2007-08-23 14:32:09.000000000 +0200
+@@ -31,6 +31,7 @@
+ #include <sys/types.h> /* for u_char etc. */
+ #include <linux/cdrom.h>
+ #include <unistd.h> /* sleep() */
++#include <stdlib.h>
+
+ #include "bswap.h"
+ #include "ide-pc.h"
+diff -ur udftools-1.0.0b3/wrudf/wrudf.c udftools-1.0.0b3-new/wrudf/wrudf.c
+--- udftools-1.0.0b3/wrudf/wrudf.c 2007-08-23 14:32:38.000000000 +0200
++++ udftools-1.0.0b3-new/wrudf/wrudf.c 2007-08-23 14:26:41.000000000 +0200
+@@ -245,7 +245,7 @@
+ } else if( strncmp( spm->partIdent.ident, UDF_ID_VIRTUAL, strlen(UDF_ID_VIRTUAL)) == 0 )
+ virtualPartitionNum = i;
+ }
+- spm = (char*)spm + spm->partitionMapLength;
++ spm = (struct sparablePartitionMap*)((char*)spm + spm->partitionMapLength);
+ }
+
+ if( medium == CDR ) {
+@@ -300,7 +300,7 @@
+ fail("SpaceBitmap not found\n");
+ }
+
+- if (fsdLen = decode_utf8(fsd->fileSetIdent, fsdOut, fsd->fileSetIdent[31]))
++ if ((fsdLen = decode_utf8(fsd->fileSetIdent, fsdOut, fsd->fileSetIdent[31]))>=0)
+ fsdOut[fsdLen] = '\0';
+
+ printf("You are going to update fileset '%s'\nProceed (y/N) : ", &fsdOut[1]);
+@@ -605,7 +605,7 @@
+ int
+ main(int argc, char** argv)
+ {
+- int rv;
++ int rv=0;
+ int cmnd;
+ char prompt[256];
+ Directory *d;
+diff -ur udftools-1.0.0b3/wrudf/wrudf-cdrw.c udftools-1.0.0b3-new/wrudf/wrudf-cdrw.c
+--- udftools-1.0.0b3/wrudf/wrudf-cdrw.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/wrudf-cdrw.c 2007-08-23 14:30:14.000000000 +0200
+@@ -614,7 +614,6 @@
+ readTaggedBlock(uint32_t lbn, uint16_t partition)
+ {
+ int i;
+- uint32_t blkno;
+ uint8_t sum, *p;
+ struct generic_desc *block;
+
+@@ -634,7 +633,7 @@
+ if( strncmp(((struct sparingTable*)block)->sparingIdent.ident, UDF_ID_SPARING, strlen(UDF_ID_SPARING)) != 0 ) {
+ for( i = 0; i < 2048; i++ ) {
+ if( ((uint8_t*)block)[i] != 0 ) {
+- printf("readTaggedBlock: Empty block %d not all zeroes\n", blkno);
++ printf("readTaggedBlock: Empty block %d not all zeroes\n", lbn);
+ break;
+ }
+ }
+@@ -647,10 +646,10 @@
+ sum += *(p + i);
+
+ if( block->descTag.tagChecksum != sum )
+- fail("readTagged: Checksum error in block %d\n", blkno);
++ fail("readTagged: Checksum error in block %d\n", lbn);
+
+ if( block->descTag.descCRC != udf_crc((uint8_t*)block + sizeof(tag), ((tag*)block)->descCRCLength, 0) )
+- fail("readTagged: CRC error in block %d\n", blkno);
++ fail("readTagged: CRC error in block %d\n", lbn);
+
+ return block;
+ }
+@@ -709,8 +708,8 @@
+ writeExtents(char* src, int usesShort, void* extents)
+ {
+ uint len, blkno, partitionNumber;
+- long_ad *lo;
+- short_ad *sh;
++ long_ad *lo=NULL;
++ short_ad *sh=NULL;
+
+ if( usesShort ) {
+ sh = (short_ad*) extents;
+diff -ur udftools-1.0.0b3/wrudf/wrudf-cmnd.c udftools-1.0.0b3-new/wrudf/wrudf-cmnd.c
+--- udftools-1.0.0b3/wrudf/wrudf-cmnd.c 2002-11-26 08:18:51.000000000 +0100
++++ udftools-1.0.0b3-new/wrudf/wrudf-cmnd.c 2007-08-23 14:22:41.000000000 +0200
+@@ -45,7 +45,7 @@
+ int
+ copyFile(Directory *dir, char* inName, char*newName, struct stat *fileStat)
+ {
+- int fd, i, blkno;
++ int fd, i=0, blkno;
+ uint32_t nBytes, blkInPkt;
+ uint32_t maxVarPktSize; // in bytes
+ struct fileIdentDesc *fid;
+@@ -54,7 +54,7 @@
+
+ fd = open(inName, O_RDONLY);
+ if( fd == 0 ) {
+- printf("'%s' does not exist\n", cmndv[i]);
++ printf("'%s' does not exist\n", inName);
+ return CMND_FAILED;
+ }
+
diff --git a/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch b/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch
new file mode 100644
index 000000000000..06d9c3f616f4
--- /dev/null
+++ b/sys-fs/udftools/files/udftools-1.0.0b3-wrudf_help.patch
@@ -0,0 +1,52 @@
+taken from Fedora
+
+http://pkgs.fedoraproject.org/cgit/udftools.git/tree/udftools-1.0.0b3-wrudf_help.patch?h=f22
+
+diff -up wrk/wrudf/wrudf.c.wrk wrk/wrudf/wrudf.c
+--- wrk/wrudf/wrudf.c.wrk 2013-04-15 15:32:03.395528452 +0200
++++ wrk/wrudf/wrudf.c 2013-04-15 16:06:37.535546730 +0200
+@@ -603,6 +603,28 @@ parseCmnd(char* line)
+ return cmnd;
+ }
+
++int show_help()
++{
++ char *msg =
++ "Interactive tool to maintain an UDF filesystem.\n"
++ "Usage:\n"
++ "\twrudf [device]\n"
++ "Available commands:\n"
++ "\tcp\n"
++ "\trm\n"
++ "\tmkdir\n"
++ "\trmdir\n"
++ "\tlsc\n"
++ "\tlsh\n"
++ "\tcdc\n"
++ "\tcdh\n"
++ "Specify cdh/lsh or cdc/lsc to do cd or ls for Harddisk or CompactDisc.\n"
++ "\tquit\n"
++ "\texit\n";
++ printf("%s", msg);
++ return 0;
++}
++
+ int
+ main(int argc, char** argv)
+ {
+@@ -614,8 +636,14 @@ main(int argc, char** argv)
+ printf("wrudf " WRUDF_VERSION "\n");
+ devicename= "/dev/cdrom";
+
+- if(argc > 1 )
++ if(argc > 1 ) {
++ if (strcmp(argv[1], "-h")==0 || strcmp(argv[1], "-help")==0 || strcmp(argv[1], "--help")==0) {
++ return show_help();
++ }
++ }
++ else {
+ devicename = argv[1]; /* can specify disk image filename */
++ }
+
+ if( setpriority(PRIO_PROCESS, 0, -10) ) {
+ printf("setpriority(): %m\n");
diff --git a/sys-fs/udftools/metadata.xml b/sys-fs/udftools/metadata.xml
new file mode 100644
index 000000000000..acbd8886c16a
--- /dev/null
+++ b/sys-fs/udftools/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>base-system</herd>
+ <upstream>
+ <remote-id type="sourceforge">linux-udf</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sys-fs/udftools/udftools-1.0.0b-r10.ebuild b/sys-fs/udftools/udftools-1.0.0b-r10.ebuild
new file mode 100644
index 000000000000..508cdcdd5ac9
--- /dev/null
+++ b/sys-fs/udftools/udftools-1.0.0b-r10.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic
+
+MY_P=${P}3
+
+DESCRIPTION="Ben Fennema's tools for packet writing and the UDF filesystem"
+HOMEPAGE="http://sourceforge.net/projects/linux-udf/"
+SRC_URI="mirror://sourceforge/linux-udf/${MY_P}.tar.gz
+ http://w1.894.telia.com/~u89404340/patches/packet/${MY_P}.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-libs/readline"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ # For new kernel packet writing driver
+ epatch "${WORKDIR}"/${MY_P}.patch
+ epatch "${FILESDIR}"/cdrwtool-linux2.6-fix-v2.patch
+ epatch "${FILESDIR}"/${P}-gcc4.patch #112122
+ epatch "${FILESDIR}"/${P}-bigendian.patch #120245
+ epatch "${FILESDIR}"/${P}-openflags.patch #232100
+ epatch "${FILESDIR}"/${P}-limits_h.patch
+ epatch "${FILESDIR}"/${P}3-extsize.patch
+ epatch "${FILESDIR}"/${P}3-man-missing-options.patch
+ epatch "${FILESDIR}"/${P}3-mkudffs-bigendian.patch
+ epatch "${FILESDIR}"/${P}3-staticanal.patch
+ epatch "${FILESDIR}"/${P}3-warningfixes.patch
+ epatch "${FILESDIR}"/${P}3-warningfixes2.patch
+ epatch "${FILESDIR}"/${P}3-wrudf_help.patch
+ # Force older C standard as the code relies on static inline behavior. #548324
+ append-flags -std=gnu89
+}
+
+src_install() {
+ default
+ newinitd "${FILESDIR}"/pktcdvd.init pktcdvd
+ dosym /usr/bin/udffsck /usr/sbin/fsck.udf
+}
diff --git a/sys-fs/udftools/udftools-1.0.0b-r9.ebuild b/sys-fs/udftools/udftools-1.0.0b-r9.ebuild
new file mode 100644
index 000000000000..2fd946e8bfd0
--- /dev/null
+++ b/sys-fs/udftools/udftools-1.0.0b-r9.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils flag-o-matic
+
+MY_P=${P}3
+
+DESCRIPTION="Ben Fennema's tools for packet writing and the UDF filesystem"
+HOMEPAGE="http://sourceforge.net/projects/linux-udf/"
+SRC_URI="mirror://sourceforge/linux-udf/${MY_P}.tar.gz
+ http://w1.894.telia.com/~u89404340/patches/packet/${MY_P}.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="sys-libs/readline"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ # For new kernel packet writing driver
+ epatch "${WORKDIR}"/${MY_P}.patch
+ epatch "${FILESDIR}"/cdrwtool-linux2.6-fix-v2.patch
+ epatch "${FILESDIR}"/${P}-gcc4.patch #112122
+ epatch "${FILESDIR}"/${P}-bigendian.patch #120245
+ epatch "${FILESDIR}"/${P}-openflags.patch #232100
+ epatch "${FILESDIR}"/${P}-limits_h.patch
+ # Force older C standard as the code relies on static inline behavior. #548324
+ append-flags -std=gnu89
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc ChangeLog
+ newinitd "${FILESDIR}"/pktcdvd.init pktcdvd
+ dosym /usr/bin/udffsck /usr/sbin/fsck.udf
+}