Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

need gtktalog update path after ebuild removal [SOLVED]

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
frostschutz
Advocate
Advocate
User avatar
Posts: 2978
Joined: Tue Feb 22, 2005 11:23 am
Location: Germany

need gtktalog update path after ebuild removal [SOLVED]

  • Quote

Post by frostschutz » Mon Nov 27, 2006 8:37 pm

Hi all,

it seems that app-misc/gtktalog has been removed from the Portage tree recently, with a [bug=155000]bug report[/bug] 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.
Top
frostschutz
Advocate
Advocate
User avatar
Posts: 2978
Joined: Tue Feb 22, 2005 11:23 am
Location: Germany

  • Quote

Post by frostschutz » Sun Jan 21, 2007 3:10 pm

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.
Top
pjv
Guru
Guru
User avatar
Posts: 353
Joined: Wed Jul 02, 2003 12:51 pm
Location: Belgium

  • Quote

Post by pjv » Fri Feb 09, 2007 10:15 pm

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).
Top
pjv
Guru
Guru
User avatar
Posts: 353
Joined: Wed Jul 02, 2003 12:51 pm
Location: Belgium

  • Quote

Post by pjv » Fri Feb 09, 2007 10:34 pm

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/ge ... ideattic=0
http://download.chinaunix.net/download/ ... 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!
Top
pjv
Guru
Guru
User avatar
Posts: 353
Joined: Wed Jul 02, 2003 12:51 pm
Location: Belgium

  • Quote

Post by pjv » Fri Feb 09, 2007 11:10 pm

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/
Top
frostschutz
Advocate
Advocate
User avatar
Posts: 2978
Joined: Tue Feb 22, 2005 11:23 am
Location: Germany

  • Quote

Post by frostschutz » Sun Jan 27, 2008 2:11 am

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: Select all

#!/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: Select all

#!/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.
Top
pjv
Guru
Guru
User avatar
Posts: 353
Joined: Wed Jul 02, 2003 12:51 pm
Location: Belgium

  • Quote

Post by pjv » Sun Jan 27, 2008 10:14 am

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.
Top
frostschutz
Advocate
Advocate
User avatar
Posts: 2978
Joined: Tue Feb 22, 2005 11:23 am
Location: Germany

  • Quote

Post by frostschutz » Sun Jan 27, 2008 12:09 pm

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. :lol:
Top
Post Reply

8 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic