Send commitlog mailing list submissions to
        commitlog@lists.openmoko.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. Openmoko's OpenEmbedded repository. This is used to build the
      Openmoko distribution: Changes to 'org.openmoko.dev'
      ([EMAIL PROTECTED])
   2. r4845 - in developers/werner/ahrt/host/tmc: demo lib
      ([EMAIL PROTECTED])
   3. r4846 - developers/werner/wlan-resume ([EMAIL PROTECTED])
   4. Openmoko's OpenEmbedded repository. This is used to build the
      Openmoko distribution: Changes to 'org.openmoko.dev'
      ([EMAIL PROTECTED])
   5. r4847 - trunk/src/target/opkg/libopkg ([EMAIL PROTECTED])
   6. r4848 - trunk/src/target/opkg/libopkg ([EMAIL PROTECTED])
   7. r4849 - trunk/src/target/opkg/libopkg ([EMAIL PROTECTED])
--- Begin Message ---
 packages/e17/e-wm/e-wm-config-notify.patch     |  106 ++++++++++++++++++++++++
 packages/e17/e-wm_svn.bb                       |    3 +-
 packages/e17/illume/illume-config-notify.patch |   75 +++++++++++++++++
 packages/e17/illume_svn.bb                     |    7 +-
 packages/efl1/etk_svn.bb                       |    8 +-
 5 files changed, 192 insertions(+), 7 deletions(-)

New commits:
commit 065e1ce5616861e885d8dfa345562377ec3c488c
Author: John Lee <[EMAIL PROTECTED]>
Date:   Thu Dec 4 18:54:22 2008 +0800

    etk_svn.bb: make the patches apply to r36882 only.
    
        ...because they were already applied upstream.  Did not
        increase PR because it doesn't require a rebuild.

commit c6994deaa633e7bf995b6a30af411348d94e5876
Author: John Lee <[EMAIL PROTECTED]>
Date:   Thu Dec 4 18:51:55 2008 +0800

    e-wm, illume: apply raster's patch to fix #1946




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-12-04 12:45:48 +0100 (Thu, 04 Dec 2008)
New Revision: 4845

Modified:
   developers/werner/ahrt/host/tmc/demo/dxplore.py
   developers/werner/ahrt/host/tmc/lib/dxplore.py
   developers/werner/ahrt/host/tmc/lib/scope.py
   developers/werner/ahrt/host/tmc/lib/wave.py
Log:
Highlights:

- waves can now be labeled (labels are stored when saving and can be displayed
  in dxplore)
- a user-defined origin in dxplore is now marked with a red triangle

Details:

- lib/wave.py: waves now have an attribute "label" containing their name
- lib/wave.py (wave.save, wave.load, waves.save, waves.load): save/load label
  to/from files
- lib/wave.py (wave.unary, wave.binary, analog.digitize): propagate label to
  resulting wave
- lib/dxplore.py: display channel labels and moved some literal geometry
  constants to global variables
- lib/dxplore.py (channel.redraw_zoom): deleting zoom waveform in window "w"
  instead of "wz" produced overlapped waveforms when redrawing the zoom
- lib/dxplore.py: add red marker when setting user-defined origin
- demo/dxplore.py: commit long-pending update to "new-style" data format
- demo/dxplore.py: propagate labels



Modified: developers/werner/ahrt/host/tmc/demo/dxplore.py
===================================================================
--- developers/werner/ahrt/host/tmc/demo/dxplore.py     2008-12-03 15:33:52 UTC 
(rev 4844)
+++ developers/werner/ahrt/host/tmc/demo/dxplore.py     2008-12-04 11:45:48 UTC 
(rev 4845)
@@ -27,9 +27,14 @@
 w.load(argv[1])
 
 dig = []
-for wv in w[1:]:
+
+# old-style format
+if len(w) == 7:
+    w.pop(0)
+
+for wv in w:
     dig.append(wv.digitize(0.5))
-#    dig[-1].debounce(100e-9)
+    dig[-1].debounce(900e-9)
 
 min = dig[0].sample_step()
 for d in dig[1:]:
@@ -37,12 +42,19 @@
     if step is not None and step < min:
        min = step
 
+if min is None:
+    min = 1
+
 da = []
 for d in dig:
     a = d.sample(min)
 #    print len(a)
-    if len(a) >= 1500:
-       da.append(a)
+    da.append(a)
 
+lbl = []
+for wv in w:
+    lbl.append(wv.label)
+
 da.reverse()
-dxplore(da, dig[0].start(), min, argv[1])
+lbl.reverse()
+dxplore(da, dig[0].start(), min, argv[1], labels = lbl)

Modified: developers/werner/ahrt/host/tmc/lib/dxplore.py
===================================================================
--- developers/werner/ahrt/host/tmc/lib/dxplore.py      2008-12-03 15:33:52 UTC 
(rev 4844)
+++ developers/werner/ahrt/host/tmc/lib/dxplore.py      2008-12-04 11:45:48 UTC 
(rev 4845)
@@ -29,6 +29,11 @@
 from string import maketrans
 
 
+channel_y_step = 55
+channel_y_offset = 15
+channel_y_height = 20
+
+
 class channel:
 
     color_normal = "green"
@@ -38,13 +43,16 @@
     decode_color = "white"
     decode_bg_color = "#4040ff"
     decode_font = "-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*"
+    label_color = "white"
+    label_font = "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*"
 
-    def __init__(self, main, number, data):
+    def __init__(self, main, number, data, label):
        self.main = main
        self.number = number
        self.tag = "d_%d" % number
        self.zoom_tag = "d_z_%d" % number
        self.d = data
+       self.label = label 
        self.edits = []
        self.draw()
 
@@ -52,6 +60,11 @@
        if self.main.pos0 > len(self.d):
            return
 
+       if self.label:
+           self.main.w.create_text(2, self.y(1)-1, anchor = "sw",
+           text = self.label,
+           fill = self.label_color, font = self.label_font,
+           tags = "d_lbl_"+self.tag)
        for pos in self.edits:
            if pos < self.main.pos0:
                break
@@ -94,19 +107,21 @@
          fill = self.color_normal, tags = self.zoom_tag, *line)
 
     def redraw_zoom(self):
-       self.main.w.delete(self.zoom_tag)
+       self.main.wz.delete(self.zoom_tag)
        self.draw_zoom()
        
     def redraw(self):
        self.main.w.delete(self.tag)
        self.main.w.delete("d_ed_"+self.tag)
+       self.main.w.delete("d_lbl_"+self.tag)
        self.draw()
 
     def x(self, sample):
        return int(round(self.main.x0+(sample-self.main.pos0)*self.main.mag))
 
     def y(self, value):
-       return self.number*50-value*20+25
+       return self.number*channel_y_step+channel_y_offset+channel_y_height- \
+         value*20
 
     def zoom_y(self, value):
        return self.number*6-value*2+5
@@ -347,6 +362,7 @@
     selection_color = "#808080"
     data_color = "white"
     zoom_color = "#808080"
+    user_marker_color = "red"
 
     tick_font = "-*-helvetica-medium-r-*-*-10-*-*-*-*-*-*-*",
     tick_color = "#c0c0c0"
@@ -354,13 +370,13 @@
 
     si = ("p", "n", "u", "m", "", "k", "M", "G", "T")
 
-    def __init__(self, master, d, t0, sample_step):
+    def __init__(self, master, d, t0, sample_step, labels):
        channels = len(d)
        self.samples = len(d[0])
        self.t0 = t0
        self.sample_step = sample_step
        self.xres = self.samples
-       self.yres = channels*50
+       self.yres = channels*channel_y_step+channel_y_offset-5
        self.zres = channels*6+2
        self.geometry()
        self.w3 = self.control_window(master)
@@ -374,7 +390,11 @@
        self.ch = []
        self.cur = cursor(self)
        for ch in range(0, channels):
-           self.ch.append(channel(self, ch, d[ch]))
+           if labels is None:
+               label = None
+           else:
+               label = labels[ch]
+           self.ch.append(channel(self, ch, d[ch], label))
            self.decoder_menu(self.w3, self.ch[-1], ch)
        self.selected = None
        self.update_zoom()
@@ -457,7 +477,7 @@
     def decoder_menu(self, master, ch, n):
        mb = Menubutton(master, direction = RIGHT, text = decoders[0][0],
          relief = FLAT, width = 16)
-       mb.place(x = 3, y = 50*n+3+self.zres+2)
+       mb.place(x = 3, y = channel_y_step*n+channel_y_offset-3+self.zres+2)
        mb.menu = Menu(mb, tearoff = 0)
        mb["menu"] = mb.menu
 
@@ -482,7 +502,7 @@
        self.measure_width()
 
     def move_y(self, y):
-       ny = y/50
+       ny = y/channel_y_step
        if ny >= len(self.ch):
            return
        if self.selected is not None:
@@ -549,13 +569,23 @@
        self.center(event)
 
     def user_coord(self, event):
+       self.w.delete("user")
        if self.user_pos is None:
            self.user_pos = self.cur.pos
            self.meas_user.show(0)
+           self.w.create_polygon(0, 0, 0, 0,
+             fill = self.user_marker_color, outline = "", tags = "user")
+           self.move_user()
        else:
            self.user_pos = None
            self.meas_user.hide()
 
+    def move_user(self):
+       if self.user_pos is not None:
+           x = self.ch[0].x(self.user_pos)
+           self.w.coords("user",
+             x-7, self.yres+1, x, self.yres-7, x+7, self.yres+1)
+
     def reset(self):
        end = (self.samples-self.pos0)*self.mag
        # Entire waveform is on screen
@@ -588,6 +618,7 @@
            ch.redraw()
        self.cur.move(self.cur.x)
        self.update_zoom()
+       self.move_user()
 
     def update_zoom(self):
        self.wz.coords(self.zoom_area,
@@ -708,14 +739,20 @@
        self.cur.move(self.cur.x)
        
 
+#
+# @@@ The interface is a little ugly with waves containing data and labels,
+# but dxplore separating the two. Perhaps the future common wrapper will make
+# this more palatable.
+#
+
 class dxplore:
 
-    def __init__(self, channels, t0, sample_step, title = None):
+    def __init__(self, channels, t0, sample_step, title = None, labels = None):
        self.master = Tk()
        if title is not None:
            self.master.title(title)
        self.master.resizable(1, 0)
-       self.main = main_window(self.master, channels, t0, sample_step)
+       self.main = main_window(self.master, channels, t0, sample_step, labels)
        self.master.bind("q", self.quit)
        mainloop()
 

Modified: developers/werner/ahrt/host/tmc/lib/scope.py
===================================================================
--- developers/werner/ahrt/host/tmc/lib/scope.py        2008-12-03 15:33:52 UTC 
(rev 4844)
+++ developers/werner/ahrt/host/tmc/lib/scope.py        2008-12-04 11:45:48 UTC 
(rev 4845)
@@ -388,10 +388,12 @@
        for ch in channels:
            if isinstance(ch, channel):
                res.append(self.download_wave(ch, start, end, step))
+               res[-1].label = ch.name
            else:
                if la is None:
                    la = self.download_la(start, end, step)
                res.append(la[ch])
+               res[-1].label = "D"+str(ch)
        return res
 
     # WORK IN PROGRESS. INTERFACE WILL CHANGE !

Modified: developers/werner/ahrt/host/tmc/lib/wave.py
===================================================================
--- developers/werner/ahrt/host/tmc/lib/wave.py 2008-12-03 15:33:52 UTC (rev 
4844)
+++ developers/werner/ahrt/host/tmc/lib/wave.py 2008-12-04 11:45:48 UTC (rev 
4845)
@@ -60,6 +60,8 @@
        f = open(name, ("w", "a")[append])
        if append:
            print >>f
+       if self.label is not None:
+           print >>f, "# TMC-Label:", self.label
        for xy in self:
            print >>f, xy[0], xy[1]
        f.close()
@@ -67,6 +69,8 @@
     def load(self, name, step = None):
        self.__init__()
        empty = re.compile("^\s*(#.*)$")
+       # note: an empty label counts as no label
+       label = re.compile("^#\s*TMC-Label:\s+(\S+)\s*$")
        if step is None:
            numbers = re.compile("^\s*(\S+)\s*(\S+)\s*")
        else:
@@ -78,6 +82,9 @@
            if line == "":
                break
            if empty.match(line):
+               m = label.match(line)
+               if m is not None:
+                   self.label = m.group(1)
                continue
            m = numbers.match(line)
            if m is None:
@@ -100,12 +107,20 @@
 
     def unary(self, op):
        res = analog()
+       res.label = self.label
        for p in self:
            res.append(float(p[0]), float(op(p[1])))
        return res
 
     def binary(self, other, op):
        res = analog()
+       s = self.label
+       if not s:
+           s = ""
+       if other.label:
+           if s:
+               s += "_"
+           s += other.label
        if isinstance(self, wave):
            if isinstance(other, wave):
                for v in waves(self, other).iterate():
@@ -238,25 +253,41 @@
        f = open(name, ("w", "a")[append])
        if append:
            print >>f
+
+       s = ""
+       for w in self:
+           if s:
+               s += ", "
+           if w.label is not None:
+               s += w.label
+       if s:
+           print >>f, "# TMC-Label:", s
+
        for v in self.iterate():
            for i in range(0, len(v)-1):
                print >>f, v[i],
            print >>f, v[-1]
+
        f.close()
 
     def load(self, name, step = None):
        list.__init__(self)
        empty = re.compile("^\s*(#.*)$")
+       label = re.compile("^#\s*TMC-Label:\s+((\S*\s*,\s*)*\S*)?\s*$")
        space = re.compile("\s+")
        first = True
        skip = step is None
        t = 0
+       labels = None
        f = open(name, "r")
        while True:
            line = f.readline()
            if line == "":
                break
            if empty.match(line):
+               m = label.match(line);
+               if m is not None:
+                   labels = m.group(1).split(",")
                continue
            m = space.split(line.lstrip().rstrip())
            if first:
@@ -274,6 +305,13 @@
                    self[i].append(t, float(m[i]))
                t += step
        f.close()
+       if labels is None:
+           return
+       one_label = re.compile("\s*(\S+)\s*")
+       for i in range(0, len(labels)):
+           m = one_label.match(labels[i])
+           if m is not None:
+               self[i].label = m.group(1)
 
 
 # === Analog waves ============================================================
@@ -319,6 +357,7 @@
 
     def __init__(self):
        self.data = []
+       self.label = None
 
     def start(self):
        if len(self.data) == 0:
@@ -364,6 +403,7 @@
        if high < low:
            raise hell
        res = digital()
+       res.label = self.label
        for p in self.data:
            if p[1] >= high:
                res.append(p[0], 1)
@@ -403,6 +443,7 @@
        self.initial = None
        self.data = []
        self.t_end = None
+       self.label = None
 
     def start(self):
        if self.initial is None:




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2008-12-04 12:47:54 +0100 (Thu, 04 Dec 2008)
New Revision: 4846

Modified:
   developers/werner/wlan-resume/vds.py
Log:
Use labels. Awkward descriptions, goodbye :-)



Modified: developers/werner/wlan-resume/vds.py
===================================================================
--- developers/werner/wlan-resume/vds.py        2008-12-04 11:45:48 UTC (rev 
4845)
+++ developers/werner/wlan-resume/vds.py        2008-12-04 11:47:54 UTC (rev 
4846)
@@ -85,6 +85,14 @@
        t0 = time.time()
 #      w = s.wave([1, 2, 3, 4, 5, 6], start = -0.1e-3, end = 2e-3)
        w = s.wave([1, 2, 3, 4, 5, 6], start = -20e-3, end = 80e-3)
+
+       w[0].label = "CLK"
+       w[1].label = "CMD"
+       w[2].label = "DATA0"
+       w[3].label = "DATA1"
+       w[4].label = "DATA3"
+       w[5].label = "DATA2"
+
        t1 = time.time()
        w.save("sdio-"+id)
        t2 = time.time()




--- End Message ---
--- Begin Message ---
 packages/coreutils/coreutils_5.3.0.bb |    4 ++--
 packages/coreutils/coreutils_6.0.bb   |    4 +++-
 site/common-linux                     |    4 ++++
 3 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit e92958018fc7e8c24dcbd0ffff7943f6731785c8
Author: Holger Hans Peter Freyther <[EMAIL PROTECTED]>
Date:   Thu Dec 4 13:54:04 2008 +0100

    coreutils: Build and package df of coreutils
    
        - df can only be build if one of the many statvfs,fsusage
          was is present. These tests work by executing a test application
          and that is obviously not working out when cross compiling
        - all linux (glibc, eglibc, uclibc) should have the bsize in the
          struct statvfs... and this will enable the build of df.




--- End Message ---
--- Begin Message ---
Author: tick
Date: 2008-12-04 15:31:39 +0100 (Thu, 04 Dec 2008)
New Revision: 4847

Modified:
   trunk/src/target/opkg/libopkg/opkg_upgrade.c
Log:
opkg: trivial just indent


Modified: trunk/src/target/opkg/libopkg/opkg_upgrade.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_upgrade.c        2008-12-04 11:47:54 UTC 
(rev 4846)
+++ trunk/src/target/opkg/libopkg/opkg_upgrade.c        2008-12-04 14:31:39 UTC 
(rev 4847)
@@ -74,6 +74,6 @@
 
     free(old_version);
     free(new_version);
-     new->state_flag |= SF_USER;
-     return opkg_install_pkg(conf, new,1);
+    new->state_flag |= SF_USER;
+    return opkg_install_pkg(conf, new,1);
 }




--- End Message ---
--- Begin Message ---
Author: tick
Date: 2008-12-04 15:31:54 +0100 (Thu, 04 Dec 2008)
New Revision: 4848

Modified:
   trunk/src/target/opkg/libopkg/pkg_vec.c
Log:
opkg: using calloc to replace the malloc, initialize varaiable


Modified: trunk/src/target/opkg/libopkg/pkg_vec.c
===================================================================
--- trunk/src/target/opkg/libopkg/pkg_vec.c     2008-12-04 14:31:39 UTC (rev 
4847)
+++ trunk/src/target/opkg/libopkg/pkg_vec.c     2008-12-04 14:31:54 UTC (rev 
4848)
@@ -23,7 +23,7 @@
 
 pkg_vec_t * pkg_vec_alloc(void)
 {
-    pkg_vec_t * vec = (pkg_vec_t *)malloc(sizeof(pkg_vec_t));
+    pkg_vec_t * vec = (pkg_vec_t *)calloc(1, sizeof(pkg_vec_t));
     if (!vec) {
       fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
       return NULL;
@@ -161,7 +161,7 @@
 abstract_pkg_vec_t * abstract_pkg_vec_alloc(void)
 {
     abstract_pkg_vec_t * vec ; 
-    vec = (abstract_pkg_vec_t *)malloc(sizeof(abstract_pkg_vec_t));
+    vec = (abstract_pkg_vec_t *)calloc(1, sizeof(abstract_pkg_vec_t));
     if (!vec) {
       fprintf(stderr, "%s: out of memory\n", __FUNCTION__);
       return NULL;




--- End Message ---
--- Begin Message ---
Author: tick
Date: 2008-12-05 04:37:48 +0100 (Fri, 05 Dec 2008)
New Revision: 4849

Modified:
   trunk/src/target/opkg/libopkg/args.c
   trunk/src/target/opkg/libopkg/opkg.c
   trunk/src/target/opkg/libopkg/opkg_cmd.c
   trunk/src/target/opkg/libopkg/opkg_upgrade.c
   trunk/src/target/opkg/libopkg/opkg_upgrade.h
   trunk/src/target/opkg/libopkg/pkg_vec.h
Log:
adding list_upgradable

opkg: refactory the upgradable list


Modified: trunk/src/target/opkg/libopkg/args.c
===================================================================
--- trunk/src/target/opkg/libopkg/args.c        2008-12-04 14:31:54 UTC (rev 
4848)
+++ trunk/src/target/opkg/libopkg/args.c        2008-12-05 03:37:48 UTC (rev 
4849)
@@ -267,6 +267,7 @@
      printf("\nInformational Commands:\n");
      printf("\tlist                    List available packages and 
descriptions\n");
      printf("\tlist_installed          List all and only the installed 
packages and description \n");
+     printf("\tlist_upgradable         List all the installed and upgradable 
packages\n");
      printf("\tfiles <pkg>             List all files belonging to <pkg>\n");
      printf("\tsearch <file|regexp>            Search for a package providing 
<file>\n");
      printf("\tinfo [pkg|regexp]               Display all info for <pkg>\n");

Modified: trunk/src/target/opkg/libopkg/opkg.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg.c        2008-12-04 14:31:54 UTC (rev 
4848)
+++ trunk/src/target/opkg/libopkg/opkg.c        2008-12-05 03:37:48 UTC (rev 
4849)
@@ -929,47 +929,33 @@
 int
 opkg_list_upgradable_packages (opkg_t *opkg, opkg_package_callback_t callback, 
void *user_data)
 {
-  pkg_vec_t *all;
-  int i;
+    pkg_vec_t *all;
+    int i;
 
-  opkg_assert (opkg);
-  opkg_assert (callback);
+    opkg_assert (opkg);
+    opkg_assert (callback);
 
-  /* ensure all data is valid */
-  pkg_info_preinstall_check (opkg->conf);
+    /* ensure all data is valid */
+    pkg_info_preinstall_check (opkg->conf);
 
-  all = pkg_vec_alloc ();
-  pkg_hash_fetch_available (&opkg->conf->pkg_hash, all);
-  for (i = 0; i < all->len; i++)
-  {
-    pkg_t *old, *new;
-    int cmp;
-    opkg_package_t *package;
+    all = opkg_upgrade_all_list_get (opkg->conf);
+    for (i = 0; i < all->len; i++)
+    {
+        pkg_t *old, *new;
+        opkg_package_t *package;
 
-    old = all->pkgs[i];
-    
-    if (old->state_status != SS_INSTALLED)
-      continue;
+        old = all->pkgs[i];
 
-    new = pkg_hash_fetch_best_installation_candidate_by_name(opkg->conf, 
old->name, NULL);
-    if (new == NULL) {
-      /* XXX: Notice: Assuming locally install package is up to date */
-      continue;
-    }
-          
-    cmp = pkg_compare_versions(old, new);
+        new = pkg_hash_fetch_best_installation_candidate_by_name(opkg->conf, 
old->name, NULL);
 
-    if (cmp < 0)
-    {
-      package = old_pkg_to_new (new);
-      callback (opkg, package, user_data);
-      opkg_package_free (package);
+        package = old_pkg_to_new (new);
+        callback (opkg, package, user_data);
+        opkg_package_free (package);
     }
-  }
 
-  pkg_vec_free (all);
+    pkg_vec_free (all);
 
-  return 0;
+    return 0;
 }
 
 opkg_package_t*

Modified: trunk/src/target/opkg/libopkg/opkg_cmd.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_cmd.c    2008-12-04 14:31:54 UTC (rev 
4848)
+++ trunk/src/target/opkg/libopkg/opkg_cmd.c    2008-12-05 03:37:48 UTC (rev 
4849)
@@ -55,6 +55,7 @@
 static int opkg_install_pending_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_install_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_list_installed_cmd(opkg_conf_t *conf, int argc, char **argv);
+static int opkg_list_upgradable_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_remove_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_purge_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_flag_cmd(opkg_conf_t *conf, int argc, char **argv);
@@ -81,6 +82,7 @@
      {"upgrade", 0, (opkg_cmd_fun_t)opkg_upgrade_cmd},
      {"list", 0, (opkg_cmd_fun_t)opkg_list_cmd},
      {"list_installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd},
+     {"list_upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd},
      {"info", 0, (opkg_cmd_fun_t)opkg_info_cmd},
      {"flag", 1, (opkg_cmd_fun_t)opkg_flag_cmd},
      {"status", 0, (opkg_cmd_fun_t)opkg_status_cmd},
@@ -782,6 +784,26 @@
      return 0;
 }
 
+static int opkg_list_upgradable_cmd(opkg_conf_t *conf, int argc, char **argv) 
+{
+    pkg_vec_t *all = opkg_upgrade_all_list_get(conf);
+    pkg_t *_old_pkg, *_new_pkg;
+    char *old_v, *new_v;
+    int i;
+    for (i=0;i<all->len;i++) {
+        _old_pkg = all->pkgs[i];
+        _new_pkg = pkg_hash_fetch_best_installation_candidate_by_name(conf, 
_old_pkg->name, NULL);
+        old_v = pkg_version_str_alloc(_old_pkg);
+        new_v = pkg_version_str_alloc(_new_pkg);
+        if (opkg_cb_list)
+            opkg_cb_list(_old_pkg->name, new_v, old_v, _old_pkg->state_status, 
p_userdata);
+        free(old_v);
+        free(new_v);
+    }
+    pkg_vec_free(all);
+    return 0;
+}
+
 static int opkg_info_status_cmd(opkg_conf_t *conf, int argc, char **argv, int 
installed_only)
 {
      int i;

Modified: trunk/src/target/opkg/libopkg/opkg_upgrade.c
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_upgrade.c        2008-12-04 14:31:54 UTC 
(rev 4848)
+++ trunk/src/target/opkg/libopkg/opkg_upgrade.c        2008-12-05 03:37:48 UTC 
(rev 4849)
@@ -77,3 +77,35 @@
     new->state_flag |= SF_USER;
     return opkg_install_pkg(conf, new,1);
 }
+
+
+
+pkg_vec_t *opkg_upgrade_all_list_get(opkg_conf_t *conf) {
+    pkg_vec_t *all, *ans;
+    int i;
+
+    /* ensure all data is valid */
+    pkg_info_preinstall_check (conf);
+
+    all = pkg_vec_alloc ();
+    ans = pkg_vec_alloc ();
+    pkg_hash_fetch_all_installed (&conf->pkg_hash, all);
+    for (i = 0; i < all->len; i++)
+    {
+        pkg_t *old, *new;
+        int cmp;
+
+        old = all->pkgs[i];
+        new = pkg_hash_fetch_best_installation_candidate_by_name(conf, 
old->name, NULL);
+
+        if (new == NULL)
+            continue;
+
+        cmp = pkg_compare_versions(old, new);
+
+        if ( cmp < 0 )
+            pkg_vec_insert(ans, old);
+    }
+    pkg_vec_free (all);
+    return ans;
+}

Modified: trunk/src/target/opkg/libopkg/opkg_upgrade.h
===================================================================
--- trunk/src/target/opkg/libopkg/opkg_upgrade.h        2008-12-04 14:31:54 UTC 
(rev 4848)
+++ trunk/src/target/opkg/libopkg/opkg_upgrade.h        2008-12-05 03:37:48 UTC 
(rev 4849)
@@ -14,3 +14,4 @@
 */
 
 int opkg_upgrade_pkg(opkg_conf_t *conf, pkg_t *old);
+pkg_vec_t *opkg_upgrade_all_list_get(opkg_conf_t *conf);

Modified: trunk/src/target/opkg/libopkg/pkg_vec.h
===================================================================
--- trunk/src/target/opkg/libopkg/pkg_vec.h     2008-12-04 14:31:54 UTC (rev 
4848)
+++ trunk/src/target/opkg/libopkg/pkg_vec.h     2008-12-05 03:37:48 UTC (rev 
4849)
@@ -42,7 +42,6 @@
 void pkg_vec_free(pkg_vec_t *vec);
 void marry_two_packages(pkg_t * newpkg, pkg_t * oldpkg);
 
-void pkg_vec_add(pkg_vec_t *vec, pkg_t *pkg);
 /* pkg_vec_insert_merge: might munge pkg.
 *  returns the pkg that is in the pkg graph */
 pkg_t *pkg_vec_insert_merge(pkg_vec_t *vec, pkg_t *pkg, int set_status, 
opkg_conf_t *conf);




--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to