You are not logged in.

#1 2011-05-12 13:26:24

Yaro
Member
Registered: 2009-04-03
Posts: 154

Further alpm confusion: Syncing databases not working.

I am having further troubles with alpm. I am able to register and assign URLs to databases, but when the time comes to update the databases... well...

First look at my code.

  if ( alpm_trans_init ( ( pmtransflag_t ) 0, NULL, NULL, NULL ) == 0 ) {
    alpm_list_t* syncs = alpm_option_get_syncdbs();

    for ( alpm_list_t* i = syncs; i; i = alpm_list_next ( i ) ) {
      pmdb_t* db = ( pmdb_t* ) alpm_list_getdata ( i );
      updateResult = alpm_db_update ( 1, db );

      if ( updateResult < 0 ) {
        std::cout << "Error " << pm_errno << ": " << alpm_strerror ( pm_errno ) << std::endl;
      }
    }

    alpm_trans_release();
  }

First thing it does is lock the databases in my sandbox down, as a good package manager should, get the syncdbs (I plan to change this to use my QVector that has the repository information from pullstring.conf in it. Then, for every database registered, it gets data from the registered db, then I do a force update (I plan to change this once this code is working.) If it doesn't work, then I output an error. (I know, that should be cerr, not cout.) And of course, it releases the lock on the DBs in my sandbox.

I have yet to run this bit of code without my error code firing off:

Error 46: Not Found

This is DESPITE the fact the DBs ARE where the program tells alpm to look. I can open a file manager and look at the specified db-root and see the sync folder pacman created there when I explicitly told it to create the DBs in that db-path. And yes, inside the sync folders are the databases themselves.

So, I have to ask, why is a routine based closely to a sample routine given in ALPM's documentation not working? Why is it that alpm can't see databases in a place where databases actually exist?

Offline

#2 2011-05-12 14:59:08

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Further alpm confusion: Syncing databases not working.

So if you're convinced that you've initialized alpm correctly, run strace and figure out where alpm gets its ENOENT from.

You really should change your tone when asking for help. This thread and your last, as well as your attitude in IRC all reek of pointed (but rather unfounded) accusations. This tiny little segment of code only demonstrates where the error happens. It isn't necessarily the same the location that causes the error.

Offline

#3 2011-05-12 15:26:15

Yaro
Member
Registered: 2009-04-03
Posts: 154

Re: Further alpm confusion: Syncing databases not working.

strace is producing a LOT of stuff I can't seem to filter with grep. How do I get it to scale back and give me the information I need?

I'm sorry, but the people in IRC were being jerks to me before I even asked my question. We had one guy taking bets on whether I was out of date/using something in the AUR. I also told them several times I was up-to-date. They ignored me. Likely because they wanted to be smug. They were going on and on about me using yaourt despite it not having anything to do with my problem. All they wanted to do was make it look like I was an incompetent who broke my system. So I think I was justified, don't you?

What's more is they didn't even solve my problem. I did that myself after getting a flood of some helpfulness mixed with mostly outright hostility/unhelpfulness.

I can tell you it was because of *their* attitude I won't be going back onto #archlinux.

If you want me to have a better attitude on IRC, then quit trying to be assholes to the people you help and they might not take such a tone.

Offline

#4 2011-05-12 15:38:35

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Further alpm confusion: Syncing databases not working.

This is basic debugging you could be doing on your own... If you don't feel like walking through the output of strace, then compile alpm with debug symbols, do the same for your code, jump into gdb. set a breakpoint on alpm_db_update, step through it until it hits the error and returns. No one can help you if you can't help yourself.

Offline

#5 2011-05-12 15:44:30

Yaro
Member
Registered: 2009-04-03
Posts: 154

Re: Further alpm confusion: Syncing databases not working.

I'll do both. Though I do have alpm with debug symbols but can't seem to get my ide to step through alpm (It uses gdb). I can do the rest, though. I hope.

Thank you.

Last edited by Yaro (2011-05-12 15:44:55)

Offline

#6 2011-05-12 15:59:26

Yaro
Member
Registered: 2009-04-03
Posts: 154

Re: Further alpm confusion: Syncing databases not working.

Okay, I found this: stat("/home/yaro/Temp/sandbox/sync/core.db.part", 0x7fffe55ef4a0) = -1 ENOENT (No such file or directory)

Repeat a few times for each sync db. This raises a question. Why are we looking for a .part file and not the db? Perhaps I am missing a step here?

I am still going through my strace, but that sure seems relevant, don't you think?

Offline

#7 2011-05-12 16:30:25

Yaro
Member
Registered: 2009-04-03
Posts: 154

Re: Further alpm confusion: Syncing databases not working.

Aaaand fixed. Turns out I didn't have my program handlign $arch or $repo tags. I thought alpm did that when I forked over the URL. Forgive me.

Offline

#8 2011-05-13 01:15:46

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,362

Re: Further alpm confusion: Syncing databases not working.

Please mark [solved]. Also, IRC is typically like a water cooler, you're going to get all sorts there, so you need to be thick-skinned going in (or just lurk for a while to get a 'feel' for things). Human nature, I'm afraid (and non-specific to Arch).


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB