Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Philip Black <phil.black@hillcrestlabs.com>
To: openembedded-devel@lists.openembedded.org
Subject: patch for ipkg-utils
Date: Fri, 13 Mar 2009 21:05:57 -0400	[thread overview]
Message-ID: <1236992757.7047.2.camel@pblack-linux> (raw)

I found a bug with how the arfile.py works when parsing ar files.
Basically, the code assumed whitespace delimited when it should have
been fixed sized fields.



diff -wubr ipkg-utils.old/arfile.py ipkg-utils/arfile.py
--- ipkg-utils.old/arfile.py	2009-03-13 12:45:25.937148714 -0400
+++ ipkg-utils/arfile.py	2009-03-13 12:44:59.680250619 -0400
@@ -74,7 +74,14 @@
             if l == "\n":
                 l = self.f.readline()
                 if not l: break
-            descriptor = l.split()
+            descriptor = [ l[0:15].strip() # filename 
+                                , l[16:27].strip() # timestamp
+                                , l[28:33].strip() # owner ID
+                                , l[34:39].strip() # gid
+                                , l[40:47].strip() # mode
+                                , l[48:57].strip() # size in bytes
+                                , l[58:59].strip() # file magic
+            ]
 #            print descriptor
             size = int(descriptor[5])
             memberName = descriptor[0][:-1]





                 reply	other threads:[~2009-03-14  1:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1236992757.7047.2.camel@pblack-linux \
    --to=phil.black@hillcrestlabs.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox