project/opkg-lede.git
15 years agoRemove unused function.
graham.gower [Wed, 18 Nov 2009 01:38:25 +0000 (01:38 +0000)]
Remove unused function.

git-svn-id: http://opkg.googlecode.com/svn/trunk@332 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix segfault while attempting to parse invalid package stream.
graham.gower [Wed, 18 Nov 2009 01:37:40 +0000 (01:37 +0000)]
Fix segfault while attempting to parse invalid package stream.

Reported by John L. Chmielewski.

git-svn-id: http://opkg.googlecode.com/svn/trunk@331 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoAvoid some warn_unused_result warning
pixdamix [Tue, 17 Nov 2009 11:17:42 +0000 (11:17 +0000)]
Avoid some warn_unused_result warning

lockf maybe defined with warn_unused_result. Check the return
value to disable the warning (And add an error message by the way)

git-svn-id: http://opkg.googlecode.com/svn/trunk@330 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix output of whatdepends, whatsuggests and whatrecommends commands.
graham.gower [Tue, 17 Nov 2009 05:58:52 +0000 (05:58 +0000)]
Fix output of whatdepends, whatsuggests and whatrecommends commands.

Resolves Issue 23.

git-svn-id: http://opkg.googlecode.com/svn/trunk@329 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix depended_upon_by to only contain pre_depends and depends.
graham.gower [Tue, 17 Nov 2009 05:58:41 +0000 (05:58 +0000)]
Fix depended_upon_by to only contain pre_depends and depends.

Partially fixes Issue 23. Allows removal of suggested/recommended packages.

git-svn-id: http://opkg.googlecode.com/svn/trunk@328 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix depends output.
graham.gower [Tue, 17 Nov 2009 05:58:31 +0000 (05:58 +0000)]
Fix depends output.

git-svn-id: http://opkg.googlecode.com/svn/trunk@327 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix the warnings I created.
graham.gower [Tue, 17 Nov 2009 02:12:59 +0000 (02:12 +0000)]
Fix the warnings I created.

git-svn-id: http://opkg.googlecode.com/svn/trunk@326 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoCall _exit() and not exit() from within the child process.
graham.gower [Tue, 17 Nov 2009 02:10:45 +0000 (02:10 +0000)]
Call _exit() and not exit() from within the child process.

git-svn-id: http://opkg.googlecode.com/svn/trunk@325 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoPut the tmp file under conf->tmp_dir.
graham.gower [Tue, 17 Nov 2009 01:37:44 +0000 (01:37 +0000)]
Put the tmp file under conf->tmp_dir.

git-svn-id: http://opkg.googlecode.com/svn/trunk@324 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoUse the filename arg as a base for the temp file. Clean up function while here.
graham.gower [Tue, 17 Nov 2009 01:37:34 +0000 (01:37 +0000)]
Use the filename arg as a base for the temp file. Clean up function while here.

git-svn-id: http://opkg.googlecode.com/svn/trunk@323 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove unused function.
graham.gower [Tue, 17 Nov 2009 01:37:24 +0000 (01:37 +0000)]
Remove unused function.

git-svn-id: http://opkg.googlecode.com/svn/trunk@322 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoUse the same tmp dir pattern as in opkg_update_cmd().
graham.gower [Tue, 17 Nov 2009 01:37:14 +0000 (01:37 +0000)]
Use the same tmp dir pattern as in opkg_update_cmd().

git-svn-id: http://opkg.googlecode.com/svn/trunk@321 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoUse vfork()/execvp() instead of system().
graham.gower [Tue, 17 Nov 2009 00:17:55 +0000 (00:17 +0000)]
Use vfork()/execvp() instead of system().

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

15 years agoPass the correct file to diff when using an offline_root.
graham.gower [Tue, 17 Nov 2009 00:17:40 +0000 (00:17 +0000)]
Pass the correct file to diff when using an offline_root.

git-svn-id: http://opkg.googlecode.com/svn/trunk@319 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix pkg_get_installed_files() to work with an offline_root + dest.
graham.gower [Mon, 16 Nov 2009 05:29:13 +0000 (05:29 +0000)]
Fix pkg_get_installed_files() to work with an offline_root + dest.

git-svn-id: http://opkg.googlecode.com/svn/trunk@318 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoPass the correct file_name to pkg_get_conffile().
graham.gower [Mon, 16 Nov 2009 02:36:38 +0000 (02:36 +0000)]
Pass the correct file_name to pkg_get_conffile().

This should prevent modified conf files from being deleted for offline roots
and non root dests.

git-svn-id: http://opkg.googlecode.com/svn/trunk@317 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoAvoid printing an annoying message by default.
graham.gower [Mon, 16 Nov 2009 02:36:28 +0000 (02:36 +0000)]
Avoid printing an annoying message by default.

git-svn-id: http://opkg.googlecode.com/svn/trunk@316 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove redundant function.
graham.gower [Mon, 16 Nov 2009 01:04:46 +0000 (01:04 +0000)]
Remove redundant function.

git-svn-id: http://opkg.googlecode.com/svn/trunk@315 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove dead code.
graham.gower [Mon, 16 Nov 2009 00:43:40 +0000 (00:43 +0000)]
Remove dead code.

git-svn-id: http://opkg.googlecode.com/svn/trunk@314 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoatexit() isn't really appropriate for a library.
graham.gower [Mon, 16 Nov 2009 00:32:24 +0000 (00:32 +0000)]
atexit() isn't really appropriate for a library.

git-svn-id: http://opkg.googlecode.com/svn/trunk@313 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRaise the required verbosity level for this message.
graham.gower [Mon, 16 Nov 2009 00:19:38 +0000 (00:19 +0000)]
Raise the required verbosity level for this message.

git-svn-id: http://opkg.googlecode.com/svn/trunk@312 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoAdd a function for recursive directory removal and use that instead of xsystem.
graham.gower [Mon, 16 Nov 2009 00:13:12 +0000 (00:13 +0000)]
Add a function for recursive directory removal and use that instead of xsystem.

git-svn-id: http://opkg.googlecode.com/svn/trunk@311 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoDon't send the gzunp_pid SIGTERM. Waiting for exit should be sufficient.
graham.gower [Sun, 15 Nov 2009 22:44:38 +0000 (22:44 +0000)]
Don't send the gzunp_pid SIGTERM. Waiting for exit should be sufficient.

git-svn-id: http://opkg.googlecode.com/svn/trunk@310 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix a subtle leak.
graham.gower [Sun, 15 Nov 2009 09:42:53 +0000 (09:42 +0000)]
Fix a subtle leak.

git-svn-id: http://opkg.googlecode.com/svn/trunk@309 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFree memory in error paths.
graham.gower [Sun, 15 Nov 2009 09:28:48 +0000 (09:28 +0000)]
Free memory in error paths.

git-svn-id: http://opkg.googlecode.com/svn/trunk@308 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agomalloc -> xmalloc
graham.gower [Sun, 15 Nov 2009 09:11:43 +0000 (09:11 +0000)]
malloc -> xmalloc

git-svn-id: http://opkg.googlecode.com/svn/trunk@307 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoThe ": " is already added by vperror_msg... oops.
graham.gower [Sun, 15 Nov 2009 09:03:32 +0000 (09:03 +0000)]
The ": " is already added by vperror_msg... oops.

git-svn-id: http://opkg.googlecode.com/svn/trunk@306 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoCleanup gz_close().
graham.gower [Sun, 15 Nov 2009 08:59:19 +0000 (08:59 +0000)]
Cleanup gz_close().

 - Don't try to free() memory in a different process!
 - Move the function to a more appropriate file.
 - Fix error messages while here.

git-svn-id: http://opkg.googlecode.com/svn/trunk@305 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoMake the array const to fix warning.
graham.gower [Sun, 15 Nov 2009 07:18:03 +0000 (07:18 +0000)]
Make the array const to fix warning.

git-svn-id: http://opkg.googlecode.com/svn/trunk@304 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoI'm still seeing leaks here. So just stop allocating for these variables.
graham.gower [Sun, 15 Nov 2009 07:14:38 +0000 (07:14 +0000)]
I'm still seeing leaks here. So just stop allocating for these variables.

git-svn-id: http://opkg.googlecode.com/svn/trunk@303 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix leak in error path.
graham.gower [Sun, 15 Nov 2009 07:14:26 +0000 (07:14 +0000)]
Fix leak in error path.

git-svn-id: http://opkg.googlecode.com/svn/trunk@302 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoWrite out status files for the correct pkg->dest, instead of the default.
graham.gower [Sun, 15 Nov 2009 04:23:56 +0000 (04:23 +0000)]
Write out status files for the correct pkg->dest, instead of the default.

git-svn-id: http://opkg.googlecode.com/svn/trunk@301 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix the case where -o is used, but no conf file is passed.
graham.gower [Fri, 13 Nov 2009 05:57:45 +0000 (05:57 +0000)]
Fix the case where -o is used, but no conf file is passed.

git-svn-id: http://opkg.googlecode.com/svn/trunk@300 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove unused variable.
graham.gower [Fri, 13 Nov 2009 05:57:34 +0000 (05:57 +0000)]
Remove unused variable.

git-svn-id: http://opkg.googlecode.com/svn/trunk@299 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove local variable which was masking a static one.
graham.gower [Fri, 13 Nov 2009 03:30:49 +0000 (03:30 +0000)]
Remove local variable which was masking a static one.

git-svn-id: http://opkg.googlecode.com/svn/trunk@298 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFree the lock, close the file descriptor.
graham.gower [Fri, 13 Nov 2009 03:30:39 +0000 (03:30 +0000)]
Free the lock, close the file descriptor.

git-svn-id: http://opkg.googlecode.com/svn/trunk@297 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove status_file_tmp_name. This code does not improve robustness.
graham.gower [Fri, 13 Nov 2009 02:57:43 +0000 (02:57 +0000)]
Remove status_file_tmp_name. This code does not improve robustness.

git-svn-id: http://opkg.googlecode.com/svn/trunk@296 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoMake opkg_conf_parse_file() return -1 for error, as expected where it is called.
graham.gower [Fri, 13 Nov 2009 01:23:20 +0000 (01:23 +0000)]
Make opkg_conf_parse_file() return -1 for error, as expected where it is called.

git-svn-id: http://opkg.googlecode.com/svn/trunk@295 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoSome cleanup of opkg_conf_init/opkg_conf_deinit.
graham.gower [Fri, 13 Nov 2009 01:07:11 +0000 (01:07 +0000)]
Some cleanup of opkg_conf_init/opkg_conf_deinit.

git-svn-id: http://opkg.googlecode.com/svn/trunk@294 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoCompare verbosity to a message_level_t.
graham.gower [Fri, 13 Nov 2009 01:07:00 +0000 (01:07 +0000)]
Compare verbosity to a message_level_t.

git-svn-id: http://opkg.googlecode.com/svn/trunk@293 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix copy/pasto in error message.
graham.gower [Thu, 12 Nov 2009 22:28:03 +0000 (22:28 +0000)]
Fix copy/pasto in error message.

git-svn-id: http://opkg.googlecode.com/svn/trunk@292 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoOf course, that should be !isatty().
graham.gower [Thu, 12 Nov 2009 09:43:23 +0000 (09:43 +0000)]
Of course, that should be !isatty().

git-svn-id: http://opkg.googlecode.com/svn/trunk@291 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoDon't prompt for user input from stdin if it's not a tty.
graham.gower [Thu, 12 Nov 2009 06:38:44 +0000 (06:38 +0000)]
Don't prompt for user input from stdin if it's not a tty.

Based off a patch by Chris Larson <clarson@mvista.com> for OpenEmbedded.

git-svn-id: http://opkg.googlecode.com/svn/trunk@290 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoCleanup the rest of pkg_parse.c. Give some functions more appropriate names too.
graham.gower [Thu, 12 Nov 2009 06:26:26 +0000 (06:26 +0000)]
Cleanup the rest of pkg_parse.c. Give some functions more appropriate names too.

git-svn-id: http://opkg.googlecode.com/svn/trunk@289 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoDon't clobber errno, so that we can provide a useful error message.
graham.gower [Thu, 12 Nov 2009 06:26:11 +0000 (06:26 +0000)]
Don't clobber errno, so that we can provide a useful error message.

git-svn-id: http://opkg.googlecode.com/svn/trunk@288 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix parsing of Conffiles lines in status files.
graham.gower [Thu, 12 Nov 2009 05:02:46 +0000 (05:02 +0000)]
Fix parsing of Conffiles lines in status files.

Also, add a leading space when writing out the status file such that the
parser can recognise these lines as conf file lines.

git-svn-id: http://opkg.googlecode.com/svn/trunk@287 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoCleanup version string handling.
graham.gower [Thu, 12 Nov 2009 05:02:35 +0000 (05:02 +0000)]
Cleanup version string handling.

git-svn-id: http://opkg.googlecode.com/svn/trunk@286 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix leak when downgrading a package.
graham.gower [Thu, 12 Nov 2009 05:02:24 +0000 (05:02 +0000)]
Fix leak when downgrading a package.

git-svn-id: http://opkg.googlecode.com/svn/trunk@285 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove a debugging fprintf I accidentally left in.
graham.gower [Wed, 11 Nov 2009 03:43:50 +0000 (03:43 +0000)]
Remove a debugging fprintf I accidentally left in.

git-svn-id: http://opkg.googlecode.com/svn/trunk@284 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoCleanup parsing of packages.
graham.gower [Wed, 11 Nov 2009 03:18:23 +0000 (03:18 +0000)]
Cleanup parsing of packages.

This diff is loosely based on a patch by Jo-Philipp Wich <google@wwsnet.net>
posted in the bugtracker (Issue #24). Peak memory consumption while parsing
package lists is dramatically reduced.

Thanks to Camille Moncelier for fixing problems after reallocing for long lines.

git-svn-id: http://opkg.googlecode.com/svn/trunk@283 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoDead code removal.
graham.gower [Wed, 11 Nov 2009 02:23:57 +0000 (02:23 +0000)]
Dead code removal.

git-svn-id: http://opkg.googlecode.com/svn/trunk@282 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoDon't try to rerun control scripts, problems caused by circular dependencies.
graham.gower [Wed, 11 Nov 2009 02:10:49 +0000 (02:10 +0000)]
Don't try to rerun control scripts, problems caused by circular dependencies.

Symptoms of this problem are seeing the following when installing a package:
opkg: (null): Bad address
opkg: (null): Bad address

git-svn-id: http://opkg.googlecode.com/svn/trunk@281 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoMore cleanup in error paths to plug leaks found while installing dbus.
graham.gower [Wed, 11 Nov 2009 00:46:56 +0000 (00:46 +0000)]
More cleanup in error paths to plug leaks found while installing dbus.

git-svn-id: http://opkg.googlecode.com/svn/trunk@280 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoUpdate name in copyrights + minor changes
pixdamix [Tue, 10 Nov 2009 16:29:08 +0000 (16:29 +0000)]
Update name in copyrights + minor changes

git-svn-id: http://opkg.googlecode.com/svn/trunk@279 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoCleanup trim_alloc().
graham.gower [Tue, 10 Nov 2009 06:07:09 +0000 (06:07 +0000)]
Cleanup trim_alloc().

git-svn-id: http://opkg.googlecode.com/svn/trunk@278 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove opkg_internal_use_only and fix associated assumptions RE pkg->provides.
graham.gower [Tue, 10 Nov 2009 05:00:59 +0000 (05:00 +0000)]
Remove opkg_internal_use_only and fix associated assumptions RE pkg->provides.

It appears that the opkg_internal_use_only provides string was introduced to
bandaid over problems with assuming that the pkg->provides, pkg->provides_str
and pkg->provides_count are all the same length. As each pkg provides itself,
the pkg->provides array was one longer than the str and count fields. Most of
the uses of pkg->provides did not take this into account.

This behaviour has been changed. pkg->provides is now pkg->provides_count long
and it is pkg->provides_str which is shorter by one.

Associated dead code has also been removed.

git-svn-id: http://opkg.googlecode.com/svn/trunk@277 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove the assumption that pkg fields have been allocated and need free()ing.
graham.gower [Tue, 10 Nov 2009 05:00:45 +0000 (05:00 +0000)]
Remove the assumption that pkg fields have been allocated and need free()ing.

git-svn-id: http://opkg.googlecode.com/svn/trunk@276 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoEnsure that the hash_table messages show useful information.
graham.gower [Tue, 10 Nov 2009 05:00:35 +0000 (05:00 +0000)]
Ensure that the hash_table messages show useful information.

git-svn-id: http://opkg.googlecode.com/svn/trunk@275 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoUse xsystem() to be consistent. Some minor cleanup too.
graham.gower [Tue, 10 Nov 2009 05:00:25 +0000 (05:00 +0000)]
Use xsystem() to be consistent. Some minor cleanup too.

git-svn-id: http://opkg.googlecode.com/svn/trunk@274 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoPut update temp directory in with the others. Also, don't confuse returning
graham.gower [Fri, 6 Nov 2009 06:17:44 +0000 (06:17 +0000)]
Put update temp directory in with the others. Also, don't confuse returning
error codes with number of download failures.

git-svn-id: http://opkg.googlecode.com/svn/trunk@273 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoUse mkdtemp() to create a unique directory instead of a goto loop.
graham.gower [Fri, 6 Nov 2009 05:57:57 +0000 (05:57 +0000)]
Use mkdtemp() to create a unique directory instead of a goto loop.

git-svn-id: http://opkg.googlecode.com/svn/trunk@272 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoMore dead code removal.
graham.gower [Fri, 6 Nov 2009 04:49:01 +0000 (04:49 +0000)]
More dead code removal.

git-svn-id: http://opkg.googlecode.com/svn/trunk@271 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove if (0 && ...) ... statements.
graham.gower [Fri, 6 Nov 2009 04:34:49 +0000 (04:34 +0000)]
Remove if (0 && ...) ... statements.

git-svn-id: http://opkg.googlecode.com/svn/trunk@270 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove more unused code.
graham.gower [Fri, 6 Nov 2009 04:28:03 +0000 (04:28 +0000)]
Remove more unused code.

git-svn-id: http://opkg.googlecode.com/svn/trunk@269 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove unused function.
graham.gower [Fri, 6 Nov 2009 04:27:48 +0000 (04:27 +0000)]
Remove unused function.

git-svn-id: http://opkg.googlecode.com/svn/trunk@268 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove dead code. We would segfault before following this code path.
graham.gower [Fri, 6 Nov 2009 04:27:37 +0000 (04:27 +0000)]
Remove dead code. We would segfault before following this code path.

git-svn-id: http://opkg.googlecode.com/svn/trunk@267 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove some bogus error checking and return void instead of int.
graham.gower [Fri, 6 Nov 2009 00:50:12 +0000 (00:50 +0000)]
Remove some bogus error checking and return void instead of int.

git-svn-id: http://opkg.googlecode.com/svn/trunk@266 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoSpecify --enable-pathfinder instead of --with-pathfinder.
graham.gower [Fri, 6 Nov 2009 00:48:36 +0000 (00:48 +0000)]
Specify --enable-pathfinder instead of --with-pathfinder.

git-svn-id: http://opkg.googlecode.com/svn/trunk@265 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoI hate autotools.
graham.gower [Fri, 6 Nov 2009 00:41:31 +0000 (00:41 +0000)]
I hate autotools.

If the first call to PKG_CHECK_MODULES() may not occur, then the macro does
something really really stupid: it sets PKG_CONFIG="". Thus subsequent calls
will fail and tell you that pkg-config cannot be found or is too old.

git-svn-id: http://opkg.googlecode.com/svn/trunk@264 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoSome refactoring of pathfinder support
pixdamix [Thu, 5 Nov 2009 16:07:47 +0000 (16:07 +0000)]
Some refactoring of pathfinder support

git-svn-id: http://opkg.googlecode.com/svn/trunk@263 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemoved a bunch of if(0) and dead code
pixdamix [Thu, 5 Nov 2009 08:46:43 +0000 (08:46 +0000)]
Removed a bunch of if(0) and dead code

Applied this semantic patch:

  @@
  statement S;
  @@
  - if(0) S

  @@
  @@
  - remove_obsolete_maintainer_scripts(...) {
  - ...
  -}

  @@
  @@
  - remove_obsolete_maintainer_scripts(...);

  @@
  identifier i;
  @@
  -if(i){
  -}

git-svn-id: http://opkg.googlecode.com/svn/trunk@262 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoAdd pathfinder support for certificate validation
pixdamix [Thu, 5 Nov 2009 08:46:33 +0000 (08:46 +0000)]
Add pathfinder support for certificate validation

  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

15 years agoThese functions cannot fail, so return void.
graham.gower [Thu, 5 Nov 2009 04:52:10 +0000 (04:52 +0000)]
These functions cannot fail, so return void.

git-svn-id: http://opkg.googlecode.com/svn/trunk@260 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agos/malloc/xmalloc/ s/calloc/xcalloc/ s/realloc/realloc/
graham.gower [Thu, 5 Nov 2009 04:20:09 +0000 (04:20 +0000)]
s/malloc/xmalloc/ s/calloc/xcalloc/ s/realloc/realloc/

And redundant error checking removed from the places where allocation failures
were actually checked.

git-svn-id: http://opkg.googlecode.com/svn/trunk@259 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoDon't set PATH="/dev/null". Shuffle things around while here.
graham.gower [Thu, 5 Nov 2009 03:09:44 +0000 (03:09 +0000)]
Don't set PATH="/dev/null". Shuffle things around while here.

git-svn-id: http://opkg.googlecode.com/svn/trunk@258 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove code path which cannot be executed.
graham.gower [Thu, 5 Nov 2009 02:38:40 +0000 (02:38 +0000)]
Remove code path which cannot be executed.

git-svn-id: http://opkg.googlecode.com/svn/trunk@257 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agos/strndup/xstrndup/ - check memory allocations for failure.
graham.gower [Wed, 4 Nov 2009 03:15:09 +0000 (03:15 +0000)]
s/strndup/xstrndup/ - check memory allocations for failure.

git-svn-id: http://opkg.googlecode.com/svn/trunk@256 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agos/strdup/xstrdup/ - check memory allocations for failure.
graham.gower [Wed, 4 Nov 2009 03:14:59 +0000 (03:14 +0000)]
s/strdup/xstrdup/ - check memory allocations for failure.

git-svn-id: http://opkg.googlecode.com/svn/trunk@255 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove some strdup abuse.
graham.gower [Wed, 4 Nov 2009 03:14:39 +0000 (03:14 +0000)]
Remove some strdup abuse.

git-svn-id: http://opkg.googlecode.com/svn/trunk@254 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove str_dup_safe() in favour of xstrdup() from libbb.
graham.gower [Wed, 4 Nov 2009 02:13:22 +0000 (02:13 +0000)]
Remove str_dup_safe() in favour of xstrdup() from libbb.

git-svn-id: http://opkg.googlecode.com/svn/trunk@253 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove unused opkg_set_current_state bits.
graham.gower [Wed, 4 Nov 2009 01:22:05 +0000 (01:22 +0000)]
Remove unused opkg_set_current_state bits.

git-svn-id: http://opkg.googlecode.com/svn/trunk@252 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoMake `curl' an instance variable and ssl support
pixdamix [Tue, 3 Nov 2009 09:27:03 +0000 (09:27 +0000)]
Make `curl' an instance variable and ssl support

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

15 years agoThe list-installed command does not exist.
graham.gower [Tue, 3 Nov 2009 06:26:31 +0000 (06:26 +0000)]
The list-installed command does not exist.

git-svn-id: http://opkg.googlecode.com/svn/trunk@250 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove response_callback bits. Forgot to commit this before.
graham.gower [Tue, 3 Nov 2009 06:19:56 +0000 (06:19 +0000)]
Remove response_callback bits. Forgot to commit this before.

git-svn-id: http://opkg.googlecode.com/svn/trunk@249 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove some code duplication, check for realloc failure.
graham.gower [Tue, 3 Nov 2009 05:56:49 +0000 (05:56 +0000)]
Remove some code duplication, check for realloc failure.

git-svn-id: http://opkg.googlecode.com/svn/trunk@248 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoClean up pkg_vec_insert.
graham.gower [Tue, 3 Nov 2009 05:56:39 +0000 (05:56 +0000)]
Clean up pkg_vec_insert.

- Check for realloc failure.
- Don't cast an lvalue.
- Remove unused counter.

git-svn-id: http://opkg.googlecode.com/svn/trunk@247 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove prototype for deleted function.
graham.gower [Tue, 3 Nov 2009 03:58:20 +0000 (03:58 +0000)]
Remove prototype for deleted function.

git-svn-id: http://opkg.googlecode.com/svn/trunk@246 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoStop my eyes from bleeding.
graham.gower [Tue, 3 Nov 2009 03:51:34 +0000 (03:51 +0000)]
Stop my eyes from bleeding.

Testing shows that the info and status commands give the same output as before.
If you find a case where they differ, please let me know.

git-svn-id: http://opkg.googlecode.com/svn/trunk@245 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove unused callbacks, a legacy of the now removed ipkg API.
graham.gower [Tue, 3 Nov 2009 01:38:51 +0000 (01:38 +0000)]
Remove unused callbacks, a legacy of the now removed ipkg API.

git-svn-id: http://opkg.googlecode.com/svn/trunk@244 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoStop using opkg_cb_message.
graham.gower [Tue, 3 Nov 2009 01:38:39 +0000 (01:38 +0000)]
Stop using opkg_cb_message.

git-svn-id: http://opkg.googlecode.com/svn/trunk@243 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoClean up some _cmd functions, in particular remove use of print callbacks.
graham.gower [Tue, 3 Nov 2009 01:38:28 +0000 (01:38 +0000)]
Clean up some _cmd functions, in particular remove use of print callbacks.

git-svn-id: http://opkg.googlecode.com/svn/trunk@242 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoRemove unused code: if pkg was NULL, we would already have segfaulted.
graham.gower [Tue, 3 Nov 2009 00:53:11 +0000 (00:53 +0000)]
Remove unused code: if pkg was NULL, we would already have segfaulted.

git-svn-id: http://opkg.googlecode.com/svn/trunk@241 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoopkg: fix nullpointer dereference
pixdamix [Mon, 2 Nov 2009 15:47:29 +0000 (15:47 +0000)]
opkg: fix nullpointer dereference

Applied 011-fix_nullpointer_deref.patch from OpenWRT

git-svn-id: http://opkg.googlecode.com/svn/trunk@240 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoopkg: fix the -force_space option
pixdamix [Mon, 2 Nov 2009 15:47:16 +0000 (15:47 +0000)]
opkg: fix the -force_space option

- 006-fix_force_space.patch from OpenWRT

git-svn-id: http://opkg.googlecode.com/svn/trunk@239 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoCleanup error_list stuff a bit more.
graham.gower [Mon, 2 Nov 2009 03:39:12 +0000 (03:39 +0000)]
Cleanup error_list stuff a bit more.

- Remove reverse_error_list.
- Push messages on to the tail of the list.
- Move the print function in with the other error list functions.
- Indentation and variable name cleanups.

git-svn-id: http://opkg.googlecode.com/svn/trunk@238 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFree memory if we fail to remove a package due to it having dependents.
graham.gower [Mon, 2 Nov 2009 02:49:25 +0000 (02:49 +0000)]
Free memory if we fail to remove a package due to it having dependents.

git-svn-id: http://opkg.googlecode.com/svn/trunk@237 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoAvoid reading past the end of the array.
graham.gower [Mon, 2 Nov 2009 02:34:29 +0000 (02:34 +0000)]
Avoid reading past the end of the array.

git-svn-id: http://opkg.googlecode.com/svn/trunk@236 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agopkg_init_from_file() already does this strdup(), so stop another leak.
graham.gower [Mon, 2 Nov 2009 01:35:59 +0000 (01:35 +0000)]
pkg_init_from_file() already does this strdup(), so stop another leak.

git-svn-id: http://opkg.googlecode.com/svn/trunk@235 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFree memory used when parsing a control file.
graham.gower [Mon, 2 Nov 2009 01:35:48 +0000 (01:35 +0000)]
Free memory used when parsing a control file.

git-svn-id: http://opkg.googlecode.com/svn/trunk@234 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

15 years agoFix memory leaks.
graham.gower [Mon, 2 Nov 2009 01:15:14 +0000 (01:15 +0000)]
Fix memory leaks.

git-svn-id: http://opkg.googlecode.com/svn/trunk@233 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358