Hi Alejandro,

Thanks for catching that see attached.



On Fri, Dec 30, 2016 at 12:21 PM, Alejandro del Castillo <
[email protected]> wrote:

> Hi Desmond, thanks for sending the patch, works as expected.
>
> The only thing missing is your Signed-off-by line, do you mind resending
> with it?
>
> I also have a very minor comment below
>
> On 12/28/2016 01:15 PM, Desmond Correia wrote:
> > From aefa378d6a167124bdfb0b8d6c92aadb4c36fa46 Mon Sep 17 00:00:00 2001
> > From: Desmond <[email protected]
> > <mailto:[email protected]>>
> > Date: Wed, 28 Dec 2016 13:16:48 -0500
> > Subject: [opkg-utils PATCH] Added support to generate index file with
> > multiple
> >  version per package
> > To: [email protected] <mailto:[email protected]>,
> >     [email protected] <mailto:[email protected]>
> >
> > Using the -a option with opkg-make-index, you can now generate an index
> > file which will list multiple version of the same package. Added since
> > opkg now supports specifying version of package.
> > ---
> >  opkg-make-index | 16 ++++++++++++----
> >  opkg.py         |  8 +++++++-
> >  2 files changed, 19 insertions(+), 5 deletions(-)
> >
> > diff --git a/opkg-make-index b/opkg-make-index
> > index 7897918..3f757f6 100755
> > --- a/opkg-make-index
> > +++ b/opkg-make-index
> > @@ -11,7 +11,7 @@ import re
> >  verbose = 0
> >
> >  def usage():
> > -     sys.stderr.write("%s [-h] [-s] [-m] [-l Packages.filelist] [-p
> > Packages] [-r Packages.old] [-L localesdir] [-v] packagesdir\n" %
> > (sys.argv[0],))
> > +     sys.stderr.write("%s [-h] [-s] [-m] [-a] [-l Packages.filelist]
> > [-p Packages] [-r Packages.old] [-L localesdir] [-v] packagesdir\n" %
> > (sys.argv[0],))
> >       sys.exit(-1)
> >
> >  def to_morgue(filename):
> > @@ -42,7 +42,8 @@ filelist_filename = None
> >  stamplist_filename = "Packages.stamps"
> >  opt_s = 0
> >  opt_m = 0
> > -(opts, remaining_args) = getopt.getopt(sys.argv[1:], "hl:p:vsmr:L:")
> > +opt_a = 0
> > +(opts, remaining_args) = getopt.getopt(sys.argv[1:], "hl:p:vsmr:L:a")
> >  for (optkey, optval) in opts:
> >       if optkey == '-h':
> >            usage()
> > @@ -61,6 +62,8 @@ for (optkey, optval) in opts:
> >            old_filename = optval
> >       if optkey == '-L':
> >            locales_dir = optval
> > +     if optkey == '-a':
> > +          opt_a = 1
> >
> >  if ( not remaining_args ):
> >       usage()
> > @@ -120,12 +123,17 @@ for abspath in files:
> >            if (verbose):
> >                 sys.stderr.write("Reading info for package %s\n" %
> > (filename,))
> >            pkg = opkg.Package(abspath, relpath=pkg_dir)
> > -     pkg_key = ("%s:%s" % (pkg.package, pkg.architecture))
> > +
> > +     if opt_a:
> > +          pkg_key = ("%s:%s:%s" % (pkg.package, pkg.architecture,
> > pkg.version))
> > +     else:
> > +         pkg_key = ("%s:%s" % (pkg.package, pkg.architecture))
> > +
> >       if (pkg_key in packages.packages):
> >            old_filename = packages.packages[pkg_key].filename
> >       else:
> >            old_filename = ""
> > -     s = packages.add_package(pkg)
> > +     s = packages.add_package(pkg, opt_a)
> >       pkgsStamps[filename] = fnameStat.st_mtime
> >       if s == 0:
> >            if old_filename:
> > diff --git a/opkg.py b/opkg.py
> > index b0d79a6..47473da 100644
> > --- a/opkg.py
> > +++ b/opkg.py
> > @@ -501,10 +501,16 @@ class Packages(object):
> >          self.packages = {}
> >          return
> >
> > -    def add_package(self, pkg):
> > +    def add_package(self, pkg, opt_a=0):
> >          package = pkg.package
> >          arch = pkg.architecture
> >          name = ("%s:%s" % (package, arch))
>
> since you are defining name on the else case, you can delete the line above
>
> > +        ver = pkg.version
> > +        if opt_a:
> > +            name = ("%s:%s:%s" % (package, arch, ver))
> > +        else:
> > +            name = ("%s:%s" % (package, arch))
> > +
> >          if (name not in self.packages):
> >              self.packages[name] = pkg
> >
> > --
> > 2.7.4
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "opkg-devel" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to [email protected]
> > <mailto:[email protected]>.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> Cheers,
>
> Alejandro
>



-- 

Desmond Correia
From bba7ceafaebe2fdd213fd1298b4f9760fafedda9 Mon Sep 17 00:00:00 2001
From: desmond <[email protected]>
Date: Fri, 30 Dec 2016 12:35:27 -0500
Subject: [opkg-utils PATCH] Added support to generate index file with multiple
 version per package
To: [email protected],
    [email protected]

Signed-off-by: desmond <[email protected]>
Using the -a option with opkg-make-index, you can now generate an index file which will list multiple version of the same package. Added since opkg now supports specifying version of package.
---
 opkg-make-index | 16 ++++++++++++----
 opkg.py         |  9 +++++++--
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/opkg-make-index b/opkg-make-index
index 7897918..3f757f6 100755
--- a/opkg-make-index
+++ b/opkg-make-index
@@ -11,7 +11,7 @@ import re
 verbose = 0
 
 def usage():
-     sys.stderr.write("%s [-h] [-s] [-m] [-l Packages.filelist] [-p Packages] [-r Packages.old] [-L localesdir] [-v] packagesdir\n" % (sys.argv[0],))
+     sys.stderr.write("%s [-h] [-s] [-m] [-a] [-l Packages.filelist] [-p Packages] [-r Packages.old] [-L localesdir] [-v] packagesdir\n" % (sys.argv[0],))
      sys.exit(-1)
 
 def to_morgue(filename):
@@ -42,7 +42,8 @@ filelist_filename = None
 stamplist_filename = "Packages.stamps"
 opt_s = 0
 opt_m = 0
-(opts, remaining_args) = getopt.getopt(sys.argv[1:], "hl:p:vsmr:L:")
+opt_a = 0
+(opts, remaining_args) = getopt.getopt(sys.argv[1:], "hl:p:vsmr:L:a")
 for (optkey, optval) in opts:
      if optkey == '-h': 
           usage()
@@ -61,6 +62,8 @@ for (optkey, optval) in opts:
           old_filename = optval
      if optkey == '-L':
           locales_dir = optval
+     if optkey == '-a':
+          opt_a = 1
 
 if ( not remaining_args ):
      usage()
@@ -120,12 +123,17 @@ for abspath in files:
           if (verbose):
                sys.stderr.write("Reading info for package %s\n" % (filename,))
           pkg = opkg.Package(abspath, relpath=pkg_dir)
-     pkg_key = ("%s:%s" % (pkg.package, pkg.architecture))
+
+     if opt_a:
+          pkg_key = ("%s:%s:%s" % (pkg.package, pkg.architecture, pkg.version))
+     else:
+         pkg_key = ("%s:%s" % (pkg.package, pkg.architecture))
+
      if (pkg_key in packages.packages):
           old_filename = packages.packages[pkg_key].filename
      else:
           old_filename = ""
-     s = packages.add_package(pkg)
+     s = packages.add_package(pkg, opt_a)
      pkgsStamps[filename] = fnameStat.st_mtime
      if s == 0:
           if old_filename:
diff --git a/opkg.py b/opkg.py
index b0d79a6..2ecac8a 100644
--- a/opkg.py
+++ b/opkg.py
@@ -501,10 +501,15 @@ class Packages(object):
         self.packages = {}
         return
 
-    def add_package(self, pkg):
+    def add_package(self, pkg, opt_a=0):
         package = pkg.package
         arch = pkg.architecture
-        name = ("%s:%s" % (package, arch))
+        ver = pkg.version
+        if opt_a:
+            name = ("%s:%s:%s" % (package, arch, ver))
+        else:
+            name = ("%s:%s" % (package, arch))
+
         if (name not in self.packages):
             self.packages[name] = pkg
         
-- 
2.7.4

-- 
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to