summaryrefslogtreecommitdiffstats
path: root/libopkg/opkg_download.c
Commit message (Collapse)AuthorAgeFilesLines
* opkg_prepare_url_for_install: Handle force_reinstall as upgradePaul Barker2014-02-231-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | The best way to handle force_reinstall is to make the reinstall look like an upgrade - because we already have a good package upgrade path. With the new per package force_reinstall flag this is now possible. In opkg_prepare_url_for_install, we set the per-package force_reinstall flag for the given package. As this function is only called for packages explicitly specified as arguments to 'opkg install' or 'opkg_install_package', the flag will only be applied to the indended packages. If a package name is given which exists in a package feed then we need to cheat a little. We lookup the package in the feed and get its local filename and then act as if that path were given as a URL. This function is the best place to handle the force_reinstall flag as it is responsible for setting the package hash table up so that pkg_hash_fetch_best_installation_candidate_by_name() returns the intended pacakge. The old logic in opkg_install_cmd which calls opkg_remove_cmd to remove the previously installed package is no longer needed and is removed. This solves issue #71 without causing a regression on issue #51. Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
* opkg_download: Drop config check from headerPaul Barker2013-12-171-1/+3
| | | | | | | | | | The function 'opkg_curl_cleanup' is unconditionally defined in the header and is implemented as an empty stub in the source file if curl is not enabled. This allows us to present a consistent API regardless of the configure options used to build opkg. Signed-off-by: Paul Barker <paul@paulbarker.me.uk> Cc: Carsten Schoenert <c.schoenert@gmail.com>
* Don't use conf->offline_root directly, it might be NULL.graham.gower@gmail.com2011-09-111-1/+1
| | | | | | | | | | This patch fixes a problem that arises when conf->offline_root is null. The resulting string was "(null)//etc/opkg/trusted.gpg" when it should have been "/etc/opkg/trusted.gpg". From Kyle Manna <kyle.manna@gmail.com>. git-svn-id: http://opkg.googlecode.com/svn/trunk@626 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix compilation after r617google@wwsnet.net2011-04-081-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@618 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Don't include the source URI in the cached filename.graham.gower@gmail.com2011-04-081-4/+17
| | | | | | | | | | This avoids multiple downloads in the case where a repository is simply a mirror of another. The old, uri mangled, filename is still checked to ensure backwards compatibility with existing caches. Patch from robert.melchers@gmail.com. git-svn-id: http://opkg.googlecode.com/svn/trunk@617 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Add flag in opkg_download calls to reduce the severity of the 'failed ↵javiplx@gmail.com2011-04-071-5/+5
| | | | | | download' message git-svn-id: http://opkg.googlecode.com/svn/trunk@610 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Call gpgme_check_version() before using other gpgpe functions.graham.gower@gmail.com2011-02-131-0/+2
| | | | | | | | | | | The function initializes some sub-systems, and for this reason alone it must be invoked early in your program, before you make use of the other functions in GPGME. see http://pyme.sourceforge.net/doc/gpgme/Library-Version-Check.html Patch from Bernhard Guillon. git-svn-id: http://opkg.googlecode.com/svn/trunk@602 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* This is not a bug any longer.graham.gower@gmail.com2010-11-151-1/+1
| | | | | | It was fixed long ago, as is clear by the code in question. git-svn-id: http://opkg.googlecode.com/svn/trunk@578 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* fix compile issues on OS X and FreeBSDgoogle@wwsnet.net2010-09-121-0/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@560 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove trailing whitespace. Sorry if this breaks your patches.graham.gower2010-08-171-7/+7
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@552 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fail if cache_dir is specified and not a directorypixdamix2010-01-111-0/+7
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@514 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Return negative error code from opkg_download(), not curl error codes.graham.gower2009-12-211-2/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@509 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Initial stab at untangling the #include maze. Probably needs a second pass.graham.gower2009-12-201-1/+4
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@504 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix what I broke in r468.graham.gower2009-12-141-2/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@492 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Don't need \n for perrors.graham.gower2009-12-141-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@491 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Merge commit 'grg' into HEADgraham.gower2009-12-081-70/+69
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@471 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* patch for opkg_download.c compile abortpixdamix2009-12-011-10/+10
| | | | | | | | Fix problem wich may lead to FALSE and TRUE being redefined. Thanks to John L. for reporting this problem git-svn-id: http://opkg.googlecode.com/svn/trunk@413 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix some errno abuse.graham.gower2009-11-261-9/+4
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@393 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Provide error checking for users of pkg_extract_* functions.graham.gower2009-11-261-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@391 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove str_util.{c,h}graham.gower2009-11-251-1/+6
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@383 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Allow to install a package from a read-only dirpixdamix2009-11-231-2/+2
| | | | | | | | This patch allows to install a package which is located on a readonly filesystem or folder by moving the control file into the tmp_dir directory git-svn-id: http://opkg.googlecode.com/svn/trunk@351 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Use vfork()/execvp() instead of system().graham.gower2009-11-161-10/+15
| | | | | | Parts based on a patch by Mike Westerhof for OpenEmbedded. git-svn-id: http://opkg.googlecode.com/svn/trunk@320 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* atexit() isn't really appropriate for a library.graham.gower2009-11-151-8/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@313 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix a subtle leak.graham.gower2009-11-151-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@309 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove local variable which was masking a static one.graham.gower2009-11-121-1/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@298 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* More dead code removal.graham.gower2009-11-051-2/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@271 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove more unused code.graham.gower2009-11-051-4/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@269 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Some refactoring of pathfinder supportpixdamix2009-11-051-10/+12
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@263 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Add pathfinder support for certificate validationpixdamix2009-11-051-0/+22
| | | | | | | | | | | | | | | | | | From http://code.google.com/p/pathfinder-pki/ PathFinder is designed to provide a mechanism for any program to perform RFC3280-compliant path validation of X509 certificates, even when some of the intermediate certificates are not present on the local machine. By design, Pathfinder automatically downloads any such certificates from the Internet as needed using the AIA and CRL distribution point extensions of the certificates it is processing. It has the ability to do revocation status checking either using CRL or OCSP, or both. And, given the recent vulnerabilities that have rendered the MD5 algorithm highly suspect, it allows the administrator to choose to not validate certificates using that algorithm anywhere in the trust path. git-svn-id: http://opkg.googlecode.com/svn/trunk@261 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* s/strdup/xstrdup/ - check memory allocations for failure.graham.gower2009-11-031-4/+5
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@255 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove unused opkg_set_current_state bits.graham.gower2009-11-031-7/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@252 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Make `curl' an instance variable and ssl supportpixdamix2009-11-031-30/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds several new options - option ssl_ca_path /path/to/dir Tells curl to use the specified certificate directory to verify the peer. The certificates must be in PEM format, and the directory must have been processed using the c_rehash utility supplied with openssl. - option ssl_ca_file Tells curl to use the specified certificate file to verify the peer. The file may contain multiple CA certificates - option ssl_key_type Tells curl the Private key file type. Specify which type your ssl_key provided private key is. PEM (default), DER and ENG (see option ssl_engine) are recognized types. - option ssl_cert_type Tells curl what certificate type the provided certificate is in. PEM (default), DER and ENG (see option ssl_engine) are recognized types. - option ssl_key & option ssl_cert Tells curl to use the specified certificate file and private key when getting a file with HTTPS - option ssl_key_passwd Passphrase for the private key - option ssl_engine Select the OpenSSL crypto engine to use for cipher operations. - option ssl_dont_verify_peer This option explicitly allows curl to perform "insecure" SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate. This makes all connections considered "insecure" fail unless ssl_dont_verify_peer is used. git-svn-id: http://opkg.googlecode.com/svn/trunk@251 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* pkg_init_from_file() already does this strdup(), so stop another leak.graham.gower2009-11-011-2/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@235 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Removed a unused variable warningpixdamix2009-10-281-0/+4
| | | | | | | When compiled without openssl nor gpg signature verification opkg build fail due to 3 unused variable and -Werror git-svn-id: http://opkg.googlecode.com/svn/trunk@226 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Opkg support for smime (pkcs7) packages list signingticktock352009-10-271-2/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thanks to Camille Moncelier <moncelier@devlife.org> http://groups.google.com/group/opkg-devel/browse_thread/thread/6071ce290d5ceb77?utoken=qjR-TC0AAADKDldt5ZXsDDLs9sWCpWZI1zgeariQUwksg5ob1tmaFTCAL7MTcQRO6S85GfHgQ_k As promised :) here is a patch allowing opkg to authenticate a package list using smime and openssl instead of gpgme Example: Sign a package list: openssl smime -sign -in /path/to/repo/Packages \ -signer /root/server.pem -binary \ -outform PEM -out /path/to/repo/Packages.sig Configuration in /etc/opkg/opkg.conf option check_signature 1 option signature_ca_file /etc/serverCA.pem option signature_ca_path /path/to/certs/dir opkg update Downloading http://repo:8000/Packages Updated list of available packages in /usr/lib/opkg/lists/angstrom Downloading http://repo:8000/Packages.sig Signature check passed Package list corruption or MIM: Downloading http://repo:8000/Packages Updated list of available packages in /usr/lib/opkg/lists/angstrom Downloading http://repo:8000/Packages.sig Signature check failed Collected errors: * Verification failure Camille Moncelier http://devlife.org/ git-svn-id: http://opkg.googlecode.com/svn/trunk@221 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix Segmentation fault while data in Package.gz is not goodticktock352009-09-221-0/+4
| | | | | | | | | | | | While setting up a personal opkg feed, I encountered a crash in opgk when trying to install the package from the repository. Instead of an error message from opkg, it just gave me "Segmentation fault" and exited. Thanks to EdorFaus <edorfaus@gmail.com> http://groups.google.com/group/opkg-devel/browse_thread/thread/9620711475fa98d2 git-svn-id: http://opkg.googlecode.com/svn/trunk@218 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Thanks to Keon's notify.ticktock352009-03-261-1/+1
| | | | | | converting curl error code to readable message git-svn-id: http://opkg.googlecode.com/svn/trunk@209 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* adding check_signature configticktock352008-12-281-0/+2
| | | | | | | | | default if off you can turn that on via adding one line in /etc/opkg/opkg.conf file + option check_signature 1 git-svn-id: http://opkg.googlecode.com/svn/trunk@193 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* adding --enable-curl configuation to configure.acticktock352008-12-271-0/+24
| | | | | | | | | | | Basically it apply opkg_wget.patch from OE but I add something to the configure.ac http://cgit.openembedded.net/cgit.cgi?url=openembedded/tree/packages/opkg/files/opkg_wget.patch&id=1bbdc74a5384c81d0bdeb96f6acdfef91430d35d Thanks Mike Westerhof <mwester@dls.net> git-svn-id: http://opkg.googlecode.com/svn/trunk@191 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* when configure with --disable-gpg, no message complain about the signature ↵ticktock352008-12-261-1/+0
| | | | | | stuff. git-svn-id: http://opkg.googlecode.com/svn/trunk@189 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: only cache the packagesticktock352008-12-151-5/+5
| | | | | | | | thanks Werner. git-svn-id: http://opkg.googlecode.com/svn/trunk@156 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: adding cache supportticktock352008-12-151-1/+39
| | | | | | | | | | opkg-cl --cache <cache_directory> Thank for Werner git-svn-id: http://opkg.googlecode.com/svn/trunk@154 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Patch from rwhitby to follow 302 redirects properly.ticktock352008-12-151-0/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@149 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: make .opk as the default opkg file extensionticktock352008-12-151-1/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@141 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: Fix a small memory leak in opkg_download.ticktock352008-12-151-0/+2
| | | | | | | | Patch from Alexandros Kostopoulos <akostop@inaccessnetworks.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@133 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: (leak fixing, day 2) lots and lots of memory leaks fixedticktock352008-12-151-1/+8
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@115 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: * Add opkg-key utilityticktock352008-12-151-3/+25
| | | | | | | | | * Move update-alternatives to utils directory * Update opkg_verify_file function to import keys from /etc/opkg git-svn-id: http://opkg.googlecode.com/svn/trunk@106 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: add some extra error checks to opkg_verify_file()ticktock352008-12-151-0/+4
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@96 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: improve download callback handling and integrate into ↵ticktock352008-12-151-33/+9
| | | | | | opkg_update_package_lists git-svn-id: http://opkg.googlecode.com/svn/trunk@86 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg: remove unused variableticktock352008-12-151-1/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@82 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358