Download packages from a repository over HTTP

wpkg
2014-06-16
2014-06-26
  • Trent Clarke
    Trent Clarke
    2014-06-16

    Hi again,

    I'm trying to set up a repository with our packages that sits on a web site somewhere. Unfortunately I can't seem to make it work; I assume I'm missing something blindingly obvious, and was hoping you could give me a shove in the right direction.

    Here's the basic setup:

    1) I have a collection of deb files built with wpkg, and an index file also generated with wpkg, living on a web site.

    2) I have a local directory that contains a wpkg dir, control file and some other arbitrary content. The control file specifies a dependency on one of the packages from the web repo.

    3) I have a build script that creates the core environment, adds the web site repo as a source and does a wpkg --update.

    Essentially, I just want the bootstrap script to be able to do a --build-and-install of the local directory and have wpkg download & install the dependencies from the web site.

    Using the above setup, wpkg is telling me that it can't find any implicit or explicit packages that satisfy the dependencies in my local package. I'm reasonably sure that the dependency is there, and when I download the package file from the web site and use it locally with the --repository option the dependency is satisfied. Specifying the remote repo with the --repository option fails with "not a direct filename".

    Any pointers as to what I'm doing wrong? Or am I trying to do something that wpkg just simply doesn't support? And apologies if I've just missed something (probably written in big letters) in the documentation.

    thanks & regards,

    Trent

     
  • Trent Clarke
    Trent Clarke
    2014-06-17

    OK, after a bit of hacking I've found the bit that's causing me trouble. The repository validation code attempts to stat the repository, assuming it's local directory. This of course explodes when presented with an HTTP uri.

    I've essentially commented this check out on my local machine and everything is working as I'd expect. I'm happy to tidy it up so it only does the stat on direct files and submit a patch or pullreq for your consideration.

    cheers,

    Trent

     
  • Alexis Wilke
    Alexis Wilke
    2014-06-17

    Ah! Strange because it seemed to have been working for me before. My HTTP URIs should have failed too. Hmmm... Proof that having tests that continue to work is the best way to avoid such problems.

    I uploaded the code now, so you should be able to generate a patch using git.

    https://sourceforge.net/p/unigw/master/ci/master/tree/

    Thank you!
    Alexis

     
  • Trent Clarke
    Trent Clarke
    2014-06-19

    Hi Alexis,

    Here are the patches I mentioned.

    disable_stat_for_non_direct_files.patch does pretty much what it says on the tin, and fixed the specific issue I described above.

    address_of_temporary.patch fixes a small bug in wpkg --upgrade_info [--verbose], where you were caching result of stding::c_str() from a temporary string. By the time that the code actually read from that pointer the temporary was gone, and and ended up printing some pretty funky package names for me.

    Hope you find them useful.

    Regards,

    Trent

     
  • Alexis Wilke
    Alexis Wilke
    2014-06-19

    The git was updated and I also put 0.9.3 for download. Thank you for the patches!

     
  • Trent Clarke
    Trent Clarke
    2014-06-26

    No worries. Happy to help.