oweals/opkg-lede.git
15 years agomalloc -> xmalloc
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

15 years agoMinor cleanup for opkg_upgrade.c
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

15 years agoPropagate errors upwards.
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

15 years agoVarious clean ups.
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

15 years agoReturn void, not int.
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

15 years agoFix duplicate and add a name.
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

15 years agoAdd a list of Contributors (appologies to any missed)
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

15 years agoPlug leaks found when using --force-removal-of-dependent-packages.
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

15 years agoVarious cleanups in opkg_remove.{c,h}
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

15 years agoVarious cleanups for pkg.{c,h}.
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

15 years agoOne more TODO.
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

15 years agoAdd vim swp files.
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

15 years agoRemove unused functions. Shuffle things around and remove forward declarations.
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

15 years agoMake a couple of functions static, and return void since they cannot fail.
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

15 years agoUpdate README and TODO. Add myself to AUTHORS.
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

15 years agoAdd a .gitignore file for the ones using git-svn
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

15 years agoFix warning on 64bit arches.
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

15 years agoshave: making the autotools output sane
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

15 years agoClean up opkg_depends_cmd() and opkg_what_depends_conflicts_cmd().
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

15 years agoDo the right thing if we have a version but no constraint.
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

15 years agoProvide a more useful comment.
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

15 years agoRemove the purge command. Undocumented and only duplicates remove functionality.
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

15 years agoRemove list_pending command. Undocumented and the pending_dir was unpopulated.
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

15 years agoRemove dead code in opkg_remove_cmd().
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

15 years agoRemove useless memory allocation and strcpy.
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

15 years agoRemove remaining uses of pkg->*_str arrays and free() them after parsing.
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

15 years agoFix a leak found when using --force-reinstall.
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

15 years agoThere should be a space before the bracket.
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

15 years agoFix pkg_depend_str() to not use pkg->depends_str.
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

15 years agoThere is no need to use a buffer at all.
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

15 years agoAllow to install a package from a read-only dir
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

15 years agoFix an unfortunate typo.
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

15 years agoClean up the help output.
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

15 years agoAdd opkg config file option for tmp_dir.
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

15 years agoDon't leak the ar_header or the tar_header.
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

15 years agoAdd some error checking on fputs.
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

15 years agoChange fdopen(fd, "rw+") to fdopen(fd, "r+").
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

15 years agoRename loop iterater, so that it doesn't clash with a variable of greater scope.
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

15 years agoIterate the whole depends array, in the unlikely event that pre_depends_count!=0
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

15 years agoRespect the --with-opkglibdir configure switch in update-alternatives.
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

15 years agoClean up pkg_remove_orphan_dependent() and remove_autoinstalled().
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

15 years agoFix hang in waitpid, exposed by r310. Patch from Enrico Scholz
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

15 years agoPlug a leak.
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

15 years agoMake the Auto-Installed field useful.
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

15 years agoFree some strings as soon as they are parsed to save memory.
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

15 years agoSimplify hash_table somewhat.
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

15 years agoAssume a similar problem exists with this fdopen as fixed with r333.
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

15 years agoI'm sure that should have been buf0len.
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

15 years agoFix a bug introduced in r323.
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

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