[BusyBox 0001439]: [patch] add the “ipkg” applet (package management)

bugs at busybox.net bugs at busybox.net
Mon Jul 23 12:26:05 UTC 2007


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=1439 
====================================================================== 
Reported By:                mirabilos
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   1439
Category:                   New Features
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             07-20-2007 05:43 PDT
Last Modified:              07-23-2007 05:26 PDT
====================================================================== 
Summary:                    [patch] add the “ipkg” applet (package management)
Description: 
This diff adds a version of the “ipkg” applet which is being
used as a package manager, similar to Debian’s “dpkg”, in a
few embedded appliances and distributions.

This version has been modified to not offer to diff if the
diff applet isn't selected (external diff programmes, such
as GNU diff or 4.4BSD diff, aren't considered).

====================================================================== 

---------------------------------------------------------------------- 
 vda - 07-21-07 07:41  
---------------------------------------------------------------------- 
424897 byte source is 2.5 larger that our current biggest applet, ash.c.
Sorry. 

---------------------------------------------------------------------- 
 vda - 07-21-07 07:42  
---------------------------------------------------------------------- 
Oops. make that 1.5 times larger. But still far too big. Just build it
standalone. 

---------------------------------------------------------------------- 
 mirabilos - 07-21-07 09:10  
---------------------------------------------------------------------- 
I don't think "too big" is an issue since the user still has to
select it manually. 

---------------------------------------------------------------------- 
 vda - 07-21-07 16:30  
---------------------------------------------------------------------- 
If applet is added to bbox, its quality becomes responsibility of bbox
maintainers. Low-quality code taken into the tree tends to sit there
forever with nobody fixing it.

Patch review and inclusion is _the_ point where code is cleaned up and
slimmed down.

Random examples of bugs:

+     lists_dir=(char *)malloc(1);
+     lists_dir[0]='\0';

bloaty code:

+           line = realloc(line, line_size);
+           if (line == NULL) {
+               fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
+               break;
+           }

and bad style:

+         }
+          if (( strcmp(flags,"hold")==0)||(
strcmp(flags,"noprune")==0)||
+              ( strcmp(flags,"user")==0)||( strcmp(flags,"ok")==0)) {
+             pkg->state_flag = pkg_state_flag_from_str(flags);
+          }
+/* pb_ asked this feature 03292004 */
+/* Actually I will use only this two, but this is an open for various
status */
+          if (( strcmp(flags,"installed")==0)||(
strcmp(flags,"unpacked")==0)){
+             pkg->state_status = pkg_state_status_from_str(flags);
+          }
+         ipkg_state_changed++;
+         ipkg_message(conf, IPKG_NOTICE,
+                      "Setting flags for package %s to %s\n",
+                      pkg->name, flags);
+     } 

---------------------------------------------------------------------- 
 mirabilos - 07-23-07 02:57  
---------------------------------------------------------------------- 
While I agree that the bugs should be fixed, this is
exactly why I'm submitting the patches to you (plus
making sure it won't break due to future busybox
changes). I don't even know its original authors,
but I surely won't object against bugs being fixed. 

---------------------------------------------------------------------- 
 bernhardf - 07-23-07 05:26  
---------------------------------------------------------------------- 
Also, the long option handling has to depend on ENABLE_GETOPT_LONG.

Can you please adjust accordingly (including vda's comments) and run this
through the mailing-list? TIA.

PS: You should use index_in_string_array rather than all those strcmp()
chains.
PPS: The most of struct args should be bools and not int's 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-20-07 05:43  mirabilos      New Issue                                    
07-20-07 05:43  mirabilos      Status                   new => assigned     
07-20-07 05:43  mirabilos      Assigned To               => BusyBox         
07-20-07 05:43  mirabilos      File Added: 911-ipkg.patch                    
07-21-07 07:41  vda            Note Added: 0002616                          
07-21-07 07:42  vda            Note Added: 0002617                          
07-21-07 09:10  mirabilos      Note Added: 0002623                          
07-21-07 16:30  vda            Note Added: 0002625                          
07-23-07 02:57  mirabilos      Note Added: 0002627                          
07-23-07 05:26  bernhardf      Note Added: 0002634                          
======================================================================




More information about the busybox-cvs mailing list