Skip to contentSkip to conversation

base.bbclass: Enable overwrite flag for unzip command

DISCUSSION Leon Woestenberg 3 participants 4 messages Mar 30, 2008

lore
Share & tools
lore
#0 lore raw

Hello,

During rebuilds I noticed unpacking a zip a second time fails, whereas tar silently succeeds, overwriting files.

A manual test confirms this:

leon@witty:/tmp$ unzip -q
/home/leon/sandbox/efika/openembedded/downloads/faad2-2.0.zip
leon@witty:/tmp$ unzip -q
/home/leon/sandbox/efika/openembedded/downloads/faad2-2.0.zip
replace faad2/aacDECdrop/aacDECdrop/aacDECdrop.dsp? [y]es, [n]o, [A]ll,
[N]one, [r]ename: leon@witty:/tmp$
leon@witty:/tmp$ tar xzf ~/sandbox/efika/openembedded/downloads/zeroconf-
0.9.tar.gz
leon@witty:/tmp$ tar xzf ~/sandbox/efika/openembedded/downloads/zeroconf-
0.9.tar.gz

I will shortly commit the following change (after a test), which enables overwrite behaviour for unzip:

-base.bbclass:574: cmd = 'unzip -q'
+base.bbclass:574: cmd = 'unzip -q -o'

Regards,

Signature · 1 line
Leon
#1 lore raw
Quoted 2 lines · Leon Woestenberg

During rebuilds I noticed unpacking a zip a second time fails, whereas tar silently succeeds, overwriting files.

...

Review

Quoted 5 lines

I will shortly commit the following change (after a test), which enables overwrite behaviour for unzip:

(quoted diff) +1 -1
-base.bbclass:574:               cmd = 'unzip -q'
+base.bbclass:574:               cmd = 'unzip -q -o'

+1 - I had the same problem arise today with ixp4xx-npe-native.

-- Rod

#2 lore raw
In reply to Leon Woestenberg

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Leon Woestenberg schreef:

| Hello,
|
| During rebuilds I noticed unpacking a zip a second time fails, whereas tar
| silently succeeds, overwriting files.

I think all unpack methods should have consistent behaviour, but I don't think silently overwriting files is a good idea, especially when SRC_URI contains patches as well.

| I will shortly commit the following change (after a test), which enables
| overwrite behaviour for unzip:
|
| -base.bbclass:574:               cmd = 'unzip -q'
| +base.bbclass:574:               cmd = 'unzip -q -o'

Since sorting out unpack behaviour will take too long:

+1 from me

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFH76BcMkyGM64RGpERAjmRAJsFayVq33qqBcSBgDzHHEput2Kk2gCePPQb Ad+tFhoZs/Bt0FQM2fd+XqE=
=1wUR
-----END PGP SIGNATURE-----

#3 lore raw

Hello,

Quoted 4 lines · Koen Kooi

I think all unpack methods should have consistent behaviour, but I don't think silently overwriting files is a good idea, especially when SRC_URI contains patches as well.

In fact, unpacking over the previous work dir is one of numerous reasons why rebuilds are very prone to non-deterministic builds; if the package build behaves differently when left-overs are present, we have a problem. (A simple example is a Makefile with non-correct dependency information - most of these already fail during -jN with N>1).

However, we should note that re-builds are non-deterministic at least in these two cases.
- when the meta data has changed inbetween. (Boosting PR helps as it will start from a clean dir).
- if individual tasks are forced and the package has faulty internal build dependencies.

I like the current behaviour of OpenEmbedded though, where we can force a re-do of each stage during development.

I just never trust it for a release (candidate) build.

Change committed in 2e450cceb8dfc2c7a8dc9fce69d0d31223476a09, thanks for the review.

Regards,

Signature · 1 line
Leon