https://bugs.gpodder.org/show_bug.cgi?id=1730

--- Comment #12 from chris <[email protected]> 2013-01-07 21:28:59 GMT ---
(In reply to comment #9)
> (In reply to comment #7)
> > I've also been hit with this bug on FreeBSD where iproute2 is not 
> > available. 
> > 
> > FreeBSD 8.2-STABLE i386
> > 
> > I wrote a little patch to make gpodder work on FreeBSD. Here it is:
> > 
> >  *** util.py.bck 2013-01-01 12:46:08.000000000 +0100
> > --- util.py     2013-01-01 12:47:41.000000000 +0100
> > ***************
> > *** 1670,1675 ****
> > --- 1670,1688 ----
> >           if b:
> >               yield b.group(1)
> > 
> > + def unix_get_active_interfaces():
> > +     """Get active network interfaces using 'ifconfig'
> > + 
> > +     Returns a list of active network interfaces or an
> > +     empty list if the device is offline. The loopback
> > +     interface is not included.
> > +     """
> > +     stdout = subprocess.check_output(['ifconfig'])
> > +     for i in re.split('\n(?!\t)', stdout, re.MULTILINE):
> > +         b = re.match('(\\w+):.*status: active$', i, re.MULTILINE | 
> > re.DOTALL)
> > +         if b:
> > +             yield b.group(1)
> > + 
> > 
> >   def connection_available():
> >       """Check if an Internet connection is available
> > ***************
> > *** 1686,1692 ****
> >               return len(list(osx_get_active_interfaces())) > 0
> >               return True
> >           else:
> > !             return len(list(linux_get_active_interfaces())) > 0
> >       except Exception, e:
> >           logger.warn('Cannot get connection status: %s', e, exc_info=True)
> >           return False
> > --- 1699,1705 ----
> >               return len(list(osx_get_active_interfaces())) > 0
> >               return True
> >           else:
> > !             return len(list(unix_get_active_interfaces())) > 0
> >       except Exception, e:
> >           logger.warn('Cannot get connection status: %s', e, exc_info=True)
> >           return False
> 
> Patch merged, thanks. Can you test the Git master branch if it works for you?

Still doesn't work as is in Slackware

Traceback (most recent call last):
  File "/home/timcowchip/gpodder/src/gpodder/util.py", line 1709, in
connection_available
    if len(list(unix_get_active_interfaces())) > 0:
  File "/home/timcowchip/gpodder/src/gpodder/util.py", line 1688, in
unix_get_active_interfaces
    stdout = subprocess.check_output(['ifconfig'])
  File "/usr/lib64/python2.7/subprocess.py", line 537, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib64/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
The FreeBSD patch has been implemented in the gPodder3.SlackBuild and works for
the current 3.4.0 release and should work for upcoming releases. 

I have to ask, what is the need for running gPodder offline? If it tries to
update and fails then just turn it off.

-- 
Configure bugmail: https://bugs.gpodder.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
_______________________________________________
gPodder-Bugs mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/gpodder-bugs

Reply via email to