| View previous topic :: View next topic |
| Author |
Message |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2176 Location: Germany
|
Posted: Mon Nov 27, 2006 8:37 pm Post subject: need gtktalog update path after ebuild removal [SOLVED] |
|
|
Hi all,
it seems that app-misc/gtktalog has been removed from the Portage tree recently, with a bug report which I don't understand, because I have gtktalog-1.0.3 emerged just fine without compile errors. I started using this software quite some time ago. All my CD / DVD are catalogized using this software (several hundred disks which amount to >1TB of data). Despite this huge size the program performs very well for me with no noticeable slowdowns. So the developers seem to have done something right here, even though it does not seem to be actively maintained anymore.
Anyway. Are there any alternatives I could use? I'm looking for something lightweight, that does not depend on a whole desktop environment (I have some programs that use GTK or QT, but not the whole Gnome or KDE libraries and environment). A console app would be fine as well. The main problem will be converting the gtktalog catalog into the new format, but since gtktalog can produce XML output it shouldn't be too hard to write a converter as long as the new app can import XML or a similar simple format.
Suggestions? What are you guys using for keeping track of all the CDs and DVDs you have?
Regards
frostschutz
Last edited by frostschutz on Sun Jan 27, 2008 2:03 am; edited 1 time in total |
|
| Back to top |
|
 |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2176 Location: Germany
|
Posted: Sun Jan 21, 2007 3:10 pm Post subject: |
|
|
Just in case anyone cares, the CVS version of gtktalog (which hasn't been updated for years as well) does somewhat work with GTK2. The program is usable although there are several things that do not work as well as in the old GTK1 version (usability issues, like you can't double-click on folders anymore, but have to select it in the tree on the left side).
I won't make an ebuild for this, as it probably wouldn't get accepted anyway, as the CVS development version just sucks way too much and is unmaintained. This is just if you like me were happy with the GTK1 gtktalog and don't want to lose your catalog. |
|
| Back to top |
|
 |
pjv Guru


Joined: 02 Jul 2003 Posts: 349 Location: Belgium
|
Posted: Fri Feb 09, 2007 10:15 pm Post subject: |
|
|
I am having the same issues/questions.
As I understand it, the devs were just removing gtk1 applications. Personally, I don't think that active maintenance of software should be the only criterium. Most of all, since this program was finished (I find this better than maintained) and gtk1 apps will keep on working on future gtk versions. The program still works today. If they want to disadvise people to start using it, why not just mask it or make a clear note in the ebuild's description. It all seems like a bit of wrong judgement to me, considering there is no clear alternative (or a way to migrate). |
|
| Back to top |
|
 |
pjv Guru


Joined: 02 Jul 2003 Posts: 349 Location: Belgium
|
Posted: Fri Feb 09, 2007 10:34 pm Post subject: |
|
|
One option is to add what used to be in portage to your local portage overlay. You can find the necessary resources at:
http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-misc/gtktalog/?hideattic=0
http://download.chinaunix.net/download/0005000/4269.shtml
Another option is to switch to the unstable (!!!) cdcollect.
I just wanted to add that it I find it a common misconception in the open source world that everything gets boring when a project is finished. The whole point of open source is exactly this, to work on a project to get a codebase that needs no further maintenance and can serve as a starting ground for any future project. The whole point is to finish software forever! |
|
| Back to top |
|
 |
pjv Guru


Joined: 02 Jul 2003 Posts: 349 Location: Belgium
|
Posted: Fri Feb 09, 2007 11:10 pm Post subject: |
|
|
| I didn't have a tarball lying around anymore and the one on the website didn't exist after all, so I changed to version 1.0.5_pre1 as on this website: http://chevdor.homelinux.com/gtktalog/ |
|
| Back to top |
|
 |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2176 Location: Germany
|
Posted: Sun Jan 27, 2008 2:11 am Post subject: |
|
|
Since the CVS version worked less and less reliable for me over time, I finally got over it, threw away my gtktalog catalog file and re-read all DVDs to build a new catalog from scratch.
And because none of the gtktalog alike softwares I tried could convince me, I just wrote my own little python script, that reads in the directory structure of a cd/dvd, and creates a tab separated file to show file name, size, md5sum, and file type. I create one such file for every DVD and put all files into a directory, and the result is a file system based catalog and I can just use any tool I like (for example grep) to search for a specific file.
Including a simple shell script wrapper it's less than 100 lines of code altogether and does everything I want.
EDIT:
In case anyone's interested in this simplistic approach. You'll note that the path to read from (/mnt/cdrom in my case) is hardcoded in two places: | Code: | #!/usr/bin/env python
import os, sys, getopt
import md5
import time
import subprocess
def md5sum(filepath):
"Calculate and return the md5 checksum for a file."
h = md5.new()
try:
f = open(filepath, "rb")
try:
s = f.read(1<<24)
while len(s):
h.update(s)
s = f.read(1<<24)
finally:
f.close()
except IOError:
print "Error reading file", filepath
return "IOError"
return h.hexdigest()
def filetype(filepath):
"Use the system tool 'file' to get a string that describes the type of a file."
output = subprocess.Popen(("file","-b", filepath), stdout=subprocess.PIPE)
output = output.stdout.read()
return output.strip().expandtabs(1)
def filesize(filepath):
"Return the size of a file as a human readable string."
_abbrevs = [ (1<<50L, 'P'),
(1<<40L, 'T'),
(1<<30L, 'G'),
(1<<20L, 'M'),
(1<<10L, 'k'),
(1, '') ]
size = os.path.getsize(filepath)
for factor, suffix in _abbrevs:
if size > factor:
break
return "%d%s" % (int(size/factor), suffix)
def filetime(filepath):
"Return the modification date of a file as a human readable string."
t = os.path.getmtime(filepath)
t = time.gmtime(t)
t = time.strftime("%Y-%m-%d %H:%M:%S", t)
return t;
def katalog_file(filepath):
"Return a line with all information about a file, separated by tabs."
filename = filepath.split("/", 3)[-1] # will work only for depth 3 base paths like /mnt/cdrom/filenamehere.
return "%s\t%s\t%s\t%s\t%s" % (filename, filesize(filepath), filetime(filepath), md5sum(filepath), filetype(filepath))
def dirwalk(dir):
"walk a directory tree, using a generator"
liste = os.listdir(dir)
liste.sort()
for f in liste:
fullpath = os.path.join(dir,f)
if os.path.isdir(fullpath) and not os.path.islink(fullpath):
for x in dirwalk(fullpath): # recurse into subdir
yield x
else:
yield fullpath
# lets go for a walk.
for x in dirwalk("/mnt/cdrom"):
print katalog_file(x) |
And wrap it in a shell script: | Code: | #!/bin/bash
i=$(ls 0* | tail -1 | sed -e s@^0*@@)
while [ 1 ];
do
i=$[$i+1]
cdrom_id=$(printf "%'0'5d" $i)
echo "Waiting for cdrom $cdrom_id. Press any key when ready."
read answer
sleep 15
mount /mnt/cdrom
./katalog_cdrom.py > $cdrom_id
umount /mnt/cdrom
eject /dev/hdd
done; |
Last edited by frostschutz on Sun Jan 27, 2008 12:21 pm; edited 1 time in total |
|
| Back to top |
|
 |
pjv Guru


Joined: 02 Jul 2003 Posts: 349 Location: Belgium
|
Posted: Sun Jan 27, 2008 10:14 am Post subject: |
|
|
| Congrats for making your own solution but if everyone needs to start these things just to make a catalog of DVDs, then where is the world going? I feel like we had a finished program, in which some programmer invested a lot of time, but that was "taken away" from us without a reason. People start over too easily. What about reusable code? It's not just gtkatalog, it's other things as well. Sorry for the rather pessimistic personal note. |
|
| Back to top |
|
 |
frostschutz Advocate


Joined: 22 Feb 2005 Posts: 2176 Location: Germany
|
Posted: Sun Jan 27, 2008 12:09 pm Post subject: |
|
|
Well, it's not like there aren't any solutions around. There are several. It's just that I didn't like any of them. Which is just me really and not a world problem.  |
|
| Back to top |
|
 |
|
|
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
|
|