Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Unresolved] Xsane scanner tool
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Sun Oct 11, 2015 2:11 am    Post subject: Reply with quote

Thanks for the tip, russK, but it made no difference. Also, when I launch xsane the little windows shows briefly, but long enough to note the title bar shows 0.999 (only 3 9's), before it comes up with the same message as before.

Also now it tells me that 10 config files in '/etc' need updating. I have looked in the emerge man page, but it has never made sense how to update config files. I realize this is completely off topic, but I'm not sure that it is not germane to the situation.
_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 630

PostPosted: Sun Oct 11, 2015 3:00 am    Post subject: Reply with quote

Right, it could be germane to the new version not working (maybe), but you need to know it in general anyway.

When you update packages, they might have new config file settings. But you probably don't want portage to just blow away your existing config files, which a lot of time and effort might have gone in to. So dispatch-conf provides a mechanism for keeping your existing files, but also bringing in the suggested files from the new version. I personally find dispatch-conf can be rather clumsy, if there is a large number of differences between the new files and the old files, but I'm not complaining.

Usually the number of differences is small, and I hit 'u', which means use the new file. Then I might go and fix the file manually. Sometimes I hit 'z' for zap, which means keep the old file. After you go through this a few times you'll start to realize how it works. Looking at the wiki page, https://wiki.gentoo.org/wiki/Dispatch-conf, I see it talks about vimdiff which I should probably learn how to use. At times I have resorted to using meld outside of dispatch-conf.

In any case, it's best to go through the process of making sure your config files are up to snuff with new versions after they are emerged.
Back to top
View user's profile Send private message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Sun Oct 11, 2015 4:15 am    Post subject: Reply with quote

Well, that's good. I did run dispatch-conf as it prompted and hit 'u', which is what probably allowed that newest version to complete emerging. I will study the link you've provided and the information I can dig up on vimdiff.

Maybe I can determine why xsane keeps showing 0.999 in its title bar. It's like the newest is not being used, seems to me.
_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 630

PostPosted: Sun Oct 11, 2015 4:40 am    Post subject: Reply with quote

xsane is different from sane-backends

I see xsane-0.999 too.

Use equery again,

Code:
equery list -p xsane
 * Searching for xsane ...
[IP-] [  ] media-gfx/xsane-0.999-r1:0


So 0.999-r1 is the only version of xsane in portage, also, the 'I' means this is the version installed.

Usually a version with a lot of 9's in it is a live ebuild, meaning a version that is pulled straight from git, subversion, or cvs for the project. But I it's usually very large like 9999, not a fraction like 0.999. In this case, xsane-0.999 really is the number of the latest package that has been released on their downloads page: http://www.xsane.org/
Back to top
View user's profile Send private message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Sun Oct 11, 2015 1:17 pm    Post subject: Reply with quote

I have the same exact response using equery. I thought I might be able to see something if I connected it to my Macbook Pro. It did nothing when I connected the USB cable. I could not even detect it using Printers and Scanners in System Preferences. I looked on the Internet to see if the scanner is supported on the Mac, but it is not even listed under their list of supported scanners. What is strange, however, there are NO scanners listed on that page. So much for Mac superiority! Another reason I prefer LInux, ahem.

It does bother me that the scanner's control panel doesn't do much. It will run through the options of saving to Wordpad, etc, and let you choose the number of copies, but none of the other buttons respond. If it weren't for the fact that scanimage and sane-find-scanner detect it at all, I would almost think it is dead or damaged in some way. I'm about to give up on it and go look for one.

Thanks, everyone, for your patience, persistence, and willingness to help with all your suggestions. You are one terrific resource!
_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sun Oct 11, 2015 1:29 pm    Post subject: Reply with quote

I'd recommend a networked scanner, but of course I do not know whether it suits you or not.
Back to top
View user's profile Send private message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Sun Oct 11, 2015 2:18 pm    Post subject: Reply with quote

Buffoon wrote:
I'd recommend a networked scanner, but of course I do not know whether it suits you or not.

Thanks, Buffoon. I can do that here at home. I'll look into that.
_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams


Last edited by mark2 on Mon Oct 12, 2015 3:47 am; edited 1 time in total
Back to top
View user's profile Send private message
jonathan183
Guru
Guru


Joined: 13 Dec 2011
Posts: 309

PostPosted: Sun Oct 11, 2015 3:40 pm    Post subject: Reply with quote

I use mdev and have an HP Scanjet G2410 which uses the genesys sane-backend, I had some problems initially setting this up and change ownership to root:scanner and set read/execute/write for the scanner group as part of starting the system.
You might want to check the scanner group has required permissions, it might also be worth trying creating a symlink at /dev/scanner pointing to your scanner to see if that helps.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 630

PostPosted: Sun Oct 11, 2015 7:55 pm    Post subject: Reply with quote

Another avenue might be Windows in a virtual machine.

Sorry we haven't found a solution but at least maybe we learned a thing or two in the process.
Back to top
View user's profile Send private message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Mon Oct 12, 2015 2:41 am    Post subject: Reply with quote

Big update! As it turns out the scanner is not at all dead or damaged. After some digging I learned how to go into diagnostic mode with the buttons on the control panel, and was able to navigate through a lot of tests. Once I knew that, I tried once again emerging all the components, xsane, sane-backends, sane-frontends, etc. None of which did any good.

But.

On a whim, I downloaded Vuescan and extracted it, then ran it. Lo and behold, it worked. It picked up the scanner without a hiccup, I scanned a color picture which just happened to be me and my first son 35 years ago. The only trouble is ... this is not free software. They want $39.95 for the standard version, or $79.95 for the professional version, because in the trial version it overlays a watermark over the entire image. Which I could handle with the Gimp, but that requires some detailed pixel editing. What a pain.

So, if this program can communicate with the scanner, there has to be something somewhere preventing xsane from doing the same. If "Operation is not supported", I am wondering how to enable my own support. Is this programming, or script writing? Enquiring minds wanna know.

At least the scanner won't be going out to be recycled. The diagnostics showed that it had only performed 600 scans so it should have a lot of life left in it. Also, I can set it to do 600 dpi, which I think is pretty good for my purposes.
_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams
Back to top
View user's profile Send private message
sebB
l33t
l33t


Joined: 02 Mar 2011
Posts: 739
Location: S.O. France

PostPosted: Mon Oct 12, 2015 8:22 am    Post subject: Reply with quote

Can you try with a live cd (ubuntu, fedora...) and see if it work.
Back to top
View user's profile Send private message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Mon Oct 12, 2015 10:37 am    Post subject: Reply with quote

sebB wrote:
Can you try with a live cd (ubuntu, fedora...) and see if it work.

Hmmm, that's a thought. It'll take awhile before I get a chance, but it's worth a shot. Thanks, sebB!
_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Tue Oct 13, 2015 12:23 pm    Post subject: Reply with quote

Ok, it looks like, you entered the following problem as well:

http://lists.alioth.debian.org/pipermail/sane-devel/2014-September/032639.html

According to your debug output, sane-backend is looking for an ADF (automatic document feeder). I think you dont have one on your scanner, do you? Since this is not responding, the system is telling you "Operation not supported."

There seems to be a fix for this issue, but it dont know whether this is in the version of sane-backends you have installed. Maybe you can add this by yourself. Its located in the link above.

greets bb

EDIT: you can try the following patches by hand

for sane-backends-1.0.24 use this:
Code:

--- a/backend/avision.c 2013-08-25 23:22:58.000000000 +0200
+++ b/backend/avision.c 2015-10-13 14:54:47.870445826 +0200
@@ -3164,7 +3164,7 @@
 get_accessories_info (Avision_Scanner* s)
 {
   Avision_Device* dev = s->hw;
-  int try = 3;
+  int try = 1;

   /* read stuff */
   struct command_read rcmd;
@@ -3238,7 +3238,8 @@
         goto RETRY;
       }
       DBG (1, "get_accessories_info: Maximum retries attempted, ADF unresponsive.\n");
-      return SANE_STATUS_UNSUPPORTED;
+      return SANE_STATUS_GOOD;
     }
   }


for sane-backends-1.0.25_pre20150628 use this:
Code:

--- a/backend/avision.c 2015-06-27 19:06:50.000000000 +0200
+++ b/backend/avision.c 2015-10-13 15:00:31.090450521 +0200
@@ -3168,7 +3168,7 @@
 get_accessories_info (Avision_Scanner* s)
 {
   Avision_Device* dev = s->hw;
-  int try = 3;
+  int try = 1;

   /* read stuff */
   struct command_read rcmd;
@@ -3242,7 +3242,8 @@
         goto RETRY;
       }
       DBG (1, "get_accessories_info: Maximum retries attempted, ADF unresponsive.\n");
-      return SANE_STATUS_UNSUPPORTED;
+      return SANE_STATUS_GOOD;
     }
   }

_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Tue Oct 13, 2015 10:12 pm    Post subject: Reply with quote

You are right. I do not have the ADF. But I have not been able to use the patch you've provided for the sane-backends-1.0.25_pre20150628 that I have. Maybe something I'm missing?

I get this:
Code:
marktux mark # patch a/backend/avision.c 2015-06-27 19:06:50.000000000 +0200
patch: 19:06:50.000000000: extra operand
patch: Try 'patch --help' for more information.
marktux mark # +++ b/backend/avision.c 2015-10-13 15:00:31.090450521 +0200
bash: +++: command not found
marktux mark # @@ -3168,7 +3168,7 @@
bash: @@: command not found
marktux mark #  get_accessories_info (Avision_Scanner* s)
bash: syntax error near unexpected token `Avision_Scanner*'
marktux mark #  {
>    Avision_Device* dev = s->hw;
> -  int try = 3;
> +  int try = 1;
>
>    /* read stuff */
>    struct command_read rcmd;
> @@ -3242,7 +3242,8 @@
>          goto RETRY;
>        }
bash: Avision_Device*: command not found
bash: -: command not found
bash: +: command not found
bash: /bin: Is a directory
bash: struct: command not found
bash: @@: command not found
bash: goto: command not found
marktux mark #        DBG (1, "get_accessories_info: Maximum retries attempted, ADF unresponsive.\n");
bash: syntax error near unexpected token `1,'
marktux mark # -      return SANE_STATUS_UNSUPPORTED;
bash: -: command not found
marktux mark # +      return SANE_STATUS_GOOD;
bash: +: command not found
marktux mark #      }
bash: syntax error near unexpected token `}'
marktux mark #    }

_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 630

PostPosted: Wed Oct 14, 2015 3:28 am    Post subject: Reply with quote

mark

Have you a local overlay ? Or are you trying to build from source? ...

So whatever, I was able to use the patch from bb (not exactly) and create a 1.0.25 ebuild that builds if you want to go that road.

If so, first follow the first part of this wiki page to create a local overlay: https://wiki.gentoo.org/wiki/Overlay/Local_overlay

Then, create an ebuild kindof like this:
Code:
mkdir -p /usr/local/portage/media-gfx/sane-backends
cp -r /usr/portage/media-gfx/sane-backends/files /usr/local/portage/media-gfx/sane-backends

This is the ebuild that I made by copying and changing 1.0.25_pre20150628 ebuild. I'm sure it could be simplified but it would have taken more time ;-)
Put this in /usr/local/portage/media-gfx/sane-backends/sane-backends-1.0.25.ebuild:
Code:
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI="5"

inherit autotools eutils flag-o-matic multilib multilib-minimal udev user toolchain-funcs


# gphoto and v4l are handled by their usual USE flags.
# The pint backend was disabled because I could not get it to compile.
IUSE_SANE_BACKENDS="
   abaton
   agfafocus
   apple
   artec
   artec_eplus48u
   as6e
   avision
   bh
   canon
   canon630u
   canon_dr
   canon_pp
   cardscan
   coolscan
   coolscan2
   coolscan3
   dc210
   dc240
   dc25
   dell1600n_net
   dmc
   epjitsu
   epson
   epson2
   fujitsu
   genesys
   gt68xx
   hp
   hp3500
   hp3900
   hp4200
   hp5400
   hp5590
   hpljm1005
   hpsj5s
   hs2p
   ibm
   kodak
   kodakaio
   kvs1025
   kvs20xx
   kvs40xx
   leo
   lexmark
   ma1509
   magicolor
   matsushita
   microtek
   microtek2
   mustek
   mustek_pp
   mustek_usb
   mustek_usb2
   nec
   net
   niash
   p5
   pie
   pixma
   plustek
   plustek_pp
   pnm
   qcam
   ricoh
   rts8891
   s9036
   sceptre
   sharp
   sm3600
   sm3840
   snapscan
   sp15c
   st400
   stv680
   tamarack
   teco1
   teco2
   teco3
   test
   u12
   umax
   umax1220u
   umax_pp
   xerox_mfp"

IUSE="avahi doc gphoto2 ipv6 nls snmp systemd threads usb v4l xinetd"

for backend in ${IUSE_SANE_BACKENDS}; do
   case ${backend} in
   # Disable backends that require parallel ports as no one has those anymore.
   canon_pp|hpsj5s|mustek_pp|\
   pnm)
      IUSE+=" -sane_backends_${backend}"
      ;;
   mustek_usb2|kvs40xx)
      IUSE+=" sane_backends_${backend}"
      ;;
   *)
      IUSE+=" +sane_backends_${backend}"
   esac
done

REQUIRED_USE="
   sane_backends_mustek_usb2? ( threads )
   sane_backends_kvs40xx? ( threads )
"

DESCRIPTION="Scanner Access Now Easy - Backends"
HOMEPAGE="http://www.sane-project.org/"
MY_PV="r001"
case ${PV} in
9999)
   EGIT_REPO_URI="git://anonscm.debian.org/sane/sane-backends.git"
   inherit git-r3
   ;;
*1.0.25)
   MY_P=${P}
   SRC_URI="https://alioth.debian.org/frs/download.php/file/4146/${P}.tar.gz"
   ;;
esac

LICENSE="GPL-2 public-domain"
SLOT="0"
if [[ ${PV} != "9999" ]] ; then
   KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
fi

RDEPEND="
   sane_backends_dc210? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] )
   sane_backends_dc240? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] )
   sane_backends_dell1600n_net? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}]
                           >=media-libs/tiff-3.9.7-r1[${MULTILIB_USEDEP}] )
   avahi? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
   sane_backends_canon_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
   sane_backends_hpsj5s? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
   sane_backends_mustek_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
   usb? ( >=virtual/libusb-1-r1:1[${MULTILIB_USEDEP}] )
   gphoto2? (
      >=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}]
      >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}]
   )
   v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
   xinetd? ( sys-apps/xinetd )
   snmp? ( net-analyzer/net-snmp )
   systemd? ( sys-apps/systemd:0= )
"

DEPEND="${RDEPEND}
   v4l? ( sys-kernel/linux-headers )
   doc? (
      virtual/latex-base
      dev-texlive/texlive-latexextra
   )
   >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"

# We now use new syntax construct (SUBSYSTEMS!="usb|usb_device)
RDEPEND="${RDEPEND}
   !<sys-fs/udev-114
   abi_x86_32? (
      !<=app-emulation/emul-linux-x86-medialibs-20140508
      !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
   )"

MULTILIB_CHOST_TOOLS=(
   /usr/bin/sane-config
)

pkg_setup() {
   enewgroup scanner
   enewuser saned -1 -1 -1 scanner
}

src_prepare() {
   cat >> backend/dll.conf.in <<-EOF
   # Add support for the HP-specific backend.  Needs net-print/hplip installed.
   hpaio
   # Add support for the Epson-specific backend.  Needs media-gfx/iscan installed.
   epkowa
   EOF
   epatch "${FILESDIR}"/${PN}-1.0.25-avision-adf.patch
   # Fix for "make check".
   sed -i -e 's/sane-backends 1.0.24git/sane-backends 1.0.24/' testsuite/tools/data/html*
   mv configure.{in,ac} || die
   AT_NOELIBTOOLIZE=yes eautoreconf
}

src_configure() {
   append-flags -fno-strict-aliasing

   # if LINGUAS is set, just use the listed and supported localizations.
   if [[ ${LINGUAS+set} == "set" ]]; then
      mkdir -p po || die
      strip-linguas -u po
      printf '%s\n' ${LINGUAS} > po/LINGUAS
   fi

   multilib-minimal_src_configure
}

multilib_src_configure() {
   # the blank is intended - an empty string would result in building ALL backends.
   local BACKENDS=" "

   use gphoto2 && BACKENDS="gphoto2"
   use v4l && BACKENDS="${BACKENDS} v4l"
   for backend in ${IUSE_SANE_BACKENDS}; do
      if use "sane_backends_${backend}" && [ ${backend} != pnm ]; then
         BACKENDS="${BACKENDS} ${backend}"
      fi
   done

   local myconf=(
      $(use_enable usb libusb_1_0)
      $(multilib_native_use_with snmp)
   )

   # you can only enable this backend, not disable it...
   if use sane_backends_pnm; then
      myconf+=( --enable-pnm-backend )
   fi
   if ! use doc; then
      myconf+=( --disable-latex )
   fi
   if use sane_backends_mustek_pp; then
      myconf+=( --enable-parport-directio )
   fi
   if ! { use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp; }; then
      myconf+=( sane_cv_use_libieee1284=no )
   fi

   # relative path must be used for tests to work properly
   ECONF_SOURCE=${S} \
   SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \
   BACKENDS="${BACKENDS}" \
   econf \
      $(use_with gphoto2) \
      $(multilib_native_use_with systemd) \
      $(use_with v4l) \
      $(use_enable avahi) \
      $(use_enable ipv6) \
      $(use_enable nls translations) \
      $(use_enable threads pthread) \
      "${myconf[@]}"
}

multilib_src_compile() {
   emake VARTEXFONTS="${T}/fonts"

   if tc-is-cross-compiler; then
      pushd "${BUILD_DIR}"/tools >/dev/null || die

      # The build system sucks and doesn't handle this properly.
      # https://alioth.debian.org/tracker/index.php?func=detail&aid=314236&group_id=30186&atid=410366
      tc-export_build_env BUILD_CC
      ${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
         -I. -I../include -I"${S}"/include \
         "${S}"/sanei/sanei_config.c "${S}"/sanei/sanei_constrain_value.c \
         "${S}"/sanei/sanei_init_debug.c "${S}"/tools/sane-desc.c -o sane-desc || die
      local dirs=( hal hotplug hotplug-ng udev )
      local targets=(
         hal/libsane.fdi
         hotplug/libsane.usermap
         hotplug-ng/libsane.db
         udev/libsane.rules
      )
      mkdir -p "${dirs[@]}" || die
      emake "${targets[@]}"

      popd >/dev/null
   fi

   if use usb; then
      sed -i -e '/^$/d' \
         tools/hotplug/libsane.usermap || die
   fi
}

multilib_src_install() {
   emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \
      docdir="${EPREFIX}"/usr/share/doc/${PF}

   if multilib_is_native_abi; then
      if use usb; then
         insinto /etc/hotplug/usb
         doins tools/hotplug/libsane.usermap
      fi

      udev_newrules tools/udev/libsane.rules 41-libsane.rules
      insinto "/usr/share/pkgconfig"
      doins tools/sane-backends.pc
   fi
}

multilib_src_install_all() {
   keepdir /var/lib/lock/sane
   fowners root:scanner /var/lib/lock/sane
   fperms g+w /var/lib/lock/sane
   dodir /etc/env.d

   if use usb; then
      exeinto /etc/hotplug/usb
      doexe tools/hotplug/libusbscanner
      newdoc tools/hotplug/README README.hotplug
   fi

   dodoc NEWS AUTHORS ChangeLog* PROBLEMS README README.linux
   prune_libtool_files --all
   if use xinetd; then
      insinto /etc/xinetd.d
      doins "${FILESDIR}"/saned
   fi

   newinitd "${FILESDIR}"/saned.initd saned
   newconfd "${FILESDIR}"/saned.confd saned
}

pkg_postinst() {
   if use xinetd; then
      elog "If you want remote clients to connect, edit"
      elog "/etc/sane.d/saned.conf and /etc/hosts.allow"
   fi

   elog "If you are using a USB scanner, add all users who want"
   elog "to access your scanner to the \"scanner\" group."
}


Put this in /usr/local/portage/media-gfx/sane-backends/files/sane-backends-1.0.25-avision-adf.patch:
Code:
--- a/backend/avision.c
+++ b/backend/avision.c
@@ -3168,7 +3168,7 @@
 get_accessories_info (Avision_Scanner* s)
 {
   Avision_Device* dev = s->hw;
-  int try = 3;
+  int try = 1;
   
   /* read stuff */
   struct command_read rcmd;
@@ -3242,7 +3242,7 @@
         goto RETRY;
       }
       DBG (1, "get_accessories_info: Maximum retries attempted, ADF unresponsive.\n");
-      return SANE_STATUS_UNSUPPORTED;
+      return SANE_STATUS_GOOD;
     }
   }
 

run, 'ebuild /usr/local/portage/media-gfx/sane-backends/sane-backends-1.0.25.ebuild digest'

Then,
Code:
emerge =media-gfx/sane-backends-1.0.25


Hopefully it installs and works!
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Wed Oct 14, 2015 5:42 am    Post subject: Reply with quote

There is an other way to apply "user-patches" as well, if you dont want to mess with a local overlay. I havent used it up to now, but it should work as well. You should have a look at this blog:

http://klaig.blogspot.de/2011/07/how-to-apply-user-patches-in-portage.html

I dont know, if it works for sane-backends, but imo it is worth a try ;)

bb

EDIT: looks like, this wont work for sane-backends, but you can do it this way:

1st: create a file with the patch contents ({$PATCHFILE})
2nd:
Code:

$ ebuild /usr/portage/media-gfx/sane-backends/sane-backends-{$VERSION}.ebuild prepare
$ cd /var/tmp/portage/media-gfx/sane-backends/sane-backends-{$VERSION}/work/sane-backends-1.0.24/
$ cat {$PATCHFILE} | patch -p1
$ ebuild /usr/portage/media-gfx/sane-backends/sane-backends-{$VERSION}.ebuild merge


greets, bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Thu Oct 15, 2015 2:15 am    Post subject: Reply with quote

Hi russK, I tried your procedure (thank heaven for copy/paste) but I've gotten an error, which is this:
Code:
ebuild /usr/local/portage/media-gfx/sane-backends/sane-backends-1.0.25.ebuild digest
/usr/local/portage/media-gfx/sane-backends/sane-backends-1.0.25.ebuild: line 337: warning: here-document at line 186 delimited by end-of-file (wanted `EOF')
/usr/local/portage/media-gfx/sane-backends/sane-backends-1.0.25.ebuild: line 338: syntax error: unexpected end of file
 * ERROR: media-gfx/sane-backends-1.0.25::local failed (depend phase):
 *   error sourcing ebuild
 *
 * Call stack:
 *   ebuild.sh, line 584:  Called die
 * The specific snippet of code:
 *            source "$EBUILD" || die "error sourcing ebuild"
 *
 * If you need support, post the output of `emerge --info '=media-gfx/sane-backends-1.0.25::local'`,
 * the complete build log and the output of `emerge -pqv '=media-gfx/sane-backends-1.0.25::local'`.
 * Working directory: '/usr/lib64/python3.4/site-packages'
 * S: '/var/tmp/portage/media-gfx/sane-backends-1.0.25/work/sane-backends-1.0.25'

But also, I looked into /usr/local/portage/media-gfx/sane-backends and there was another folder named 'files'. It contained things which I'm not sure how they got in there, but I guess I must have done it. Anyway they can be seen here: https://bpaste.net/show/c4c5a8fd0d1f. Does this make any difference.

@bb:
I wanted to try your procedure, but I am unclear what you mean by 'create a file with the patch contents ({$PATCHFILE})'. Is that the actual name? I'm sorry but I often get confused by terminology that I'm not familiar with. :oops:
_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Thu Oct 15, 2015 6:06 am    Post subject: Reply with quote

mark2 wrote:
Hi russK, I tried your procedure (thank heaven for copy/paste) but I've gotten an error, which is this:
Code:
ebuild /usr/local/portage/media-gfx/sane-backends/sane-backends-1.0.25.ebuild digest
/usr/local/portage/media-gfx/sane-backends/sane-backends-1.0.25.ebuild: line 337: warning: here-document at line 186 delimited by end-of-file (wanted `EOF')
/usr/local/portage/media-gfx/sane-backends/sane-backends-1.0.25.ebuild: line 338: syntax error: unexpected end of file
 * ERROR: media-gfx/sane-backends-1.0.25::local failed (depend phase):
 *   error sourcing ebuild
 *
 * Call stack:
 *   ebuild.sh, line 584:  Called die
 * The specific snippet of code:
 *            source "$EBUILD" || die "error sourcing ebuild"
 *
 * If you need support, post the output of `emerge --info '=media-gfx/sane-backends-1.0.25::local'`,
 * the complete build log and the output of `emerge -pqv '=media-gfx/sane-backends-1.0.25::local'`.
 * Working directory: '/usr/lib64/python3.4/site-packages'
 * S: '/var/tmp/portage/media-gfx/sane-backends-1.0.25/work/sane-backends-1.0.25'

But also, I looked into /usr/local/portage/media-gfx/sane-backends and there was another folder named 'files'. It contained things which I'm not sure how they got in there, but I guess I must have done it. Anyway they can be seen here: https://bpaste.net/show/c4c5a8fd0d1f. Does this make any difference.



Somehow, I had the same issue. You could try changing the two lines by hand instead of using a patchfile

mark2 wrote:

@bb:
I wanted to try your procedure, but I am unclear what you mean by 'create a file with the patch contents ({$PATCHFILE})'. Is that the actual name? I'm sorry but I often get confused by terminology that I'm not familiar with. :oops:


$PATCHFILE is just a replacement for a name, you can choose. You could use the terminology russK suggested or whatever you want.

greets bb
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Thu Oct 15, 2015 3:04 pm    Post subject: Reply with quote

Ignorance showing again. Can't seem to determine which two lines.
Quote:

Somehow, I had the same issue. You could try changing the two lines by hand instead of using a patchfile

Tried counting to line 186, maybe got close, but it made no sense. And don't know what to change it to IF I'm looking at the right place.
_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1792
Location: Oranienburg/Germany

PostPosted: Thu Oct 15, 2015 3:27 pm    Post subject: Reply with quote

Hi, no problem,

here are the lines that need changing in backends/avision.c:

1st: search for "Avision_Device* dev = s->hw; " and replace in the following line "int try = 3; " with "int try = 1;"
2nd: search for "DBG (1, "get_accessories_info: Maximum retries attempted, ADF unresponsive.\n");" and replace in the following line "return SANE_STATUS_UNSUPPORTED;" with "return SANE_STATUS_GOOD;"

thats all, greets bb

EDIT: Oh the first is not in line 187 its at around line 3168 ;)
_________________
1st: i5-4570, 16GB, 1.75TB
2nd: i5-4570, 16GB, 620GB
3rd: i5-4570, 16GB, 10,5TB
4th: Asus N61VN, 8GB, 240GB
5th: C2D T7200, 2GB, 16GB USB + NFS
Back to top
View user's profile Send private message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Thu Oct 15, 2015 5:22 pm    Post subject: Reply with quote

That explains it. I wasn't even looking in the right place! I will go back in after I get off work and post back with results.

Thanks for the clarification, bb!
_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams
Back to top
View user's profile Send private message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Fri Oct 16, 2015 12:48 am    Post subject: Reply with quote

I am lost. I cannot find backends/avision.c and I don't remember any file with over 3,160 lines. Where is this supposed to be? It is certainly not in /usr/local/portage/media-gfs/sane-backends/.
_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 630

PostPosted: Fri Oct 16, 2015 1:27 am    Post subject: Reply with quote

mark2 wrote:
Hi russK, I tried your procedure (thank heaven for copy/paste) but I've gotten an error, which is this:
Code:
ebuild /usr/local/portage/media-gfx/sane-backends/sane-backends-1.0.25.ebuild digest
/usr/local/portage/media-gfx/sane-backends/sane-backends-1.0.25.ebuild: line 337: warning: here-document at line 186 delimited by end-of-file (wanted `EOF')
/usr/local/portage/media-gfx/sane-backends/sane-backends-1.0.25.ebuild: line 338: syntax error: unexpected end of file
 * ERROR: media-gfx/sane-backends-1.0.25::local failed (depend phase):
 *   error sourcing ebuild
 *
 * Call stack:
 *   ebuild.sh, line 584:  Called die
 * The specific snippet of code:
 *            source "$EBUILD" || die "error sourcing ebuild"
 *
 * If you need support, post the output of `emerge --info '=media-gfx/sane-backends-1.0.25::local'`,
 * the complete build log and the output of `emerge -pqv '=media-gfx/sane-backends-1.0.25::local'`.
 * Working directory: '/usr/lib64/python3.4/site-packages'
 * S: '/var/tmp/portage/media-gfx/sane-backends-1.0.25/work/sane-backends-1.0.25'

But also, I looked into /usr/local/portage/media-gfx/sane-backends and there was another folder named 'files'. It contained things which I'm not sure how they got in there, but I guess I must have done it. Anyway they can be seen here: https://bpaste.net/show/c4c5a8fd0d1f. Does this make any difference.


mark,

Copy and paste is awesome, but in this case it probably caused this hiccup. At around line 191 of the ebuild, I have "EOF", preceded by a single TAB character. I wonder how it ended up in your version? It should be legal for you to simply delete all of the white space before "EOF" so that it appears by itself at the beginning of the line. Then pick up the steps again from there. Hopefully that solves it. Incidentally, my version of the ebuild has a lot of TAB characters in it, I hope you don't bump into other similar problems due to the copy having converted the TABs to spaces. I suspect it should be OK.

BTW, the scripting feature being used in src_prepare() there is called a "here document": http://tldp.org/LDP/abs/html/here-docs.html, for anyone interested.

The other files in the 'files' directory can live there, they came from the copy operation. If they are not used, they are harmless.

Awesome you're using a multi-pronged attack on this problem, you're bound to get it working eventually :)

HTH
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 630

PostPosted: Fri Oct 16, 2015 1:42 am    Post subject: Reply with quote

mark2 wrote:
I am lost. I cannot find backends/avision.c and I don't remember any file with over 3,160 lines. Where is this supposed to be? It is certainly not in /usr/local/portage/media-gfs/sane-backends/.


Sorry we have you running in circles with two different approaches.

You won't find the source in the overlay tree. It gets unpacked under /var/tmp/portage during emerge. Maybe you had unpacked some source somewhere when you were trying to apply the patch manually.

When I unpacked one of the sane-backend tarballs, that file was under backend/avision.c, not backends/avision.c
Back to top
View user's profile Send private message
mark2
Apprentice
Apprentice


Joined: 22 May 2012
Posts: 293
Location: South Carolina

PostPosted: Fri Oct 16, 2015 2:06 am    Post subject: Reply with quote

Well, that got another step closer as the ebuild completed after taking out the tab before the EOF. That was copied from your earlier post, but that's neither here nor there. At any rate, when I ran the emerge =media-gfx/sane-backends-1.0.25, it errored out with the following:
Code:
 * IMPORTANT: 11 config files in '/etc/portage' need updating.
 * See the CONFIGURATION FILES section of the emerge
 * man page to learn how to update config files.
Calculating dependencies... done!

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) media-gfx/sane-backends-1.0.25::local
 * sane-backends-1.0.25.tar.gz SHA256 SHA512 WHIRLPOOL size ;-) ...                                                           [ ok ]
>>> Unpacking source...
>>> Unpacking sane-backends-1.0.25.tar.gz to /var/tmp/portage/media-gfx/sane-backends-1.0.25/work
>>> Source unpacked in /var/tmp/portage/media-gfx/sane-backends-1.0.25/work
>>> Preparing source in /var/tmp/portage/media-gfx/sane-backends-1.0.25/work/sane-backends-1.0.25 ...

 * Cannot find $EPATCH_SOURCE!  Value for $EPATCH_SOURCE is:
 *
 *   /usr/local/portage/media-gfx/sane-backends/files/sane-backends-1.0.25-avision-adf.patch
 *   ( sane-backends-1.0.25-avision-adf.patch )

 * ERROR: media-gfx/sane-backends-1.0.25::local failed (prepare phase):
 *   Cannot find $EPATCH_SOURCE!
 *
 * Call stack:
 *     ebuild.sh, line   93:  Called src_prepare
 *   environment, line 4047:  Called epatch '/usr/local/portage/media-gfx/sane-backends/files/sane-backends-1.0.25-avision-adf.patch'
 *   environment, line 1917:  Called die
 * The specific snippet of code:
 *                   die "Cannot find \$EPATCH_SOURCE!";
 *
 * If you need support, post the output of `emerge --info '=media-gfx/sane-backends-1.0.25::local'`,
 * the complete build log and the output of `emerge -pqv '=media-gfx/sane-backends-1.0.25::local'`.
 * The complete build log is located at '/usr/portage/elog/media-gfx:sane-backends-1.0.25:20151015-215156.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/media-gfx/sane-backends-1.0.25/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/media-gfx/sane-backends-1.0.25/temp/environment'.
 * Working directory: '/var/tmp/portage/media-gfx/sane-backends-1.0.25/work/sane-backends-1.0.25'
 * S: '/var/tmp/portage/media-gfx/sane-backends-1.0.25/work/sane-backends-1.0.25'

What is $EPATCH_SOURCE?

It gave a log file but it would not allow me to paste it, saying permission denied. I don't understand that because I am doing in a terminal as root. Of course I'm logged in as my user on the machine, but that puzzles me. I hate to have to reboot, log in as root, and then go from there. Must be a reason for that, but whatever.

As to your follow up post, I can't seem to find where I might have unpacked some source on that, but I did find sane-backends-1.0.25.tar.gz in /var/tmp/portage/media-gfx/sane-backends-1.0.25/distdir/.
_________________
Thanks,
Mark
__________________________________________________________________
"Flying is learning how to throw yourself at the ground and miss." - Douglas Adams


Last edited by mark2 on Fri Oct 16, 2015 11:18 am; edited 1 time in total
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum