Subject: [sup-talk] Removing sources (+ crash after trying)

From: [email-masked] (Eduardo Habkost)
Date: Wed, 5 Nov 2008 12:17:00 -0200

Hi,

While testing sup, sometimes I had typed incorrectly the path for sup-add,
and I've found any way to remove the sources I've added. Is there a way
to do that?

Risking doing something stupid, I simply removed the source from
~/.sup/sources.yaml, and now I am getting this when running sup-sync:

[Wed Nov 05 11:54:15 -0200 2008] saving index and sources...
/usr/lib/ruby/gems/1.8/gems/sup-999/lib/sup/label.rb:81:in `sort': undefined method `<=>' for :"kvm-devel":Symbol (NoMethodError)
        from /usr/lib/ruby/gems/1.8/gems/sup-999/lib/sup/label.rb:81:in `save'
        from /usr/lib/ruby/gems/1.8/gems/sup-999/lib/sup/label.rb:81:in `open'
        from /usr/lib/ruby/gems/1.8/gems/sup-999/lib/sup/label.rb:81:in `save'
        from /usr/lib/ruby/gems/1.8/gems/sup-999/lib/sup/util.rb:499:in `send'
        from /usr/lib/ruby/gems/1.8/gems/sup-999/lib/sup/util.rb:499:in `method_missing'
        from /usr/lib/ruby/gems/1.8/gems/sup-999/lib/sup.rb:131:in `finish'
        from /usr/lib/ruby/gems/1.8/gems/sup-999/bin/sup-sync:243
        from /usr/bin/sup-sync:19:in `load'
        from /usr/bin/sup-sync:19

I have little ruby experience, so I have no clue on what could be causing
that error. I am not even sure if the error was really caused by the
mess I did on sources.yaml.

I am running sup from mainline.git.

I've did the 'sup-dump;rm -rf ~/.sup/ferret;sup-sync' stuff mentioned
on the FAQ, but the problem persists.

My labels.txt file is empty (maybe because of the crash?). My sources.yaml
currently looks like this:

=========================================
--- 
- !masanjin.net,2006-10-01/Redwood/Maildir 
  uri: maildir:/home/ehabkost/mail/lkml-l/
  cur_offset: 12258932500006359
  usual: true
  archived: true
  id: 1
  labels: 
  - lkml
  mtimes: 
    cur: 2008-11-03 10:19:13 -02:00
    new: 2008-11-05 11:54:10 -02:00
- !masanjin.net,2006-10-01/Redwood/Maildir 
  uri: maildir:/home/ehabkost/mail/kvm-devel-l/
  cur_offset: 12258909480004381
  usual: true
  archived: true
  id: 2
  labels: 
  - kvm-devel
  mtimes: 
    cur: 2008-11-04 18:19:50 -02:00
    new: 2008-11-05 11:15:48 -02:00
- !masanjin.net,2006-10-01/Redwood/Maildir 
  uri: maildir:/home/ehabkost/mail/rh/memo-l/
  cur_offset: 12258930050005616
  usual: true
  archived: true
  id: 3
  labels: 
  - rh-memo
  mtimes: 
    cur: 2008-10-13 20:09:02 -03:00
    new: 2008-11-05 11:50:05 -02:00
- !masanjin.net,2006-10-01/Redwood/Maildir 
  uri: maildir:/home/ehabkost/mail/sup-talk-l/
  cur_offset: 12258880050004663
  usual: true
  archived: true
  id: 6
  labels: 
  - sup-talk
  mtimes: 
    cur: 2008-11-05 11:31:51 -02:00
    new: 2008-11-05 10:42:29 -02:00
- !masanjin.net,2006-10-01/Redwood/SentLoader 
  cur_offset: 919
- !masanjin.net,2006-10-01/Redwood/DraftLoader 
  cur_offset: 0
=====================

-- 
Eduardo

---

From: [email-masked] (William Morgan)
Date: Wed, 05 Nov 2008 10:34:13 -0800

Reformatted excerpts from Eduardo Habkost's message of 2008-11-05:
> While testing sup, sometimes I had typed incorrectly the path for
> sup-add, and I've found any way to remove the sources I've added. Is
> there a way to do that?

What you did is the best option so far: edit sources.yaml directly.

> /usr/lib/ruby/gems/1.8/gems/sup-999/lib/sup/label.rb:81:in `sort':
> undefined method `<=>' for :"kvm-devel":Symbol (NoMethodError)

Weird. I'm not sure what would've caused this, but I doubt it was the
removal of that source.

At any rate, I've pushed a "defensive programming" patch that should fix
this, so git pull and see if it works now.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Eduardo Habkost)
Date: Wed, 05 Nov 2008 16:54:50 -0200

> this, so git pull and see if it works now.

It worked. Thanks!

BTW, this is my first real e-mail message sent using sup.  8)
-- 
Eduardo

---

From: [email-masked] (William Morgan)
Date: Wed, 05 Nov 2008 12:49:07 -0800

> BTW, this is my first real e-mail message sent using sup.  8)

Congrats!