summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Remove useless memory allocation and strcpy.graham.gower2009-11-231-5/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@357 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove remaining uses of pkg->*_str arrays and free() them after parsing.graham.gower2009-11-232-36/+39
| | | | | | 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
* Fix a leak found when using --force-reinstall.graham.gower2009-11-231-2/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@355 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* There should be a space before the bracket.graham.gower2009-11-231-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@354 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix pkg_depend_str() to not use pkg->depends_str.graham.gower2009-11-233-48/+71
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@353 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* There is no need to use a buffer at all.graham.gower2009-11-231-12/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@352 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Allow to install a package from a read-only dirpixdamix2009-11-234-6/+8
| | | | | | | | 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
* Fix an unfortunate typo.graham.gower2009-11-232-2/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@350 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Clean up the help output.graham.gower2009-11-233-64/+57
| | | | | | | | | | | | | - 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
* Add opkg config file option for tmp_dir.graham.gower2009-11-222-6/+11
| | | | | | | | | | 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
* Don't leak the ar_header or the tar_header.graham.gower2009-11-221-0/+3
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@347 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Add some error checking on fputs.graham.gower2009-11-221-1/+5
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@346 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Change fdopen(fd, "rw+") to fdopen(fd, "r+").graham.gower2009-11-221-2/+2
| | | | | | | | 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
* Rename loop iterater, so that it doesn't clash with a variable of greater scope.graham.gower2009-11-191-3/+3
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@344 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Iterate the whole depends array, in the unlikely event that pre_depends_count!=0graham.gower2009-11-192-3/+17
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@343 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Respect the --with-opkglibdir configure switch in update-alternatives.graham.gower2009-11-192-1/+2
| | | | | | From John L. Chmielewski <jlcster@gmail.com>. git-svn-id: http://opkg.googlecode.com/svn/trunk@342 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Clean up pkg_remove_orphan_dependent() and remove_autoinstalled().graham.gower2009-11-192-100/+128
| | | | | | | | 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
* Fix hang in waitpid, exposed by r310. Patch from Enrico Scholzgraham.gower2009-11-191-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <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
* Plug a leak.graham.gower2009-11-191-0/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@339 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Make the Auto-Installed field useful.graham.gower2009-11-191-0/+3
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@338 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Free some strings as soon as they are parsed to save memory.graham.gower2009-11-182-28/+48
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@337 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Simplify hash_table somewhat.graham.gower2009-11-183-68/+69
| | | | | | | | | - 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
* Assume a similar problem exists with this fdopen as fixed with r333.graham.gower2009-11-181-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@335 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* I'm sure that should have been buf0len.graham.gower2009-11-181-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@334 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix a bug introduced in r323.pixdamix2009-11-181-1/+1
| | | | | | 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
* Remove unused function.graham.gower2009-11-172-119/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@332 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix segfault while attempting to parse invalid package stream.graham.gower2009-11-171-4/+7
| | | | | | Reported by John L. Chmielewski. git-svn-id: http://opkg.googlecode.com/svn/trunk@331 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Avoid some warn_unused_result warningpixdamix2009-11-171-1/+6
| | | | | | | 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
* Fix output of whatdepends, whatsuggests and whatrecommends commands.graham.gower2009-11-171-14/+15
| | | | | | Resolves Issue 23. git-svn-id: http://opkg.googlecode.com/svn/trunk@329 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix depended_upon_by to only contain pre_depends and depends.graham.gower2009-11-171-9/+14
| | | | | | 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
* Fix depends output.graham.gower2009-11-171-5/+5
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@327 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix the warnings I created.graham.gower2009-11-161-0/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@326 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Call _exit() and not exit() from within the child process.graham.gower2009-11-162-3/+4
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@325 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Put the tmp file under conf->tmp_dir.graham.gower2009-11-161-12/+35
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@324 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Use the filename arg as a base for the temp file. Clean up function while here.graham.gower2009-11-161-14/+36
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@323 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove unused function.graham.gower2009-11-162-62/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@322 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Use the same tmp dir pattern as in opkg_update_cmd().graham.gower2009-11-161-4/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@321 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Use vfork()/execvp() instead of system().graham.gower2009-11-167-49/+59
| | | | | | 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
* Pass the correct file to diff when using an offline_root.graham.gower2009-11-161-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@319 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix pkg_get_installed_files() to work with an offline_root + dest.graham.gower2009-11-166-26/+31
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@318 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Pass the correct file_name to pkg_get_conffile().graham.gower2009-11-151-1/+5
| | | | | | | 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
* Avoid printing an annoying message by default.graham.gower2009-11-151-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@316 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove redundant function.graham.gower2009-11-151-61/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@315 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Remove dead code.graham.gower2009-11-154-58/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@314 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* atexit() isn't really appropriate for a library.graham.gower2009-11-154-8/+10
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@313 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Raise the required verbosity level for this message.graham.gower2009-11-151-2/+2
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@312 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Add a function for recursive directory removal and use that instead of xsystem.graham.gower2009-11-154-11/+84
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@311 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Don't send the gzunp_pid SIGTERM. Waiting for exit should be sufficient.graham.gower2009-11-151-4/+0
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@310 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Fix a subtle leak.graham.gower2009-11-151-1/+1
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@309 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
* Free memory in error paths.graham.gower2009-11-151-2/+8
| | | | git-svn-id: http://opkg.googlecode.com/svn/trunk@308 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358