summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Woolley <rob.woolley@windriver.com>2017-01-26 10:17:11 -0800
committerAlejandro del Castillo <alejandro.delcastillo@ni.com>2017-01-30 13:52:45 -0600
commit1a708fd73d10c2b7677dd4cc4e017746ebbb9166 (patch)
tree5c3a2be728ba85da34c02cefb90a4fb8e1b5b417
parentb736b318fd0376389a355940bb75c6c97b3a1fe0 (diff)
downloadopkg-utils-1a708fd73d10c2b7677dd4cc4e017746ebbb9166.tar.gz
opkg-utils-1a708fd73d10c2b7677dd4cc4e017746ebbb9166.tar.bz2
opkg-utils-1a708fd73d10c2b7677dd4cc4e017746ebbb9166.zip
Check for optional terminator in archives0.3.5
Archive files have an optional '/' terminator in the member file name field. (See /usr/include/ar.h) This change makes opkg-make-index more forgiving on packages created manually with alternative tools like CPack. Signed-off-by: Rob Woolley <rob.woolley@windriver.com> Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
-rw-r--r--arfile.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/arfile.py b/arfile.py
index 1c42bc7..6e04ec3 100644
--- a/arfile.py
+++ b/arfile.py
@@ -89,7 +89,11 @@ class ArFile(object):
l = l[field_len:]
# print(descriptor)
size = int(descriptor[5])
- memberName = descriptor[0][:-1]
+ # Check for optional / terminator
+ if descriptor[0][-1] == "/":
+ memberName = descriptor[0][:-1]
+ else:
+ memberName = descriptor[0]
self.directory[memberName] = descriptor + [self.f.tell()]
# print(("read:", memberName))
if memberName == fname: