graham.gower [Thu, 10 Dec 2009 06:00:51 +0000 (06:00 +0000)]
Clarify why we're not using fseek(), use fseek() where applicable.
git-svn-id: http://opkg.googlecode.com/svn/trunk@481
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 10 Dec 2009 06:00:34 +0000 (06:00 +0000)]
indent -kr -i8 -psl -hnl -l80 opkg.c
git-svn-id: http://opkg.googlecode.com/svn/trunk@480
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 10 Dec 2009 05:59:49 +0000 (05:59 +0000)]
Remove struct _opkg_package_t.
git-svn-id: http://opkg.googlecode.com/svn/trunk@479
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 9 Dec 2009 06:37:09 +0000 (06:37 +0000)]
Implement list all command. Print full version string.
git-svn-id: http://opkg.googlecode.com/svn/trunk@478
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 9 Dec 2009 06:24:29 +0000 (06:24 +0000)]
Fix infinite loop created when I removed the masked variable i.
git-svn-id: http://opkg.googlecode.com/svn/trunk@477
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 9 Dec 2009 06:05:48 +0000 (06:05 +0000)]
And make the install command work. WTF?
git-svn-id: http://opkg.googlecode.com/svn/trunk@476
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 9 Dec 2009 06:05:29 +0000 (06:05 +0000)]
Make the "update" command work. Previously, you had to type "updd..."
For a test program, it can't have seen much testing.
git-svn-id: http://opkg.googlecode.com/svn/trunk@475
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 9 Dec 2009 06:05:08 +0000 (06:05 +0000)]
Remove opkg_package_t from libopkg_test.c. Also, use OFFLINE_ROOT env var.
git-svn-id: http://opkg.googlecode.com/svn/trunk@474
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 9 Dec 2009 06:04:33 +0000 (06:04 +0000)]
Get rid of opkg_package_t.
We can't provide all the useful info without duplicating pkg_t, so just
use pkg_t.
git-svn-id: http://opkg.googlecode.com/svn/trunk@473
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 9 Dec 2009 05:22:43 +0000 (05:22 +0000)]
Fix lock_fd... How did I manage to break that?
Remove some redundant if statements too.
git-svn-id: http://opkg.googlecode.com/svn/trunk@472
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 9 Dec 2009 01:20:03 +0000 (01:20 +0000)]
Merge commit 'grg' into HEAD
git-svn-id: http://opkg.googlecode.com/svn/trunk@471
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Sun, 6 Dec 2009 23:59:59 +0000 (23:59 +0000)]
Bump version number.
git-svn-id: http://opkg.googlecode.com/svn/trunk@454
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 4 Dec 2009 01:09:33 +0000 (01:09 +0000)]
Remove -Werror from libopkg CFLAGS.
While I believe all warnings should be fixed, it is not possible to test opkg
on all systems with all compiler versions. Warnings for end users on such
systems should not cause build failure.
And with the addition of shave, warnings are really easy to see without -Werror.
git-svn-id: http://opkg.googlecode.com/svn/trunk@446
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 4 Dec 2009 01:00:02 +0000 (01:00 +0000)]
Ignore extraction errors, for now. Requested by Koen.
As opkg has never failed from these errors in the past, many recipes in
OpenEmbedded have come to rely on this behaviour. So proceed regardless of
extraction errors for now, to give the OE folks a chance to fix broken
packages first.
git-svn-id: http://opkg.googlecode.com/svn/trunk@445
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 3 Dec 2009 04:11:26 +0000 (04:11 +0000)]
Two fixes from Martin Jansa <martin.jansa@gmail.com>.
* if there are more alternatives with highest priority, use the one last
in alternatives file (latest installed)
* if target exists and is a directory, remove link, otherwise new
alternative link is created inside that direstory
git-svn-id: http://opkg.googlecode.com/svn/trunk@439
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 3 Dec 2009 03:04:07 +0000 (03:04 +0000)]
Fix truncation problem when reading in long lines. Found by Koen Kooi.
After realloc()ing a second time for long lines, buflen was one byte short.
It did not take into account buf being pointed at the NULL terminator, before
the end of the buffer. So when fgets() was next called, it inserted its NULL
terminator one byte earlier than expected. The earlier terminator was not
overwritten by subsequent iterations as it should have been.
git-svn-id: http://opkg.googlecode.com/svn/trunk@438
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 3 Dec 2009 03:03:48 +0000 (03:03 +0000)]
Free memory when there are unresolved dependencies.
git-svn-id: http://opkg.googlecode.com/svn/trunk@437
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
pixdamix [Tue, 1 Dec 2009 08:02:59 +0000 (08:02 +0000)]
patch for opkg_download.c compile abort
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
florian.boor [Fri, 27 Nov 2009 12:27:33 +0000 (12:27 +0000)]
Maks sure scripts get packaged
git-svn-id: http://opkg.googlecode.com/svn/trunk@402
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
florian.boor [Fri, 27 Nov 2009 12:26:35 +0000 (12:26 +0000)]
Fix typo in file name in order to fix distcheck.
git-svn-id: http://opkg.googlecode.com/svn/trunk@401
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 27 Nov 2009 05:32:52 +0000 (05:32 +0000)]
Remove unused parameter from pkg_hash_fetch_best_installation_candidate().
git-svn-id: http://opkg.googlecode.com/svn/trunk@397
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 27 Nov 2009 05:32:37 +0000 (05:32 +0000)]
Finding a provider which is has an incompatible arch should not prevent
the installation of others which are compatible.
git-svn-id: http://opkg.googlecode.com/svn/trunk@396
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 27 Nov 2009 04:09:44 +0000 (04:09 +0000)]
Remove enum opkg_error.
The return codes aren't particularly useful and trying to have a useful one
for every error scenario would be like extending errno. Good error messages
via opkg_message() are far more appropriate.
git-svn-id: http://opkg.googlecode.com/svn/trunk@395
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 27 Nov 2009 04:09:26 +0000 (04:09 +0000)]
Be slightly less verbose by default.
git-svn-id: http://opkg.googlecode.com/svn/trunk@394
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 27 Nov 2009 04:09:15 +0000 (04:09 +0000)]
Fix some errno abuse.
git-svn-id: http://opkg.googlecode.com/svn/trunk@393
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 27 Nov 2009 01:22:10 +0000 (01:22 +0000)]
Check the unzip child process for errors and pass the upwards. Also, avoid child from being killed by SIGPIPE.
git-svn-id: http://opkg.googlecode.com/svn/trunk@392
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 27 Nov 2009 00:42:00 +0000 (00:42 +0000)]
Provide error checking for users of pkg_extract_* functions.
git-svn-id: http://opkg.googlecode.com/svn/trunk@391
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 27 Nov 2009 00:41:44 +0000 (00:41 +0000)]
Add error checking to deb_extract(), unarchive(), extract_archive(). et al.
git-svn-id: http://opkg.googlecode.com/svn/trunk@390
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 27 Nov 2009 00:41:28 +0000 (00:41 +0000)]
Add __FUNCTION__ to the error mesage.
git-svn-id: http://opkg.googlecode.com/svn/trunk@389
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 27 Nov 2009 00:41:18 +0000 (00:41 +0000)]
Name it after what it does: s/extract_to_stdout/extract_to_stream/
git-svn-id: http://opkg.googlecode.com/svn/trunk@388
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
pixdamix [Thu, 26 Nov 2009 13:57:59 +0000 (13:57 +0000)]
Add missing include
git-svn-id: http://opkg.googlecode.com/svn/trunk@387
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 26 Nov 2009 05:41:19 +0000 (05:41 +0000)]
Fix problem introduced in r382. Pointed out by jlc, thanks!
git-svn-id: http://opkg.googlecode.com/svn/trunk@386
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 26 Nov 2009 04:04:28 +0000 (04:04 +0000)]
libbb.h cleanup.
git-svn-id: http://opkg.googlecode.com/svn/trunk@385
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 26 Nov 2009 04:04:15 +0000 (04:04 +0000)]
Various unarchive.c cleanups.
git-svn-id: http://opkg.googlecode.com/svn/trunk@384
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 26 Nov 2009 01:42:53 +0000 (01:42 +0000)]
Remove str_util.{c,h}
git-svn-id: http://opkg.googlecode.com/svn/trunk@383
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 26 Nov 2009 01:42:27 +0000 (01:42 +0000)]
file_util.c cleanups. Remove redundant str_chomp from str_util.c.
git-svn-id: http://opkg.googlecode.com/svn/trunk@382
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 26 Nov 2009 01:42:09 +0000 (01:42 +0000)]
malloc -> xmalloc
git-svn-id: http://opkg.googlecode.com/svn/trunk@381
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 26 Nov 2009 01:41:58 +0000 (01:41 +0000)]
Minor cleanup for opkg_upgrade.c
git-svn-id: http://opkg.googlecode.com/svn/trunk@380
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 23:23:22 +0000 (23:23 +0000)]
Propagate errors upwards.
git-svn-id: http://opkg.googlecode.com/svn/trunk@379
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 23:23:10 +0000 (23:23 +0000)]
Various clean ups.
git-svn-id: http://opkg.googlecode.com/svn/trunk@378
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 23:22:58 +0000 (23:22 +0000)]
Return void, not int.
git-svn-id: http://opkg.googlecode.com/svn/trunk@377
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 22:21:24 +0000 (22:21 +0000)]
Fix duplicate and add a name.
git-svn-id: http://opkg.googlecode.com/svn/trunk@376
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
pixdamix [Wed, 25 Nov 2009 21:37:50 +0000 (21:37 +0000)]
Add a list of Contributors (appologies to any missed)
git-svn-id: http://opkg.googlecode.com/svn/trunk@375
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 05:53:42 +0000 (05:53 +0000)]
Plug leaks found when using --force-removal-of-dependent-packages.
git-svn-id: http://opkg.googlecode.com/svn/trunk@374
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 05:39:24 +0000 (05:39 +0000)]
Various cleanups in opkg_remove.{c,h}
git-svn-id: http://opkg.googlecode.com/svn/trunk@373
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 04:23:03 +0000 (04:23 +0000)]
Various cleanups for pkg.{c,h}.
git-svn-id: http://opkg.googlecode.com/svn/trunk@372
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 04:22:50 +0000 (04:22 +0000)]
One more TODO.
git-svn-id: http://opkg.googlecode.com/svn/trunk@371
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 04:22:40 +0000 (04:22 +0000)]
Add vim swp files.
git-svn-id: http://opkg.googlecode.com/svn/trunk@370
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 04:22:31 +0000 (04:22 +0000)]
Remove unused functions. Shuffle things around and remove forward declarations.
git-svn-id: http://opkg.googlecode.com/svn/trunk@369
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 04:22:20 +0000 (04:22 +0000)]
Make a couple of functions static, and return void since they cannot fail.
git-svn-id: http://opkg.googlecode.com/svn/trunk@368
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Wed, 25 Nov 2009 01:41:01 +0000 (01:41 +0000)]
Update README and TODO. Add myself to AUTHORS.
git-svn-id: http://opkg.googlecode.com/svn/trunk@367
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
pixdamix [Tue, 24 Nov 2009 10:58:01 +0000 (10:58 +0000)]
Add a .gitignore file for the ones using git-svn
git-svn-id: http://opkg.googlecode.com/svn/trunk@366
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 08:39:16 +0000 (08:39 +0000)]
Fix warning on 64bit arches.
git-svn-id: http://opkg.googlecode.com/svn/trunk@365
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
pixdamix [Tue, 24 Nov 2009 08:04:39 +0000 (08:04 +0000)]
shave: making the autotools output sane
Use shave (http://git.lespiau.name/cgit/shave) to make compilation more
human friendly.
Shave is enabled by default, Use --disable-shave to see the actual
compiler and linker commands being executed.
git-svn-id: http://opkg.googlecode.com/svn/trunk@364
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 06:35:49 +0000 (06:35 +0000)]
Clean up opkg_depends_cmd() and opkg_what_depends_conflicts_cmd().
git-svn-id: http://opkg.googlecode.com/svn/trunk@363
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 06:35:38 +0000 (06:35 +0000)]
Do the right thing if we have a version but no constraint.
The package maintainer shouldn't do this, but it happens ocassionally.
git-svn-id: http://opkg.googlecode.com/svn/trunk@362
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 05:13:10 +0000 (05:13 +0000)]
Provide a more useful comment.
git-svn-id: http://opkg.googlecode.com/svn/trunk@361
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 04:55:51 +0000 (04:55 +0000)]
Remove the purge command. Undocumented and only duplicates remove functionality.
git-svn-id: http://opkg.googlecode.com/svn/trunk@360
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 04:41:46 +0000 (04:41 +0000)]
Remove list_pending command. Undocumented and the pending_dir was unpopulated.
git-svn-id: http://opkg.googlecode.com/svn/trunk@359
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 04:26:36 +0000 (04:26 +0000)]
Remove dead code in opkg_remove_cmd().
git-svn-id: http://opkg.googlecode.com/svn/trunk@358
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 04:12:07 +0000 (04:12 +0000)]
Remove useless memory allocation and strcpy.
git-svn-id: http://opkg.googlecode.com/svn/trunk@357
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 02:35:28 +0000 (02:35 +0000)]
Remove remaining uses of pkg->*_str arrays and free() them after parsing.
Saves about 800kb in peak memory usage for my package list (6000 packages).
git-svn-id: http://opkg.googlecode.com/svn/trunk@356
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 02:35:17 +0000 (02:35 +0000)]
Fix a leak found when using --force-reinstall.
git-svn-id: http://opkg.googlecode.com/svn/trunk@355
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 02:35:06 +0000 (02:35 +0000)]
There should be a space before the bracket.
git-svn-id: http://opkg.googlecode.com/svn/trunk@354
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 02:34:55 +0000 (02:34 +0000)]
Fix pkg_depend_str() to not use pkg->depends_str.
git-svn-id: http://opkg.googlecode.com/svn/trunk@353
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Tue, 24 Nov 2009 02:31:32 +0000 (02:31 +0000)]
There is no need to use a buffer at all.
git-svn-id: http://opkg.googlecode.com/svn/trunk@352
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
pixdamix [Mon, 23 Nov 2009 08:28:58 +0000 (08:28 +0000)]
Allow to install a package from a read-only dir
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
graham.gower [Mon, 23 Nov 2009 06:05:08 +0000 (06:05 +0000)]
Fix an unfortunate typo.
git-svn-id: http://opkg.googlecode.com/svn/trunk@350
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Mon, 23 Nov 2009 05:39:23 +0000 (05:39 +0000)]
Clean up the help output.
- Don't print long options with a single dash.
- Don't print commands with an underscore, ensure that it works with a
dash. e.g. list-installed.
- No wrapping on an 80 char wide terminal.
- Incrementing the verbositiy was broken, so remove it.
NOTE: Old commands/options still all work and some commands/options remain
undocumented.
git-svn-id: http://opkg.googlecode.com/svn/trunk@349
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Mon, 23 Nov 2009 02:15:01 +0000 (02:15 +0000)]
Add opkg config file option for tmp_dir.
Requested by Mike Westerhof for small memory systems where /tmp is a memory
file system.
Add, e.g. the following to your opkg config file:
option tmp_dir /tmp/frob
git-svn-id: http://opkg.googlecode.com/svn/trunk@348
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Mon, 23 Nov 2009 00:28:25 +0000 (00:28 +0000)]
Don't leak the ar_header or the tar_header.
git-svn-id: http://opkg.googlecode.com/svn/trunk@347
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Sun, 22 Nov 2009 23:15:15 +0000 (23:15 +0000)]
Add some error checking on fputs.
git-svn-id: http://opkg.googlecode.com/svn/trunk@346
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Sun, 22 Nov 2009 23:15:05 +0000 (23:15 +0000)]
Change fdopen(fd, "rw+") to fdopen(fd, "r+").
It was pointed out by Basinilya in Issue 30 that the manual does not specify
"rw+" (and this causes problems on Solaris). Since mkstemp should have already
created the file, use "r+" for opening the fd in read/write mode.
git-svn-id: http://opkg.googlecode.com/svn/trunk@345
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 20 Nov 2009 03:35:58 +0000 (03:35 +0000)]
Rename loop iterater, so that it doesn't clash with a variable of greater scope.
git-svn-id: http://opkg.googlecode.com/svn/trunk@344
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 20 Nov 2009 03:35:47 +0000 (03:35 +0000)]
Iterate the whole depends array, in the unlikely event that pre_depends_count!=0
git-svn-id: http://opkg.googlecode.com/svn/trunk@343
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 20 Nov 2009 03:02:25 +0000 (03:02 +0000)]
Respect the --with-opkglibdir configure switch in update-alternatives.
From John L. Chmielewski <jlcster@gmail.com>.
git-svn-id: http://opkg.googlecode.com/svn/trunk@342
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Fri, 20 Nov 2009 01:20:24 +0000 (01:20 +0000)]
Clean up pkg_remove_orphan_dependent() and remove_autoinstalled().
This is motivated by a desire to remove usage of depends_str, but fixes
real problems with these functions as a side effect.
pkg_remove_orphan_dependent() works as advertised now.
git-svn-id: http://opkg.googlecode.com/svn/trunk@341
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 19 Nov 2009 22:40:55 +0000 (22:40 +0000)]
Fix hang in waitpid, exposed by r310. Patch from Enrico Scholz
<enrico.scholz@informatik.tu-chemnitz.de>, his analysis follows.
libbb/unarchive.c: prevent opkg hang when subprocess is stuck in a
write() call on a filled pipe and main process (which assumes that end
of data from pipe has been reached) waits for this died subprocess.
This patch swaps the original wait(pid) + close(pipe) sequencse so
that pipe is closed first.
The 'ar' code path has been fixed too by breaking the loop when
requested data have been found. Previously, the loop continued at
the (wrongly calculated) next position in the stream. The patch
moves the stream cleanup at a better place.
Variable declarations were moved to inner scopes too to ease detection
of broken deallocation.
NOTE: the
| f = fdopen(...);
| while (... /* do fread(f) */ ...) { /* ==1== */
| /* this is done in gz_open() */
| pid = fork();
| if (pid == 0) {
| fread(f); /* ==2== */
| _exit(0);
| }
| }
code looks problematic because '==2==' might update f's internal
buffer. As ==2== is done in an own process, these changes are not
seen by ==1==. It works only because gz_open() is called not more
than one time and the loops break (after the patch).
git-svn-id: http://opkg.googlecode.com/svn/trunk@340
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 19 Nov 2009 06:39:32 +0000 (06:39 +0000)]
Plug a leak.
git-svn-id: http://opkg.googlecode.com/svn/trunk@339
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 19 Nov 2009 06:29:58 +0000 (06:29 +0000)]
Make the Auto-Installed field useful.
git-svn-id: http://opkg.googlecode.com/svn/trunk@338
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 19 Nov 2009 04:41:29 +0000 (04:41 +0000)]
Free some strings as soon as they are parsed to save memory.
git-svn-id: http://opkg.googlecode.com/svn/trunk@337
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 19 Nov 2009 00:24:08 +0000 (00:24 +0000)]
Simplify hash_table somewhat.
- Use djb2 hash http://www.cse.yorku.ca/~oz/hash.html
Performs similarly to the existing function, but removes the need for a prime
number of buckets. Doesn't need to do an strlen every insert either.
- Add some more heuristics. Collected in realtime (cheap), no postprocessing.
git-svn-id: http://opkg.googlecode.com/svn/trunk@336
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 19 Nov 2009 00:13:51 +0000 (00:13 +0000)]
Assume a similar problem exists with this fdopen as fixed with r333.
git-svn-id: http://opkg.googlecode.com/svn/trunk@335
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
graham.gower [Thu, 19 Nov 2009 00:13:41 +0000 (00:13 +0000)]
I'm sure that should have been buf0len.
git-svn-id: http://opkg.googlecode.com/svn/trunk@334
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
pixdamix [Wed, 18 Nov 2009 16:02:23 +0000 (16:02 +0000)]
Fix a bug introduced in r323.
fdopen(fd, "rw") can cause a bad file descriptor error.
git-svn-id: http://opkg.googlecode.com/svn/trunk@333
e8e0d7a0-c8d9-11dd-a880-
a1081c7ac358
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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