app-cdr/dvd+rw-tools: Apply more Fedora patches fixing more bugs (#230648 also)

Package-Manager: portage-2.3.0
This commit is contained in:
Pacho Ramos
2016-08-18 19:33:26 +02:00
parent d429134c9c
commit 8f2938a48e
6 changed files with 124 additions and 0 deletions
@@ -0,0 +1,55 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
inherit toolchain-funcs
DESCRIPTION="A set of tools for DVD+RW/-RW drives"
HOMEPAGE="http://fy.chalmers.se/~appro/linux/DVD+RW/"
SRC_URI="http://fy.chalmers.se/~appro/linux/DVD+RW/tools/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
IUSE=""
RDEPEND="virtual/cdrtools"
DEPEND="${RDEPEND}
sys-devel/m4"
PATCHES=(
"${FILESDIR}"/${PN}-7.0-sysmacros.patch
"${FILESDIR}"/${PN}-7.0-wctomb-r1.patch
"${FILESDIR}"/${PN}-7.0-glibc2.6.90.patch
"${FILESDIR}"/${PN}-7.0-dvddl-r1.patch
"${FILESDIR}"/${PN}-7.0-wexit.patch
"${FILESDIR}"/${PN}-7.0-reload.patch
"${FILESDIR}"/${PN}-7.1-noevent.patch
"${FILESDIR}"/${PN}-7.1-lastshort.patch
"${FILESDIR}"/${PN}-7.1-bluray_srm+pow.patch
"${FILESDIR}"/${PN}-7.1-bluray_pow_freespace.patch
)
src_prepare() {
# Linux compiler flags only include -O2 and are incremental.
sed -i '/FLAGS/s:-O2::' Makefile.m4 || die "failed to sed out FLAGS"
default
}
src_compile() {
emake SHELL="${EPREFIX}"/bin/bash CC="$(tc-getCC)" CXX="$(tc-getCXX)"
}
src_install() {
emake SHELL="${EPREFIX}"/bin/bash prefix="${ED}/usr" install
dodoc index.html
}
pkg_postinst() {
if [[ -z "${REPLACING_VERSIONS}" ]] ; then
elog 'If you receive an error, "unable to anonymously mmap...'
elog 'Resource temporarily unavailable" when running growisofs,'
elog 'then you may need to run "ulimit -l unlimited".'
fi
}
@@ -0,0 +1,12 @@
diff -Nrup dvd+rw-tools-7.0/growisofs_mmc.cpp dvd+rw-tools-7.0_mod/growisofs_mmc.cpp
--- dvd+rw-tools-7.0/growisofs_mmc.cpp 2006-09-23 20:45:49.000000000 +0800
+++ dvd+rw-tools-7.0_mod/growisofs_mmc.cpp 2007-11-19 18:20:46.000000000 +0800
@@ -138,7 +138,7 @@ int media_reload (char *name=NULL,struct
cmd[0] = 0x1B; // START/STOP UNIT
cmd[4] = 0x2; // "Eject"
cmd[5] = 0;
- if (cmd.transport()) return 1;
+ cmd.transport();
}
#if defined(__sun) || defined(sun)
else if (volmgt_running())
@@ -0,0 +1,14 @@
diff -up wrk/growisofs_mmc.cpp.wrk wrk/growisofs_mmc.cpp
--- wrk/growisofs_mmc.cpp.wrk 2014-11-14 13:22:49.579552118 +0100
+++ wrk/growisofs_mmc.cpp 2014-11-14 13:35:36.779730963 +0100
@@ -410,7 +410,9 @@ static unsigned int get_2k_capacity (Scs
}
nwa = 0;
- if (buf[7]&1 && !bdr_plus_pow) // NWA_V
+ //if (buf[7]&1 && !bdr_plus_pow) // NWA_V
+ //!bdr_plus_pow patched out for Fedora
+ if (buf[7]&1) // NWA_V
{ nwa = buf[12]<<24;
nwa |= buf[13]<<16;
nwa |= buf[14]<<8;
@@ -0,0 +1,12 @@
diff -up dvd+rw-tools-7.1/growisofs_mmc.cpp.wrk dvd+rw-tools-7.1/growisofs_mmc.cpp
--- dvd+rw-tools-7.1/growisofs_mmc.cpp.wrk 2013-06-24 14:18:38.898344970 +0200
+++ dvd+rw-tools-7.1/growisofs_mmc.cpp 2013-06-24 14:20:00.428025541 +0200
@@ -756,6 +756,8 @@ static void bd_r_format (Scsi_Command &c
wait_for_unit (cmd);
+ bdr_plus_pow = 1;
+
cmd[0] = 0x35; // FLUSH CACHE
cmd[9] = 0;
cmd.transport();
@@ -0,0 +1,12 @@
diff -up dvd+rw-tools-7.1/growisofs_mmc.cpp.lastshort dvd+rw-tools-7.1/growisofs_mmc.cpp
--- dvd+rw-tools-7.1/growisofs_mmc.cpp.lastshort 2012-04-13 18:09:31.047641524 +0200
+++ dvd+rw-tools-7.1/growisofs_mmc.cpp 2012-04-13 18:09:34.451763587 +0200
@@ -540,7 +540,7 @@ ssize_t poor_mans_pwrite64 (int fd,const
// own higher HZ value and disrespects the user-land one.
// Sending them down as milliseconds is just safer...
//
- if (!(errcode=cmd.transport (WRITE,(void *)buff,size)))
+ if (!(errcode=cmd.transport (WRITE,(void *)buff,nbl*2048)))
break;
//--- WRITE failed ---//
@@ -0,0 +1,19 @@
diff -up dvd+rw-tools-7.1/transport.hxx.debug dvd+rw-tools-7.1/transport.hxx
--- dvd+rw-tools-7.1/transport.hxx.debug 2012-03-07 10:55:07.167322839 +0100
+++ dvd+rw-tools-7.1/transport.hxx 2012-03-07 15:44:34.384202747 +0100
@@ -1795,9 +1795,12 @@ static int handle_events (Scsi_Command &
break;
case 5: ret |= 1<<5; break; // Multiple Initiators
case 6: // Device Busy
- if ((event[4]&0xF)==1 && // Timeout occured
- (event[5]&0x3)!=0)
- { poll(NULL,0,(descr&0xFFFF)*100+100);
+ if ((event[4]&0xF)==1) // Timeout occured
+ {
+ if ((event[5]&0x3)==0) // No Event
+ return 0; // Ready to accept any command
+
+ poll(NULL,0,(descr&0xFFFF)*100+100);
cmd[0] = 0; // TEST UNIT READY
cmd[5] = 0;
if ((err=cmd.transport()))