summaryrefslogtreecommitdiffstats
path: root/libopkg
Commit message (Collapse)AuthorAgeFilesLines
* detect circular dependenciespixdamix@gmail.com2012-11-225-2/+13
| | | | | | | | | | | Add logic to detect circular dependencies. If we see any dependency from any given parent twice, ignore it the second time and print a notice message that we did so. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@641 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Do not read /etc/opkg/*.conf if -f is specifiedpixdamix@gmail.com2012-11-221-27/+28
| | | | | | | | | | | If a configuration file is specified on the command line, we should assume it contains all of the configuration and not try to read the configuration in /etc/opkg. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@640 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Failed postinst script is not fatal with conf->offline_rootpixdamix@gmail.com2012-11-223-4/+9
| | | | | | | | | | | | When we have an offline root and have specified force-postinstall, attempt to run the postinstall but if it fails, just leave it in the status file as needing to run. We can issue a NOTICE this is happened but supress errors. This means the OE class doesn't have to do any further post processing of the postinstalls itself. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@639 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix dependency issues for preinst scriptspixdamix@gmail.com2012-11-223-0/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a problem with dependency order when installing packages. The key problem revolves around the satisfy_dependencies_for() function which is called from opkg_install_pkg just before the installation (and preinst) happens. The satisfy_dependencies_for() function calls pkg_hash_fetch_unsatisfied_dependencies() which will only return packages which were previously not marked as *going* to be installed at some point. For the purposes of opkg_install_pkg() we really need to know which dependencies haven't been installed yet. This patch adds pkg_hash_fetch_satisfied_dependencies() which returns a list of package dependencies. We can then directly check the status of these and ensure any hard dependencies (not suggestions or recommendations) are installed before returning. Consider the situation (where -> means 'depends on'): X -> A,E A -> B,E E -> B B -> C Currently X would install A and E. When installing A the packages B, E and C would be marked as "to install". When the package B is considered the second time (as a dependency of E rather than A), it would install straight away even though C was not currently installed, just marked as needing to be installed. The patch changes the behaviour so B can't install until C really is installed. This change is required to run the postinst scripts in the correct order. Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@638 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* add opkg_compare_versions functionpixdamix@gmail.com2012-11-222-0/+16
| | | | | | | | | * not used in opkg but can be usefull, e.g. instead of opkg-utils/opkg-compare-versions.c Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@636 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fixed opkg losing auto_installed flag on upgradingpixdamix@gmail.com2012-01-191-0/+3
| | | | | | Thanks-to: Christian Hitz <christian.hitz@aizo.com> git-svn-id: http://opkg.googlecode.com/svn/trunk@635 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix a possible double-free of pkg vectors in opkg_remove_dependent_pkgs(), ↵google@wwsnet.net2011-10-141-3/+1
| | | | | | remove the inner free as it another free occurs anyway immediately after leaving the loop git-svn-id: http://opkg.googlecode.com/svn/trunk@630 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Reverse the test for __dummy__ in the extra data.graham.gower@gmail.com2011-10-121-1/+1
| | | | | | Problem pointed out by akostopou@gmail.com. This needs revisiting. git-svn-id: http://opkg.googlecode.com/svn/trunk@629 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove comment for a proposed feature that will never be implemented.graham.gower@gmail.com2011-10-121-2/+0
| | | | | | | Maintainer scripts cannot be run in a chroot unless the host system can run target system binaries. Given this, the feature would be of limited use. git-svn-id: http://opkg.googlecode.com/svn/trunk@628 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Don't configure packages when in offline root mode.graham.gower@gmail.com2011-10-121-0/+4
| | | | | | | When installing into an offline root, packages should be marked "unpacked" not "installed". Resolves Issue #82. git-svn-id: http://opkg.googlecode.com/svn/trunk@627 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* 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 issue-79: Opkg can remove a package even if another still depends on it.pixdamix@gmail.com2011-07-131-1/+1
| | | | | | | | - The problematic case is described by tests/regress/issue79.py Signed-off-by: Camille Moncelier <moncelier@devlife.org> git-svn-id: http://opkg.googlecode.com/svn/trunk@625 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Don't filter out directories when claiming ownership of a file.graham.gower@gmail.com2011-07-051-4/+0
| | | | | | | | | | Directories are now owned by a particular package, which ensures their deletion in the event that a package leaves an empty directory during package removal. From Roman Khimov <khimov@altell.ru>. git-svn-id: http://opkg.googlecode.com/svn/trunk@624 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* sync() after writing out the status info.graham.gower@gmail.com2011-05-251-0/+1
| | | | | | This decreases the likelihood of a corrupted database due to power loss. git-svn-id: http://opkg.googlecode.com/svn/trunk@623 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Improve the opkg_{get,set}_option() C API.graham.gower@gmail.com2011-05-253-36/+35
| | | | | | This breaks compatibility with the previous API, so bump the lib version. git-svn-id: http://opkg.googlecode.com/svn/trunk@622 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Modify Release file parsing to use parse_from_stream_nomallocjaviplx@gmail.com2011-04-261-18/+9
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@621 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Introduce a specific pointer typedef for parse_line functionsjaviplx@gmail.com2011-04-265-15/+16
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@620 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Move pkg_parse_from_stream_nomalloc into parse_utiljaviplx@gmail.com2011-04-265-90/+99
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@619 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
* Read the contents of lists files coming from 'dist' entriesjaviplx@gmail.com2011-04-072-1/+63
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@616 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Download all the valid Packages files for dist entriesjaviplx@gmail.com2011-04-071-0/+37
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@615 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Introduce a new pkg_src list in global configuration to store the contents ↵javiplx@gmail.com2011-04-072-5/+35
| | | | | | of 'dists' entries for apt-alike repositories git-svn-id: http://opkg.googlecode.com/svn/trunk@614 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix mistype in define clausejaviplx@gmail.com2011-04-071-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@613 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Code to handle the apt-alike configuration entriesjaviplx@gmail.com2011-04-077-0/+686
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@612 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Create parse_util with some of the non-public functions from pkg_parse.cjaviplx@gmail.com2011-04-074-65/+122
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@611 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Add flag in opkg_download calls to reduce the severity of the 'failed ↵javiplx@gmail.com2011-04-074-14/+14
| | | | | | download' message git-svn-id: http://opkg.googlecode.com/svn/trunk@610 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix opkg_re_read_config_files().graham.gower@gmail.com2011-02-211-14/+6
| | | | | | This fixes segfaults when opkg_update_package_lists() is called multiple times. git-svn-id: http://opkg.googlecode.com/svn/trunk@609 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix memory leak when !defined(HAVE_GPGME) and !defined(HAVE_OPENSSL).graham.gower@gmail.com2011-02-211-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@608 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Get the owner of the file_name after the offline root has been stripped.graham.gower@gmail.com2011-02-201-1/+2
| | | | | | | Fixes a problem where the old package maintains that it owns a file even though the new pkg has been installed with --force-overwrite. git-svn-id: http://opkg.googlecode.com/svn/trunk@605 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Delete package sources that fail the signature check.graham.gower@gmail.com2011-02-131-0/+6
| | | | | | From Bernhard Guillon. git-svn-id: http://opkg.googlecode.com/svn/trunk@603 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
* Add overlay_root config option. Opkg checks this location for available space.graham.gower@gmail.com2011-02-133-3/+17
| | | | | | | | | This option is useful in the case where root is mounted ro, and another rw filesystem is overlaid on top with e.g. mini_fo. From Nicolas Thill via OpenWrt. git-svn-id: http://opkg.googlecode.com/svn/trunk@601 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Add missing space.graham.gower@gmail.com2011-02-131-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@600 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fixed a bug causing segfaults when an upgraded package has less dependencies ↵pixdamix2011-02-011-1/+1
| | | | | | than the old package. git-svn-id: http://opkg.googlecode.com/svn/trunk@598 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix potential undefined references to FILE, for libopkg users.graham.gower@gmail.com2010-12-221-0/+2
| | | | | | Patch from Richard Purdie. git-svn-id: http://opkg.googlecode.com/svn/trunk@595 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Don't print the function name when just outputting a \n.graham.gower@gmail.com2010-12-222-3/+3
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@591 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Abort package removal if the prerm script of a package returns non zero.graham.gower@gmail.com2010-11-232-8/+23
| | | | | | | | | This can be overridden with --force-remove. Also, improve propagation of errors up the call stack for related errors. From Sergey 'Jin' Bostandzhyan. git-svn-id: http://opkg.googlecode.com/svn/trunk@587 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Print the package name corresponding to a failed script.graham.gower@gmail.com2010-11-221-1/+2
| | | | | | From Sergey 'Jin' Bostandzhyan. git-svn-id: http://opkg.googlecode.com/svn/trunk@586 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix formatting issues found with the last commit.graham.gower@gmail.com2010-11-193-4/+4
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@585 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Use printf format specifier attribute for opkg_message().graham.gower@gmail.com2010-11-191-1/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@584 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove an unnecessary allocation.graham.gower@gmail.com2010-11-181-2/+2
| | | | | | | According to SUS3: If the value of n is zero on a call to snprintf(), nothing shall be written, the number of bytes that would have been written had n been sufficiently large excluding the terminating null shall be returned, and s may be a null pointer. git-svn-id: http://opkg.googlecode.com/svn/trunk@583 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Check return codes from vsnprintf and vfprintf.graham.gower@gmail.com2010-11-181-4/+19
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@582 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Rewrite sprintf_alloc.graham.gower@gmail.com2010-11-182-35/+19
| | | | | | | | | | | The example in printf(3) that this was taken from should not be used as it ignores negative return codes from vsnprintf, instead allocating more memory. Given an error from vsnprintf, this would loop until the process' virtual memory is exhausted. So we just exit in the event of a problem instead. git-svn-id: http://opkg.googlecode.com/svn/trunk@581 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix indentation.graham.gower@gmail.com2010-11-181-33/+33
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@580 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* opkg_find_package() should not return garbage if it cannot find the package.graham.gower@gmail.com2010-11-151-1/+3
| | | | | | From juliosao via Issue #69. git-svn-id: http://opkg.googlecode.com/svn/trunk@579 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
* Implement "list-changed-conffiles" command - based on patch by Yann Lopez ↵google@wwsnet.net2010-10-051-0/+35
| | | | | | <yann.lopez@gmail.com>. git-svn-id: http://opkg.googlecode.com/svn/trunk@576 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove dead code, sprintf_alloc() cannot fail. Opkg will exit instead.graham.gower@gmail.com2010-09-201-5/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@574 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* A proper fix this time. From Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>.graham.gower@gmail.com2010-09-202-11/+32
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@573 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358