summaryrefslogtreecommitdiffstats
path: root/patches/ipkg-utils-050831/0010-ipkg-make-ar-deterministic.patch
blob: 61196502b6a12bb8fd2d2c8e8d79e381cb1639e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Tue, 24 May 2011 07:56:53 +0200
Subject: [PATCH] ipkg: make ar deterministic

Based on a patch from Darren Hutchinson <dhutchinson@google.com>

From the original description:

I had a strange problem when I tried to create an image.
The last part of the error message was:

File
"<path to ptxdist>/projects/<project name>/ \
platform-<project name>/sysroot-host/lib/python2.6/site-packages/arfile.py",
line 79, in _scan
    size = int(descriptor[5])
ValueError: invalid literal for int() with base 10: '`'

The problem eventually turned out to be that arfile.py has trouble parsing AR
files created with a UID >99999 - it relies on the (ascii) AR header fields
using one digit less than their allocated sizes so it can the padding
space to split() them.

The original patch added the option 'D' to ar to set the UID and GID to
zero. This option is not available in older versions of ar. chown to 0:0
instead. This is possible because the everything is run in fakeroot.

Not for upstream!

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 ipkg-build |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/ipkg-build b/ipkg-build
index 77367ac..7234e64 100755
--- a/ipkg-build
+++ b/ipkg-build
@@ -235,7 +235,10 @@ echo "2.0" > $tmp_dir/debian-binary
 pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
 rm -f $pkg_file
 if [ "$outer" = "ar" ] ; then
-  ( cd $tmp_dir && ar -crf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz )
+  # chown the content to "0:0".  files. This is needed as high UID values (>
+  # 99999) cause problems when parsing ar file headers
+  ( cd $tmp_dir && chown 0:0 ./debian-binary ./data.tar.gz ./control.tar.gz &&
+	ar -crf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz )
 else
   ( cd $tmp_dir && tar -zcf $pkg_file ./debian-binary ./data.tar.gz ./control.tar.gz )
 fi
-- 
1.7.2.3