Update to catfish 0.4.0.1. Somewhat hackish, but can't be worse than the
previous unmaintained version. Now uses gtk3/py-gobject.
This commit is contained in:
parent
fb0d28343d
commit
b4e8c7e308
@ -1,14 +1,15 @@
|
||||
# $OpenBSD: Makefile,v 1.9 2012/06/15 08:32:18 ajacoutot Exp $
|
||||
# $OpenBSD: Makefile,v 1.10 2012/09/10 20:54:40 landry Exp $
|
||||
|
||||
COMMENT = versatile file searching tool
|
||||
|
||||
DISTNAME = catfish-0.3.2
|
||||
REVISION= 6
|
||||
DISTNAME = catfish-search-0.4.0.1
|
||||
PKGNAME = ${DISTNAME:S/-search//}
|
||||
CATEGORIES = textproc
|
||||
EXTRACT_SUFX = .tar.bz2
|
||||
|
||||
HOMEPAGE = http://www.twotoasts.de/index.php?/pages/catfish_summary.html
|
||||
|
||||
MAINTAINER = Landry Breuil <gaston@gcu.info>
|
||||
MAINTAINER = Landry Breuil <landry@openbsd.org>
|
||||
|
||||
# GPLv2
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
@ -16,13 +17,13 @@ PERMIT_PACKAGE_FTP= Yes
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
|
||||
MASTER_SITES = http://www.twotoasts.de/media/catfish/
|
||||
MASTER_SITES = https://launchpad.net/catfish-search/0.4/0.4.0.1/+download/
|
||||
|
||||
MODULES= lang/python
|
||||
CONFIGURE_STYLE=none
|
||||
USE_GMAKE= Yes
|
||||
|
||||
RUN_DEPENDS = x11/py-gtk2 \
|
||||
RUN_DEPENDS = devel/py-gobject3 \
|
||||
x11/dbus-python \
|
||||
devel/desktop-file-utils \
|
||||
devel/py-xdg \
|
||||
|
@ -1,5 +1,2 @@
|
||||
MD5 (catfish-0.3.2.tar.gz) = so2zVQlL++feCXZ46RzicQ==
|
||||
RMD160 (catfish-0.3.2.tar.gz) = XyYZWnhFbmnZiFI5Bf3zrr4G94I=
|
||||
SHA1 (catfish-0.3.2.tar.gz) = Jok7xPxZR+GSiaDYLiFMA1ypOTY=
|
||||
SHA256 (catfish-0.3.2.tar.gz) = FSZrGWG6ZFUrlpxMhHUskx/SlBL+FCg1y8Pd5jhViPQ=
|
||||
SIZE (catfish-0.3.2.tar.gz) = 35702
|
||||
SHA256 (catfish-search-0.4.0.1.tar.bz2) = hsB1thEeCANLLe4fPHf+43Z2z3Z2xIA7JY/4P7M8Cvo=
|
||||
SIZE (catfish-search-0.4.0.1.tar.bz2) = 41257
|
||||
|
@ -1,47 +1,93 @@
|
||||
$OpenBSD: patch-catfish_py,v 1.1.1.1 2009/06/04 02:03:39 landry Exp $
|
||||
$OpenBSD: patch-catfish_py,v 1.2 2012/09/10 20:54:40 landry Exp $
|
||||
- strip heading spaces
|
||||
- expand ~ to /home/user as default search path
|
||||
- fix find/locate args
|
||||
- add a hack for non-iso chars to be converted to utf before being
|
||||
passed to gtk
|
||||
--- catfish.py.orig Thu Oct 23 18:35:21 2008
|
||||
+++ catfish.py Wed Jun 3 20:00:14 2009
|
||||
@@ -183,7 +183,7 @@ class catfish:
|
||||
--- catfish.py.orig Wed Aug 22 15:49:53 2012
|
||||
+++ catfish.py Mon Sep 10 22:37:13 2012
|
||||
@@ -36,13 +36,6 @@ try:
|
||||
except ImportError, msg:
|
||||
print 'Warning: The optional module %s is missing.' % str(msg).split()[-1]
|
||||
|
||||
-try:
|
||||
- from zeitgeist.client import ZeitgeistDBusInterface
|
||||
- from zeitgeist.datamodel import Event, TimeRange
|
||||
- from zeitgeist import datamodel
|
||||
- iface = ZeitgeistDBusInterface()
|
||||
-except ImportError, msg:
|
||||
- print 'Warning: The optional module %s is missing.' % str(msg).split()[-1]
|
||||
|
||||
app_name = 'catfish'
|
||||
app_version = '0.4.0.1'
|
||||
@@ -282,7 +275,7 @@ class suggestions(list):
|
||||
"""Perform a query using locate.
|
||||
|
||||
Return the number of found results."""
|
||||
- query = "locate -i %s --existing -n 20" % os.path.join(folder, "*%s*" % keywords)
|
||||
+ query = "locate -i %s -l 20" % os.path.join(folder, "*%s*" % keywords)
|
||||
self.process = subprocess.Popen(query, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
result_count = 0
|
||||
for filepath in self.process.communicate()[0].split('\n'):
|
||||
@@ -304,7 +297,6 @@ class suggestions(list):
|
||||
if len(keywords) > 1:
|
||||
self.clear()
|
||||
result_count = 0
|
||||
- result_count += self.zeitgeist_query(keywords, folder)
|
||||
result_count += self.locate_query(keywords, folder)
|
||||
return result_count
|
||||
else:
|
||||
@@ -398,7 +390,7 @@ class shell_query:
|
||||
, file_manual, path_manual, exact_manual, errors_ignore, use_regex
|
||||
) = self.options
|
||||
if 'locate' in binary and '*' not in keywords:
|
||||
- command = default % binary + ' --regex'
|
||||
+ command = default % binary
|
||||
else:
|
||||
command = default % binary
|
||||
if exact:
|
||||
@@ -415,6 +407,7 @@ class shell_query:
|
||||
command += ' "*%s*"' % keywords
|
||||
else:
|
||||
command += ' "%s"' % keywords
|
||||
+ print command
|
||||
self.process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||
return self.process.stdout
|
||||
def status(self): return self.err or self.process.poll()
|
||||
@@ -456,7 +449,7 @@ class catfish:
|
||||
parser.add_option('', '--debug', action='store_true'
|
||||
, help='Show debugging messages.')
|
||||
parser.set_defaults(icons_large=0, thumbnails=0, time_iso=0, method='find'
|
||||
- , limit_results=0, path='~', fileman=default_fileman, exact=0
|
||||
+ , limit_results=0, path=os.path.expanduser('~'), fileman=default_fileman, exact=0
|
||||
- , limit_results=0, path='~', fileman=self.open_wrapper, exact=0
|
||||
+ , limit_results=0, path=os.path.expanduser('~'), fileman=self.open_wrapper, exact=0
|
||||
, hidden=0, fulltext=0, file_action='open', debug=0, open_wrapper=self.open_wrapper)
|
||||
self.options, args = parser.parse_args()
|
||||
keywords = ' '.join(args)
|
||||
@@ -510,9 +510,9 @@ class catfish:
|
||||
@@ -474,7 +467,6 @@ class catfish:
|
||||
# Prepare i18n using gettext
|
||||
try:
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
- locale.bindtextdomain(app_name, 'locale')
|
||||
gettext.bindtextdomain(app_name, 'locale')
|
||||
gettext.textdomain(app_name)
|
||||
except Exception, msg:
|
||||
@@ -871,8 +863,8 @@ class catfish:
|
||||
folder = os.path.expanduser(folder)
|
||||
method_name = [method, 'locate'][method=='slocate']
|
||||
methods = {
|
||||
- 'find': (method, '', '%s "' + folder + '" -ignore_readdir_race -noleaf',
|
||||
- '-wholename', '-iwholename', '', 1, 1, 0, 0, 0),
|
||||
- 'locate': (method, '', '%s', '', '-i', '-n %i' % limit,
|
||||
- '-wholename', '-iwholename', '', 1, 1, 0, 0, 0, 0),
|
||||
+ 'find': (method, '', '%s "' + folder + '"',
|
||||
+ '-name', '-iname', '', 1, 1, 0, 0, 0),
|
||||
+ 'locate': (method, '', '%s', '', '-i', '-l %i' % limit,
|
||||
1, 0, 1, 0, 0),
|
||||
+ '-name', '-iname', '', 1, 1, 0, 0, 0, 0),
|
||||
'locate': (method, '', '%s', '', '-i', '',
|
||||
1, 0, 1, 0, 0, 1),
|
||||
'tracker': ('tracker-search', 'trackerd', '%s', '', '', '-l %i' % limit,
|
||||
0, 0, 1, 1, 0),
|
||||
@@ -631,6 +631,7 @@ class catfish:
|
||||
for filename in query.run(keywords, folder, exact, hidden, limit):
|
||||
if self.abort_find or len(listmodel) == limit: break
|
||||
filename = filename.split(os.linesep)[0]
|
||||
+ filename.strip()
|
||||
# Convert uris to filenames
|
||||
if filename[:7] == 'file://':
|
||||
filename = filename[7:]
|
||||
@@ -639,6 +640,8 @@ class catfish:
|
||||
filename = filename[10:]
|
||||
filename = filename[:filename.index('?')]
|
||||
path, name = os.path.split(filename)
|
||||
+ name = name.decode('iso-8859-1').encode('utf-8')
|
||||
+ path = path.decode('iso-8859-1').encode('utf-8')
|
||||
if (path_manual or exact_manual) and not fulltext:
|
||||
if not self.string_wild_match(name, keywords, exact):
|
||||
yield True
|
||||
@@ -1349,7 +1341,7 @@ class catfish:
|
||||
self.updatedb_in_progress = True
|
||||
self.updatedb_button_cancel.set_sensitive(False)
|
||||
self.updatedb_button_ok.set_sensitive(False)
|
||||
- self.updatedb_process = subprocess.Popen(['gksudo', 'updatedb'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
|
||||
+ self.updatedb_process = subprocess.Popen(['sudo', '/usr/libexec/locate.updatedb'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
|
||||
GObject.timeout_add(1000, updatedb_subprocess)
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST,v 1.4 2012/06/15 08:32:18 ajacoutot Exp $
|
||||
@comment $OpenBSD: PLIST,v 1.5 2012/09/10 20:54:40 landry Exp $
|
||||
bin/catfish
|
||||
share/applications/catfish.desktop
|
||||
share/catfish/
|
||||
@ -13,18 +13,13 @@ share/doc/catfish/ChangeLog
|
||||
share/doc/catfish/INSTALL
|
||||
share/doc/catfish/README
|
||||
share/icons/hicolor/scalable/apps/catfish.svg
|
||||
share/locale/ca/LC_MESSAGES/catfish.mo
|
||||
share/locale/be/LC_MESSAGES/catfish.mo
|
||||
share/locale/cs/LC_MESSAGES/catfish.mo
|
||||
share/locale/da/LC_MESSAGES/catfish.mo
|
||||
share/locale/de/LC_MESSAGES/catfish.mo
|
||||
share/locale/es/LC_MESSAGES/catfish.mo
|
||||
share/locale/fi/LC_MESSAGES/catfish.mo
|
||||
share/locale/fr/LC_MESSAGES/catfish.mo
|
||||
share/locale/it/LC_MESSAGES/catfish.mo
|
||||
share/locale/pl/LC_MESSAGES/catfish.mo
|
||||
share/locale/ru/LC_MESSAGES/catfish.mo
|
||||
share/locale/sv/LC_MESSAGES/catfish.mo
|
||||
share/locale/zh_CN/LC_MESSAGES/catfish.mo
|
||||
@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/hicolor
|
||||
@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/hicolor
|
||||
@exec %D/bin/update-desktop-database
|
||||
|
Loading…
Reference in New Issue
Block a user