#!/bin/sh

iterate()
{
	"$@" GX - bin/opera@@{SUFFIX}
	if ! $repackage
	then
		"$@" GX - bin/uninstall-opera@@{SUFFIX}
	fi
	"$@" NF f9bd2d126baf830a95d0a7b236b2f5f9 lib/opera@@{SUFFIX}/gstreamer/plugins/libgstoperamatroska.so
	"$@" NF 763753e1168fabf28d72c34a3391848a lib/opera@@{SUFFIX}/gstreamer/plugins/libgstoperavp8.so
	"$@" NF 28ec61bca3882f02cf6806cbe1e4140c lib/opera@@{SUFFIX}/liboperagtk.so
	"$@" NF 046f13486f66bf98814afcff9b093bcd lib/opera@@{SUFFIX}/liboperakde4.so
	"$@" NX feb6a77337be201eabfd4b514af68992 lib/opera@@{SUFFIX}/opera@@{SUFFIX}
	"$@" NX 8a19c727a344759f3fb670c431692148 lib/opera@@{SUFFIX}/operaplugincleaner
	"$@" NX 9a8d332972c9483bc9e26807516d3d9b lib/opera@@{SUFFIX}/operapluginwrapper
	"$@" NF 0a8389b127c477aa2c55ee5d234473ca lib/opera@@{SUFFIX}/plugins/README
	"$@" PF 0552cd1072d43b72266af5fbc511d3ac share/applications/opera@@{SUFFIX}-browser.desktop
	"$@" NF 3214f080875748938ba060314b4f727d share/doc/opera@@{SUFFIX}/LGPL-2
	"$@" NF 6a6a8e020838b23406c81b19c1d46df6 share/doc/opera@@{SUFFIX}/LGPL-3
	"$@" NF bca0f32b4c9d40e1694f74feeefe42c2 share/doc/opera@@{SUFFIX}/LICENSE
	"$@" NF c9996f43d681b457f038bfc8efeef28a share/doc/opera@@{SUFFIX}/README.gstreamer
	"$@" NF 1cf2b768a82db57c169abd21d4f59f44 share/icons/hicolor/128x128/apps/opera@@{SUFFIX}-browser.png
	"$@" NF 272f6ee8bbad4dc7029d81286ca4763e share/icons/hicolor/128x128/mimetypes/opera@@{SUFFIX}-extension.png
	"$@" NF e67a11f466869d45bda53bdc9dbf4820 share/icons/hicolor/128x128/mimetypes/opera@@{SUFFIX}-unite-application.png
	"$@" NF 5867c9e883d04983f8e0cba6ed6fc44f share/icons/hicolor/16x16/apps/opera@@{SUFFIX}-browser.png
	"$@" NF 87c5739d23920500c0815c88fcee8fb1 share/icons/hicolor/16x16/mimetypes/opera@@{SUFFIX}-extension.png
	"$@" NF 87a4cd99f0b1be41a1f6cfda5d57858a share/icons/hicolor/16x16/mimetypes/opera@@{SUFFIX}-unite-application.png
	"$@" NF 9b21a5b9cc1b70f75b2605aaefcc72fd share/icons/hicolor/22x22/apps/opera@@{SUFFIX}-browser.png
	"$@" NF b1aadfffe1a2a4cbc0769505f130f462 share/icons/hicolor/22x22/mimetypes/opera@@{SUFFIX}-extension.png
	"$@" NF 96f5a6bb62249a96b18a21e2620dcaf5 share/icons/hicolor/22x22/mimetypes/opera@@{SUFFIX}-unite-application.png
	"$@" NF 078dfc9dc21163e924751089d82ccdb2 share/icons/hicolor/24x24/apps/opera@@{SUFFIX}-browser.png
	"$@" NF 70c1f737385a88bd616654ef23a187cc share/icons/hicolor/24x24/mimetypes/opera@@{SUFFIX}-extension.png
	"$@" NF 5de5a30096324d2fb9d48928d49912c3 share/icons/hicolor/24x24/mimetypes/opera@@{SUFFIX}-unite-application.png
	"$@" NF d0da7112e4afc57c217293d5e2c8bd4b share/icons/hicolor/32x32/apps/opera@@{SUFFIX}-browser.png
	"$@" NF 852841f582f95cabb04992397fcc97ce share/icons/hicolor/32x32/mimetypes/opera@@{SUFFIX}-extension.png
	"$@" NF 7d861375334ea90d50f01bd84720f54e share/icons/hicolor/32x32/mimetypes/opera@@{SUFFIX}-unite-application.png
	"$@" NF b8b7d45770e10341aea315221c4e6527 share/icons/hicolor/48x48/apps/opera@@{SUFFIX}-browser.png
	"$@" NF 6b94ab4c0f32141dc889207cf3454c43 share/icons/hicolor/48x48/mimetypes/opera@@{SUFFIX}-extension.png
	"$@" NF 4e4670e50dc2cb2305abd6f526a82099 share/icons/hicolor/48x48/mimetypes/opera@@{SUFFIX}-unite-application.png
	"$@" NF 2a2af008703af2465b9401ce4aa94686 share/icons/hicolor/scalable/apps/opera@@{SUFFIX}-browser.svg
	"$@" NF fe9c0b034eb8961565ee0c19efecc2cd share/icons/hicolor/scalable/mimetypes/opera@@{SUFFIX}-extension.svg
	"$@" NF 957818c8871b44f4b490a51f90134fa5 share/icons/hicolor/scalable/mimetypes/opera@@{SUFFIX}-unite-application.svg
	"$@" PF 85f720410b024fdb3fcfbdcaed875fe4 share/man/man1/opera@@{SUFFIX}.1.gz
	"$@" PF a960b3c9c3fabecd6805a4b954d893e1 share/mime/packages/opera@@{SUFFIX}-extension.xml
	"$@" PF c2c25c89d82f6eb553903a414bf51d31 share/mime/packages/opera@@{SUFFIX}-unite-application.xml
	"$@" NF 84105503de54fa3ac5763052c8a9eab6 share/opera@@{SUFFIX}/defaults/bookmarks.adr
	"$@" NF 47c08d6696bb0c85d176ee56ff9bd2c7 share/opera@@{SUFFIX}/defaults/feedreaders.ini
	"$@" NF eff00befe1723a4742b9ae591170566c share/opera@@{SUFFIX}/defaults/filehandler.ini
	"$@" LL ../../doc/opera@@{SUFFIX}/LICENSE share/opera@@{SUFFIX}/defaults/license.txt
	"$@" NF f50581f58f5cd77c60b90c70cb67e9c7 share/opera@@{SUFFIX}/defaults/mailproviders.xml
	"$@" NF 0cb4ac60c1cf45bd08ec4d5d62da5c02 share/opera@@{SUFFIX}/defaults/plugin-ignore.ini
	"$@" NF cd8cf5830710469de260ddea3a27efa9 share/opera@@{SUFFIX}/defaults/pluginpath.ini
	"$@" NF fd72cbbceb537c191d177beb683cc945 share/opera@@{SUFFIX}/defaults/public_domains.dat
	"$@" NF df33ce5cb496327834228be46d139b45 share/opera@@{SUFFIX}/defaults/search.ini
	"$@" NF 8d5447a9eea3713d713487924e39fff2 share/opera@@{SUFFIX}/defaults/standard_speeddial.ini
	"$@" NF 2ecfa381c2006b9db4143f4da84954e5 share/opera@@{SUFFIX}/defaults/standard_trusted_repositories.ini
	"$@" NF 4753a835e647f47f1aa89205bad4fa43 share/opera@@{SUFFIX}/defaults/tips_metadata.ini
	"$@" NF 51e20bcd23e47edb6ff898439b9c7a7c share/opera@@{SUFFIX}/defaults/webmailproviders.ini
	"$@" NF 5978ba5d3fa29bb0f5b210cc8aad57e1 share/opera@@{SUFFIX}/defaults/xmlentities.ini
	"$@" NF 62aa163b7ef5a1a61ea93709041e2ba1 share/opera@@{SUFFIX}/encoding.bin
	"$@" NF 54f1497ac9cc9ffa04d52213be260559 share/opera@@{SUFFIX}/extra/missingplugin.svg
	"$@" NF 17700f8a405a78dc1afdf69679a3f85b share/opera@@{SUFFIX}/extra/missingpluginhover.svg
	"$@" NF 0547d144b3de633887a8657de0ee1779 share/opera@@{SUFFIX}/extra/svg-mo.dat
	"$@" NF 6ee58550670e206dc93e1b31a7da2c9f share/opera@@{SUFFIX}/extra/svg-mobd.dat
	"$@" NF 0ab7eca84c071dac25dafd3b4569d80f share/opera@@{SUFFIX}/extra/svg-sa.dat
	"$@" NF 23059c42a43dceded9122d8834aa43fe share/opera@@{SUFFIX}/extra/svg-sabd.dat
	"$@" NF f3747a59108df781e04305b1bee29574 share/opera@@{SUFFIX}/extra/svg-se.dat
	"$@" NF bcdb530c010ed72fe6096d46366c57f5 share/opera@@{SUFFIX}/extra/svg-sebd.dat
	"$@" NF f9cf9b1ffeb08c3272d5e6fe27b24e9f share/opera@@{SUFFIX}/files.sig
	"$@" NF 07691ad17c3fd15036b85c5fa416f34d share/opera@@{SUFFIX}/files_old.sig
	"$@" NF 7a2db2de5211ab16a6712e4168d17ec7 share/opera@@{SUFFIX}/html40_entities.dtd
	"$@" NF 87803f0514670b96c73d4043cd3568c8 share/opera@@{SUFFIX}/lngcode.txt
	"$@" NF 8b59997d5bafbd02030a95d850321baf share/opera@@{SUFFIX}/locale/af/af.lng
	"$@" NF b329862a8aeb0d58146d624a10908b60 share/opera@@{SUFFIX}/locale/az/az.lng
	"$@" NF 2cfb0b7024ad122afdd6a310c04665ca share/opera@@{SUFFIX}/locale/be/be.lng
	"$@" NF 39585d50b4b083c8231a5b471ec6868f share/opera@@{SUFFIX}/locale/be/bookmarks.adr
	"$@" NF 71dd55eaf540842089b15482fca4117a share/opera@@{SUFFIX}/locale/be/search.ini
	"$@" NF 438bee6dd8044bd2c2362cfffac255de share/opera@@{SUFFIX}/locale/be/standard_speeddial.ini
	"$@" NF b60c61e5addb23575981cd3758d6912c share/opera@@{SUFFIX}/locale/bg/bg.lng
	"$@" NF 0ade20ed9530794ac096503bb0adc2e6 share/opera@@{SUFFIX}/locale/bg/bookmarks.adr
	"$@" NF 0995397cea52dfb141c94eba77cab680 share/opera@@{SUFFIX}/locale/bg/search.ini
	"$@" NF 39ed0973bd2549406068c8d8610ba249 share/opera@@{SUFFIX}/locale/bg/standard_speeddial.ini
	"$@" NF c8e9dc5a966de6b25d20fe43eb74009d share/opera@@{SUFFIX}/locale/cs/bookmarks.adr
	"$@" NF 64169c7e10f3735181d47758ca723ed6 share/opera@@{SUFFIX}/locale/cs/cs.lng
	"$@" NF 41507529cd99bed5d3beecdad8e59288 share/opera@@{SUFFIX}/locale/cs/search.ini
	"$@" NF 2c11a4da9ae64497b3a46b02841fed24 share/opera@@{SUFFIX}/locale/cs/standard_speeddial.ini
	"$@" NF be055e8b1d3d3a127629555ff94ec792 share/opera@@{SUFFIX}/locale/da/da.lng
	"$@" NF 604f1d1f819dad84432a2182c69be19f share/opera@@{SUFFIX}/locale/de/bookmarks.adr
	"$@" NF cfbbd0bf09370eadb55d1b3f7631b10b share/opera@@{SUFFIX}/locale/de/de.lng
	"$@" NF 3fbfe96a88accccc64a9a3b3fe7ff785 share/opera@@{SUFFIX}/locale/de/search.ini
	"$@" NF 7e94df147bfefde5430549b8c9daa2b7 share/opera@@{SUFFIX}/locale/de/standard_speeddial.ini
	"$@" NF e87f1c4fdbf540a9842c3009622ef052 share/opera@@{SUFFIX}/locale/el/el.lng
	"$@" NF 60c9cd46c6c5876523c222c232b0401d share/opera@@{SUFFIX}/locale/en-GB/bookmarks.adr
	"$@" NF ed98876dc97d8225c10d970b4741056b share/opera@@{SUFFIX}/locale/en-GB/en-GB.lng
	"$@" NF 2e39a4eac8533e44ca74edef60fcfce5 share/opera@@{SUFFIX}/locale/en-GB/search.ini
	"$@" NF 8503641f5571516509b5c6b03976a225 share/opera@@{SUFFIX}/locale/en-GB/standard_speeddial.ini
	"$@" NF d26e579f3cba19c3cb1ba6f9291ab04a share/opera@@{SUFFIX}/locale/en/bookmarks.adr
	"$@" NF 1f911b19f1659894da0527e79351dc96 share/opera@@{SUFFIX}/locale/en/en.lng
	"$@" NF d5d01602d6598ebd12dc62c7520f8fb8 share/opera@@{SUFFIX}/locale/en/en.zip
	"$@" LL ../../../doc/opera@@{SUFFIX}/LICENSE share/opera@@{SUFFIX}/locale/en/license.txt
	"$@" NF 051341bcd05e867d86555a5e1b2b3da6 share/opera@@{SUFFIX}/locale/en/search.ini
	"$@" NF 8503641f5571516509b5c6b03976a225 share/opera@@{SUFFIX}/locale/en/standard_speeddial.ini
	"$@" NF 34a192e371697582b148989e6cc8cafa share/opera@@{SUFFIX}/locale/es-ES/bookmarks.adr
	"$@" NF 2c681b0a40c8953c84f1bcfd8834b36c share/opera@@{SUFFIX}/locale/es-ES/es-ES.lng
	"$@" NF 85be732f0ac2a0e6543837a0a72e3b6e share/opera@@{SUFFIX}/locale/es-ES/search.ini
	"$@" NF f5e84e7a51e59a8ffdb42fc054432d42 share/opera@@{SUFFIX}/locale/es-ES/standard_speeddial.ini
	"$@" NF dd75b912fbcbe88c49eb6e61599e14fc share/opera@@{SUFFIX}/locale/es-LA/es-LA.lng
	"$@" NF 32792db8850dcb406c14d01917033e47 share/opera@@{SUFFIX}/locale/et/et.lng
	"$@" NF 535dfbb7475e04199549ca327b6e76c0 share/opera@@{SUFFIX}/locale/fi/fi.lng
	"$@" NF bdacf7f86953e15ad550bc7e1bcd9c05 share/opera@@{SUFFIX}/locale/fr-CA/fr-CA.lng
	"$@" NF 262fe15994970c22098284b3e17f9100 share/opera@@{SUFFIX}/locale/fr/bookmarks.adr
	"$@" NF c576576e75a3eae1341b3860bb0601ac share/opera@@{SUFFIX}/locale/fr/fr.lng
	"$@" NF e9e57379128a1f82e101d38bc192217b share/opera@@{SUFFIX}/locale/fr/search.ini
	"$@" NF 7eb95951611565e5dc0ab6e2c3b7e925 share/opera@@{SUFFIX}/locale/fr/standard_speeddial.ini
	"$@" NF d3deede550cab26a7b134605e8c0f4e7 share/opera@@{SUFFIX}/locale/fy/fy.lng
	"$@" NF 68ad4dae62fec0b2b64385cecedb59fe share/opera@@{SUFFIX}/locale/gd/gd.lng
	"$@" NF bb9bf92606678e2cc8c2d36c9ed42e7e share/opera@@{SUFFIX}/locale/hi/hi.lng
	"$@" NF 9567b49e483d9ab8f7e395a930638a54 share/opera@@{SUFFIX}/locale/hr/hr.lng
	"$@" NF 76dd7bdd47b0e404a2916cd4238e9f66 share/opera@@{SUFFIX}/locale/hu/bookmarks.adr
	"$@" NF ef0494b63e2a2bf4ff847800e054e966 share/opera@@{SUFFIX}/locale/hu/hu.lng
	"$@" NF c6303acbb9853fa24711a96e7ee4ad62 share/opera@@{SUFFIX}/locale/hu/search.ini
	"$@" NF 39ed0973bd2549406068c8d8610ba249 share/opera@@{SUFFIX}/locale/hu/standard_speeddial.ini
	"$@" NF 4721be6acd75988bdb096c81ee4fe5fa share/opera@@{SUFFIX}/locale/id/bookmarks.adr
	"$@" NF 4e29e49ac30bae8d95d50ea7b573dbea share/opera@@{SUFFIX}/locale/id/id.lng
	"$@" NF b504ba7049fe259775e2279a9917839b share/opera@@{SUFFIX}/locale/id/search.ini
	"$@" NF 334502e5cc03d8585ae1ef2e080f2117 share/opera@@{SUFFIX}/locale/id/standard_speeddial.ini
	"$@" NF 8d289225959be89ebbab658a3b9823e2 share/opera@@{SUFFIX}/locale/it/bookmarks.adr
	"$@" NF b9a82197c9917ecf52acd9874593f564 share/opera@@{SUFFIX}/locale/it/it.lng
	"$@" NF 4ede08b296d25b36bfc614d6db265efa share/opera@@{SUFFIX}/locale/it/search.ini
	"$@" NF 7c7f51a98d14c8cf18bf6286d989673b share/opera@@{SUFFIX}/locale/it/standard_speeddial.ini
	"$@" NF 95a73802438bbda56d75e16f9b875c82 share/opera@@{SUFFIX}/locale/ja/bookmarks.adr
	"$@" NF 40159bcaf5cb62b660ca3afc18ae98d3 share/opera@@{SUFFIX}/locale/ja/ja.lng
	"$@" NF 9264efc99420c89a3a6ef170b6bf2957 share/opera@@{SUFFIX}/locale/ja/license.txt
	"$@" NF dc110be5d98db3e1bf7427118bf2001d share/opera@@{SUFFIX}/locale/ja/search.ini
	"$@" NF 1090fb75990f06e82e7a3899714e56f8 share/opera@@{SUFFIX}/locale/ja/standard_speeddial.ini
	"$@" NF 6d5bec9718004a522bd834806dab4285 share/opera@@{SUFFIX}/locale/ka/ka.lng
	"$@" NF 8e8bc1d6061f8457d13e72d4cb4b6aab share/opera@@{SUFFIX}/locale/ko/ko.lng
	"$@" NF c082bf82518f4141b19dd62fecdb6dd9 share/opera@@{SUFFIX}/locale/lt/lt.lng
	"$@" NF 48952a620a430fe6868cac76ef43ebe6 share/opera@@{SUFFIX}/locale/me/me.lng
	"$@" NF 691aafa17f030ed901628c49eb6fa711 share/opera@@{SUFFIX}/locale/mk/mk.lng
	"$@" NF fd5c5bb841cb892bbabe60560de3ff35 share/opera@@{SUFFIX}/locale/ms/ms.lng
	"$@" NF f7e3fdc8bdedab2af641c52c22769f4d share/opera@@{SUFFIX}/locale/nb/bookmarks.adr
	"$@" NF b52bee3e26e5be618dcafd69371bbe22 share/opera@@{SUFFIX}/locale/nb/nb.lng
	"$@" NF f39e344597e888d486be6b53c371ccde share/opera@@{SUFFIX}/locale/nb/search.ini
	"$@" NF 11937862cad64ff2fe4942520c1bee92 share/opera@@{SUFFIX}/locale/nb/standard_speeddial.ini
	"$@" NF b3408abfa94b30993c3dd39807108836 share/opera@@{SUFFIX}/locale/nl/nl.lng
	"$@" NF be496ccbebd2f8cf90b6c0ef3b3c23b0 share/opera@@{SUFFIX}/locale/nn/nn.lng
	"$@" NF d220a1c85a8e2396e898b15185a69206 share/opera@@{SUFFIX}/locale/pl/bookmarks.adr
	"$@" NF a5afdc2fb8fcad5586e2f8a2b60718d3 share/opera@@{SUFFIX}/locale/pl/pl.lng
	"$@" NF 88aee37e6794adc2ac627d021a4d2829 share/opera@@{SUFFIX}/locale/pl/search.ini
	"$@" NF b125677ea8d3e5f6c8d58c0a7b1e6615 share/opera@@{SUFFIX}/locale/pl/standard_speeddial.ini
	"$@" NF 82e0aaa710fb0fd2a3543fb392b46322 share/opera@@{SUFFIX}/locale/pt-BR/bookmarks.adr
	"$@" NF caa1359994b8d4b2b14d7a029611f94e share/opera@@{SUFFIX}/locale/pt-BR/pt-BR.lng
	"$@" NF b92c0ed220ca6abbcab5e90819818829 share/opera@@{SUFFIX}/locale/pt-BR/search.ini
	"$@" NF 5e650a9ee361bf9c8b63d2fdf902b40f share/opera@@{SUFFIX}/locale/pt-BR/standard_speeddial.ini
	"$@" NF 7e04ab6c171d0b9c15b44621ff923303 share/opera@@{SUFFIX}/locale/pt/pt.lng
	"$@" NF 6a50b070b4c9c98ce95e198c4935feaa share/opera@@{SUFFIX}/locale/ro/bookmarks.adr
	"$@" NF 7e8af21bd0290360db07793be206c466 share/opera@@{SUFFIX}/locale/ro/ro.lng
	"$@" NF 2f9d0ef96a1bb9288b7c39d94607127e share/opera@@{SUFFIX}/locale/ro/search.ini
	"$@" NF 39ed0973bd2549406068c8d8610ba249 share/opera@@{SUFFIX}/locale/ro/standard_speeddial.ini
	"$@" NF 51aad8bbbbfa4cecc8e929d4465c1f09 share/opera@@{SUFFIX}/locale/ru/bookmarks.adr
	"$@" NF 77214ec259c98f126a690deeeb540944 share/opera@@{SUFFIX}/locale/ru/ru.lng
	"$@" NF 5eb979ced018b89bcb1b56b7053e4577 share/opera@@{SUFFIX}/locale/ru/search.ini
	"$@" NF 509af84aab6aabcf1989112e20c5754b share/opera@@{SUFFIX}/locale/ru/standard_speeddial.ini
	"$@" NF 1a158593829cd520842b50aeb3645817 share/opera@@{SUFFIX}/locale/sk/bookmarks.adr
	"$@" NF 83b13164b497fcf79f6d7ca36467865a share/opera@@{SUFFIX}/locale/sk/search.ini
	"$@" NF 7e944e7692b962e31162ca0414ecc336 share/opera@@{SUFFIX}/locale/sk/sk.lng
	"$@" NF 4b430b6e890dd1253eac1b8d7e24a30b share/opera@@{SUFFIX}/locale/sk/standard_speeddial.ini
	"$@" NF 1fcbab0b72b2f859fd232dd09a6db6af share/opera@@{SUFFIX}/locale/sr/bookmarks.adr
	"$@" NF 3115c5bf16b3dd8caa96874f95943ac5 share/opera@@{SUFFIX}/locale/sr/search.ini
	"$@" NF c0ca457a198a7f6bedc7f698d67bbad5 share/opera@@{SUFFIX}/locale/sr/sr.lng
	"$@" NF 39ed0973bd2549406068c8d8610ba249 share/opera@@{SUFFIX}/locale/sr/standard_speeddial.ini
	"$@" NF b8bc3813d4ad2f6fb04c4773d6c2c8cf share/opera@@{SUFFIX}/locale/sv/sv.lng
	"$@" NF 67991df77b148615b86adec680da2911 share/opera@@{SUFFIX}/locale/ta/ta.lng
	"$@" NF 38cd80e15c98f099e0e3f4bdc069af2f share/opera@@{SUFFIX}/locale/te/te.lng
	"$@" NF 0d0d46e92263c3dcfdcef53a60108207 share/opera@@{SUFFIX}/locale/th/th.lng
	"$@" NF 87c5b950de1414657001001cd7339caf share/opera@@{SUFFIX}/locale/tl/tl.lng
	"$@" NF 93791bf9dc6a71783c068f251fe0f991 share/opera@@{SUFFIX}/locale/tr/tr.lng
	"$@" NF 364239ae27b089d507f2b43377084d7a share/opera@@{SUFFIX}/locale/uk/bookmarks.adr
	"$@" NF 6037f117de18852df437e80c9e3ea492 share/opera@@{SUFFIX}/locale/uk/search.ini
	"$@" NF 26538b623ec4df046e127411a2d946cc share/opera@@{SUFFIX}/locale/uk/standard_speeddial.ini
	"$@" NF b85bbf0c59f24b3c72a15b62ebe2f33b share/opera@@{SUFFIX}/locale/uk/uk.lng
	"$@" NF 125c56cdff0fe43357d1230432a086ef share/opera@@{SUFFIX}/locale/uz/uz.lng
	"$@" NF 4ae78f806825f60786cf78a61966a91e share/opera@@{SUFFIX}/locale/vi/vi.lng
	"$@" NF 6b5384c07280578596084bb95ca3eedb share/opera@@{SUFFIX}/locale/zh-cn/bookmarks.adr
	"$@" NF d4ffcd58495d43a65eb5119e12411972 share/opera@@{SUFFIX}/locale/zh-cn/browser.js
	"$@" NF 5443a6758ab25789a4b1519a0dd2ea1f share/opera@@{SUFFIX}/locale/zh-cn/search.ini
	"$@" NF efc612afa1b7a03bc2d693dd43c13b92 share/opera@@{SUFFIX}/locale/zh-cn/standard_speeddial.ini
	"$@" NF d44fc31b4c96a97d22624455874764ca share/opera@@{SUFFIX}/locale/zh-cn/turbosettings.xml
	"$@" NF 69f3045c1c788f675e5cf11ca851d73d share/opera@@{SUFFIX}/locale/zh-cn/zh-cn.lng
	"$@" NF d4ffcd58495d43a65eb5119e12411972 share/opera@@{SUFFIX}/locale/zh-tw/browser.js
	"$@" NF 6ea2f98cdeaf54c398dca24aea9df644 share/opera@@{SUFFIX}/locale/zh-tw/turbosettings.xml
	"$@" NF 43e46e1f9fa7b17c97977a69ff4f81ff share/opera@@{SUFFIX}/locale/zh-tw/zh-tw.lng
	"$@" NF 1c24deadc6027ab1b7a2cecc7b7c00e4 share/opera@@{SUFFIX}/mathml.dtd
	"$@" NF d9d6dbf18148e5c773a87e8f5d61048c share/opera@@{SUFFIX}/package-id.ini
	"$@" NF 605cca87520de12b190e856bf1b14fb6 share/opera@@{SUFFIX}/skin/standard_skin.zip
	"$@" NF 35676141698f3b6d5834dd14b915289a share/opera@@{SUFFIX}/skin/unix_skin.zip
	"$@" NF 06820e6bdd581b0a257e5e2648360457 share/opera@@{SUFFIX}/styles/about.css
	"$@" NF 4fb7c857524fd084449266fc70e9288b share/opera@@{SUFFIX}/styles/cache.css
	"$@" NF 8295c14370590319f3f116b0e8b358ec share/opera@@{SUFFIX}/styles/certinfo.css
	"$@" NF d12b86f06547c6eaf1f20b87447668dd share/opera@@{SUFFIX}/styles/config.css
	"$@" NF adc83d14afaa0ea76588cf340e36c3a5 share/opera@@{SUFFIX}/styles/contentblock.css
	"$@" NF 3ddaf96398ae99245f6b83e6dc676ac6 share/opera@@{SUFFIX}/styles/debug.css
	"$@" NF 1368beca272c8937ad41f2864d635b95 share/opera@@{SUFFIX}/styles/dir.css
	"$@" NF b899f48166bd73439728244dca611745 share/opera@@{SUFFIX}/styles/error.css
	"$@" NF e9ee42b5c66c0367c1e02a1eeeca0776 share/opera@@{SUFFIX}/styles/history.css
	"$@" NF 3313969be29b130922a2551034194d42 share/opera@@{SUFFIX}/styles/im.css
	"$@" NF a2466c0a232fca46ac7e16d9fa92c446 share/opera@@{SUFFIX}/styles/image.css
	"$@" NF 73b840d67b16a49008b7ed3d6aec38ab share/opera@@{SUFFIX}/styles/images/Opera_256x256.png
	"$@" NF 35a8968b802c4cd66f70631354cec397 share/opera@@{SUFFIX}/styles/images/bar.png
	"$@" NF 2e242ddd9c9679c584b0fe430b8948cf share/opera@@{SUFFIX}/styles/images/bkgd-rev.png
	"$@" NF a67a7a2cc37ababd70825acc77bf3480 share/opera@@{SUFFIX}/styles/images/bkgd.png
	"$@" NF 4289d8db3e0ad4cb825d34c969c142ff share/opera@@{SUFFIX}/styles/images/bullet.png
	"$@" NF cbdbb7032558dae6b04f7691c4b8a41a share/opera@@{SUFFIX}/styles/images/center.png
	"$@" NF 669d3ef423184869eb24b29500330b06 share/opera@@{SUFFIX}/styles/images/container.png
	"$@" NF f23a4e2a5c1a0db7cfac79d1e7b9ba23 share/opera@@{SUFFIX}/styles/images/corner.png
	"$@" NF b423f4149c868ccf56a15abb83228f09 share/opera@@{SUFFIX}/styles/images/customize.gif
	"$@" NF e715da6d7e5314261bdff2942251718a share/opera@@{SUFFIX}/styles/images/darkBox.png
	"$@" NF 0dfc37ae4404b4a6811e4876db6b7df1 share/opera@@{SUFFIX}/styles/images/defaultFavicon.png
	"$@" NF 71bbdb354d7e65183c86aa36a27ddd1d share/opera@@{SUFFIX}/styles/images/error.png
	"$@" NF ac4455a870ed9d5365377c2d9566240c share/opera@@{SUFFIX}/styles/images/file.png
	"$@" NF 86c6ac920bd2fbb7f538ff79d4e34395 share/opera@@{SUFFIX}/styles/images/flag.png
	"$@" NF c6ee6872a8d70dbec976edd11bdaf986 share/opera@@{SUFFIX}/styles/images/folder.png
	"$@" NF 9b0cdaf9d7623041bd00e576cd1733f1 share/opera@@{SUFFIX}/styles/images/hanger.png
	"$@" NF cd587bbd0135bcc9820de23318dbae41 share/opera@@{SUFFIX}/styles/images/header-expanded.png
	"$@" NF 533450be6ceff816d25c53fb8ca93cad share/opera@@{SUFFIX}/styles/images/header.png
	"$@" NF 807f783c2043b0ff19471459cb52ad14 share/opera@@{SUFFIX}/styles/images/opera-icon-red.png
	"$@" NF a2ed905f3862c320bb43e866721729d7 share/opera@@{SUFFIX}/styles/images/opera.png
	"$@" NF dbb6d41150a244186500718eda971047 share/opera@@{SUFFIX}/styles/images/page-bot.png
	"$@" NF d58ef56a726e38bb51da5adf696153fc share/opera@@{SUFFIX}/styles/images/red_center.png
	"$@" NF 3c6c895d2519efa918b4b3f46a897b67 share/opera@@{SUFFIX}/styles/images/red_left.png
	"$@" NF a28ba91c09ea75605d727e9bde7771b1 share/opera@@{SUFFIX}/styles/images/red_right.png
	"$@" NF a0c5f8a66f4e25f5d16ca1696a8f2e03 share/opera@@{SUFFIX}/styles/images/root.png
	"$@" NF 4aecd261352501fa1bad2c5e608df556 share/opera@@{SUFFIX}/styles/images/search.png
	"$@" NF b641cb9df6a4065ec64e6aac43cd5bc8 share/opera@@{SUFFIX}/styles/images/section.png
	"$@" NF 62f6287d95fafa0a8c56287e41760f33 share/opera@@{SUFFIX}/styles/images/smartGroup.png
	"$@" NF 2dab1572b02772c7a4fea3b5d51d1c48 share/opera@@{SUFFIX}/styles/images/tooltiptail.png
	"$@" NF f4dbc8a7b78e98448ad509bedca371c1 share/opera@@{SUFFIX}/styles/images/top.png
	"$@" NF 074b5a2c5386b6f2d12d172aa2f349fa share/opera@@{SUFFIX}/styles/images/warning.png
	"$@" NF 3a1f01c2181d79f8d579d26ca8c36b0e share/opera@@{SUFFIX}/styles/info.css
	"$@" NF e521ce4a0e2ad947af55f2fec3e30aee share/opera@@{SUFFIX}/styles/m2_welcome_message.mbs
	"$@" NF 3d3c384bea83a19f7a2fb4016f176c78 share/opera@@{SUFFIX}/styles/mail.css
	"$@" NF c92ea7dc91d7147ae4c5f51be8e9bf1e share/opera@@{SUFFIX}/styles/mathml.css
	"$@" NF 9f1492e55cf8d27f126607cd97bb4f8e share/opera@@{SUFFIX}/styles/media.css
	"$@" NF e7dd3d81e0088d5fb56df880226cc7e1 share/opera@@{SUFFIX}/styles/message.css
	"$@" NF 3750093c67f26b7815262956cc5c5652 share/opera@@{SUFFIX}/styles/mime.css
	"$@" NF 99887123c743417645b7b2b5a57ec15a share/opera@@{SUFFIX}/styles/opera.css
	"$@" NF 4d67e81faa56e84bafb8aebcef53910e share/opera@@{SUFFIX}/styles/plugins.css
	"$@" NF 4f25b1757ad75536fd6811254e7e4e64 share/opera@@{SUFFIX}/styles/private.css
	"$@" NF 028e214f2f1147678d50afc03705e7de share/opera@@{SUFFIX}/styles/search.css
	"$@" NF 4a1307a5ef44ce6f2699910d68353aaf share/opera@@{SUFFIX}/styles/unstyledxml.css
	"$@" NF 5bc0a8abcf1f533070d01415ecd7ad18 share/opera@@{SUFFIX}/styles/user/accessibility.css
	"$@" NF 0543fa1f23163fda70da1abca48ab27b share/opera@@{SUFFIX}/styles/user/altdebugger.css
	"$@" NF 83c445d3d83311a72e2b20ae3bcc31d2 share/opera@@{SUFFIX}/styles/user/classid.css
	"$@" NF 2fa6fc6187625a9b18f593bc0155347d share/opera@@{SUFFIX}/styles/user/contrastbw.css
	"$@" NF 3b14649c488639ccb271f4062fdbdbc3 share/opera@@{SUFFIX}/styles/user/contrastwb.css
	"$@" NF 768fce2463be25592a7a18cf5de76dd5 share/opera@@{SUFFIX}/styles/user/disablebreaks.css
	"$@" NF df59e1efbfe9e9e693007379ae36c7c7 share/opera@@{SUFFIX}/styles/user/disablefloats.css
	"$@" NF b219720e32060eae7275b10f89822044 share/opera@@{SUFFIX}/styles/user/disableforms.css
	"$@" NF ff377988948f88b59d786eb4b4f5f6bd share/opera@@{SUFFIX}/styles/user/disablepositioning.css
	"$@" NF a282ab27760ce5c9d08e5d19e3679f45 share/opera@@{SUFFIX}/styles/user/disabletables.css
	"$@" NF a89f5a95b9d93f02a5710a015e0eb1fa share/opera@@{SUFFIX}/styles/user/outline.css
	"$@" NF 1641b9745dcd076b4850bc79a5e3a745 share/opera@@{SUFFIX}/styles/user/structureblock.css
	"$@" NF 04db12198eb3e12f3fdb9818aff46cd7 share/opera@@{SUFFIX}/styles/user/structureinline.css
	"$@" NF b32564a2bc51123644e04b434c70d24b share/opera@@{SUFFIX}/styles/user/structuretables.css
	"$@" NF 76eadfb729094d536d2313e62ec5f02b share/opera@@{SUFFIX}/styles/user/tablelayout.css
	"$@" NF 0247352ff07de9a6f4a9ea9661fe54a9 share/opera@@{SUFFIX}/styles/user/toc.css
	"$@" NF 5bc2043c215012644e301fccbfb0397a share/opera@@{SUFFIX}/styles/warning.css
	"$@" NF ee2ba35cb25cd442fc337847f0bb1619 share/opera@@{SUFFIX}/styles/webfeeds.html
	"$@" NF a58d7f0685e93c12befea0abf0c168ef share/opera@@{SUFFIX}/styles/webstorage.css
	"$@" NF 4c39baff318e1caf9a994f4e2c431f84 share/opera@@{SUFFIX}/styles/wml.css
	"$@" NF b3da57290a445cd7df64bf6845229125 share/opera@@{SUFFIX}/ui/dialog.ini
	"$@" NF ce16c4983c62145b3b5b4f1674652199 share/opera@@{SUFFIX}/ui/dialogs.yaml
	"$@" NF e6d9e74c12773dcf0d6a195b6b9e78ac share/opera@@{SUFFIX}/ui/fastforward.ini
	"$@" NF e5248f07de74f02fb1a60b91135b530c share/opera@@{SUFFIX}/ui/standard_keyboard.ini
	"$@" NF ffbd7369a0e205175042512c0d62c97b share/opera@@{SUFFIX}/ui/standard_keyboard_compat.ini
	"$@" NF e5eb29358d19ae11aa65bbdb1176593a share/opera@@{SUFFIX}/ui/standard_menu.ini
	"$@" NF 942a4cf89c0f15f20744dc91431876fd share/opera@@{SUFFIX}/ui/standard_mouse.ini
	"$@" NF 87da10d50af60b05f14e41af4ed34121 share/opera@@{SUFFIX}/ui/standard_toolbar.ini
	"$@" NF 4d02ad754f6a7cc001bfba844c63fd4b share/opera@@{SUFFIX}/ui/unix_keyboard.ini
	"$@" NF bd3a77a3e027a9750af73c97765e3095 share/opera@@{SUFFIX}/unite/fileSharing.ua
	"$@" NF 5921c98b8d0ce4fb4ab882e898403b71 share/opera@@{SUFFIX}/unite/fridge.ua
	"$@" NF 8b67273076f0bcaf062fd9f4cb638e8f share/opera@@{SUFFIX}/unite/home.ua
	"$@" NF 2afaa250f42928552b870400d602c392 share/opera@@{SUFFIX}/unite/mediaPlayer.ua
	"$@" NF 6c14fab7e0a1562acfae68c0538cd80c share/opera@@{SUFFIX}/unite/messenger.ua
	"$@" NF f9a0e96426dd888e18cd4414ffbe229b share/opera@@{SUFFIX}/unite/photoSharing.ua
	"$@" NF 08207c39c32857e45a5308ac029026bf share/opera@@{SUFFIX}/unite/webserver.ua
}

available()
{
	command -v "$1" >/dev/null 2>&1
}

finalize_desktop()
{
	# Menu entries
	if available update-desktop-database
	then
		update-desktop-database $PREFIX/share/applications
	fi

	# MIME associations
	if available update-mime-database
	then
		mkdir -p $PREFIX/share/mime/packages
		update-mime-database $PREFIX/share/mime
		! rmdir $PREFIX/share/mime/packages >/dev/null 2>&1
	fi

	# Icons
	touch -c $PREFIX/share/icons/hicolor
	if available update-icon-caches
	then
		update-icon-caches -tq $PREFIX/share/icons/hicolor
	elif available gtk-update-icon-cache
	then
		gtk-update-icon-cache -tq $PREFIX/share/icons/hicolor
	fi
}

make_tempdir()
{
	if [ -z "$tempdir" ]
	then
		tempdir=$(mktemp -d -t opera-install.XXXXXXXX)
		if [ $? != 0 ]
		then
			ui_error "Cannot create a temporary directory, please set TMPDIR correctly"
		fi
	fi
}

cleanup()
{
	res=$?
	trap - 0
	if [ $res -gt 0 ] && $need_rollback
	then
		rollback
	fi
	if $need_ui_cleanup
	then
		ui_cleanup
	fi
	if [ -n "$tempdir" ]
	then
		rm -rf $tempdir
	fi
	exit $res
}

ui_widget()
{
	local width height
	message=$(
		echo "$2"
		if [ -n "$3" ]
		then
			echo
			cat "$3"
		fi
		if [ -n "$4" ]
		then
			echo
			echo "$4"
		fi
	)
	case $driver in
		dialog|whiptail)
			width=72
			if available fmt
			then
				message=$(echo "$message" | fmt -w $((width - 4)))
				height=$(($(echo "$message" | wc -l) + 6))
				if [ $1 = inputbox ]
				then
					height=$((height + 2))
				fi
			else
				height=20
			fi
			;;
	esac
	need_ui_cleanup=true
	case $driver in
		dialog|whiptail)
			exec 4>&1
			answer=$($driver --title "$windowtitle" --clear --$1 "$message" $height $width 2>&1 1>&4)
			res=$?
			exec 4>&-
			;;
		plain)
			echo
			echo "$message"
			case $1 in
				yesno)
					while true
					do
						read -p 'Please enter Y or N: ' answer
						case "$answer" in
							y*|Y*)
								res=0
								break
								;;
							n*|N*)
								res=1
								break
								;;
						esac
					done
					;;
				inputbox)
					read -p '>' answer
					;;
				msgbox|infobox)
					res=0
					;;
			esac
			;;
	esac
	need_ui_cleanup=false
	return $res
}

ui_info()
{
	ui_widget infobox "$@"
}

ui_message()
{
	ui_widget msgbox "$@"
}

ui_warn()
{
	ui_widget yesno "$1" "$2" 'Continue?' || exit
}

ui_error()
{
	ui_widget msgbox "$1" "$2" 'Installation aborted.'
	exit 1
}

ui_input()
{
	ui_widget inputbox "$1" "$2" ''
}

ui_menu()
{
	local text width height
	case $driver in
		dialog|whiptail)
			width=72
			if available fmt
			then
				height=$(($(echo "$text" | fmt -w $((width - 4)) | wc -l) + $# / 2 + 8))
			else
				height=20
			fi
			;;
	esac
	need_ui_cleanup=true
	case $driver in
		dialog|whiptail)
			text=$1
			shift
			exec 4>&1
			answer=$($driver --menu "$text" $height $width $(($# / 2)) "$@" 2>&1 1>&4) || exit
			res=$?
			exec 4>&-
			;;
		plain)
			echo
			echo "$1"
			shift
			(
				n=1
				while [ -n "$1" ]
				do
					echo "[$n] $2"
					n=$((n + 1))
					shift 2
				done
			)
			while true
			do
				read -p "Your choice: " answer
				if echo "$answer" | grep -q '^[0-9][0-9]*$' && [ $((answer >= 1)) = 1 ] && [ $((answer <= $# / 2)) = 1 ]
				then
					break
				fi
				echo "Please enter an integer between 1 and $(($# / 2))."
			done
			shift $((answer * 2 - 2))
			answer="$1"
			res=0
			;;
	esac
	need_ui_cleanup=false
	return $res
}

ui_progress_begin()
{
	if ! $talk
	then
		return
	fi
	if [ -z "$progress_max" ]
	then
		progress_max=$(iterate echo | wc -l)
	fi
	progress_cur=0
	need_ui_cleanup=true
	case $driver in
		whiptail)
			make_tempdir
			mkfifo $tempdir/gauge
			whiptail --gauge "$1" 0 72 0 <$tempdir/gauge &
			exec 3>$tempdir/gauge
			;;
		*)
			echo
			echo -n "$1"
			;;
	esac
}

ui_progress_advance()
{
	if ! $talk
	then
		return
	fi
	progress_cur=$((progress_cur + 1))
	case $driver in
		whiptail)
			echo $((progress_cur * 100 / progress_max)) >&3
			;;
		*)
			echo -n '.'
			;;
	esac
}

ui_progress_end()
{
	if ! $talk
	then
		return
	fi
	case $driver in
		whiptail)
			exec 3>&-
			rm $tempdir/gauge
			;;
		*)
			echo 'done'
			;;
	esac
	need_ui_cleanup=false
}

ui_cleanup()
{
	case $driver in
		dialog)
			exec 4>&-
			dialog --clear
			stty sane
			clear
			;;
		whiptail)
			exec 3>&- 4>&-
			stty sane
			clear
			;;
		plain)
			echo
			;;
	esac
}

ui_init()
{
	if [ -z "$TERM" -o "$TERM" = dumb ]
	then
		driver=plain
	elif available whiptail
	then
		driver=whiptail
	elif available dialog
	then
		driver=dialog
	else
		driver=plain
	fi
	answer=''
	progress_max=''
	windowtitle="$1"
}

common_init()
{
	interactive=true
	talk=true
	force=false
	need_rollback=false
	need_ui_cleanup=false
	repackage=false
	tempdir=''

	trap cleanup 0 INT QUIT TERM
}

common_opt()
{
	case "$1" in
		--text)
			driver=plain
			;;
		--unattended)
			interactive=false
			driver=plain
			;;
		--quiet)
			talk=false
			interactive=false
			driver=plain
			;;
		--force)
			force=true
			;;
		*)
			return 1
	esac
}

# EOF_COMMON

version()
{
	ui_message "Opera Next - Fast and secure web browser and Internet suite

Opera is a small, fast, customizable, powerful and user-friendly web
browser, as well as an Internet suite, including an email client, an IRC
client, web developer tools (Opera Dragonfly), and a personal web server
(Opera Unite).
Opera Next is a line of bleeding-edge releases of Opera, including alpha
and beta versions in addition to final releases.

This script installs Opera Next 11.50 build 1015 for Linux on i386.

Copyright (c) 1995-2011 Opera Software ASA. All rights reserved."
}

usage()
{
	version
	cat <<EOF

Options:

    --text          Select plain-text user interface.

    --unattended    Ask no questions. Implies --text.
                    The --prefix option becomes mandatory.

    --quiet         Ask no questions and don't show progress.
                    Implies --text.

    --prefix /P     Specify installation directory. Opera will be
                    installed into /P/bin, /P/share and /P/lib.

    --user          Install for the current user. Default for non-root.
                    Alias for --prefix $HOME/.local.

    --system        Install for everybody. Default for root.
                    Alias for --prefix /usr/local.

    --name N        Use N for package name. Must either be "opera" or
                    begin with "opera-". Names of installed files and
                    directories will contain this string in place of
                    "opera". This allows to install several
                    versions of Opera side by side. The default is
                    "opera-next".

    --suffix S      Obsolete. Same as --name opera-S.

    --force         Ignore all kinds of errors and try to continue.

    --repackage R   Special mode for package maintainers. Extract files
                    into the staging directory R as if it were the
                    installation prefix, but prepare them to be
                    installed under the actual prefix. In this mode, no
                    finalizing actions, such as registration of menu
                    entries, are performed. Sanity checks are disabled.
                    Implies --unattended.

    --version       Show Opera version.

    --help          Show this message.
EOF
}

check_os()
{
	local name version arch res msg
	res=false
	name=$(uname -s)
	case "$name" in
		Linux)
			res=true
			;;
		*BSD)
			;;
	esac
	arch=$(uname -m)
	case "$arch" in
		i?86|i86pc)
			arch=i386
			;;
		amd64)
			arch=x86_64
			;;
	esac
	if [ "$arch" != i386 ]
	then
		res=false
	fi
	if ! $res
	then
		msg="You are running $name on $arch, but this package is intended for Linux on i386. If you choose to install it, the product may not work correctly."
		if $interactive
		then
			ui_warn "$msg"
		else
			ui_error "$msg"
		fi
	fi
}


install_file()
{
	local source dest existing tomake
	if [ -f $tempdir/damaged ] && ! $force
	then
		return 1
	fi
	source=$(use_suffix '-next' "$3")
	dest=$INTO/$(use_suffix "$SUFFIX" "$3")
	existing=$dest
	tomake=''
	while [ -n "$existing" -a ! -e "$existing" ]
	do
		tomake=$existing
		existing=${existing%/*}
	done
	if [ ! -d "$existing" -o "$dest" = "$existing" ]
	then
		if { rm -rf "$existing~" && mv "$existing" "$existing~"; } 2>$tempdir/error || $force
		then
			echo "mv '$existing~' '$existing'" >>$tempdir/rollback
			echo "rm -rf '$existing~'" >>$tempdir/commit
		else
			ui_error "Cannot make a backup copy of $existing -- see detailed error message below." $tempdir/error
			echo "$dest">>$tempdir/damaged
			return 1
		fi
	elif [ -n "$tomake" -a "$tomake" != "$dest" ]
	then
		if mkdir -p "${dest%/*}" 2>$tempdir/error || $force
		then
			echo "rm -rf '$tomake'" >>$tempdir/rollback
		else
			ui_error "Cannot create directory ${dest%/*} -- see detailed error message below." $tempdir/error
			echo "$dest">>$tempdir/damaged
			return 1
		fi
	fi
	case "$1" in
		N?)
			cp "$source" "$dest"
			;;
		L?)
			source=$(use_suffix "$SUFFIX" "$2")
			ln -s "$source" "$dest"
			;;
		P?)
			case "$dest" in
				*.gz)
					gzip -dc "$source" | process >"${dest%.gz}" && gzip -9 "${dest%.gz}"
					;;
				*)
					process <"$source" >"$dest"
					;;
			esac
			;;
		G?)
			generate_file "${source##*/}" | process >"$dest"
			;;
	esac 2>$tempdir/error || $force || {
		ui_error "Cannot install $dest -- see detailed error message below." $tempdir/error
		echo "$dest">>$tempdir/damaged
		return 1
	}
	case "$1" in
		?F)
			chmod 0644 "$dest"
			;;
		?X)
			chmod 0755 "$dest"
			;;
	esac 2>$tempdir/error || $force || {
		ui_error "Cannot install $dest -- see detailed error message below." $tempdir/error
		echo "$dest">>$tempdir/damaged
		return 1
	}
	ui_progress_advance
}

generate_file()
{
	case "$1" in
		opera-next)
			cat <<'EOF_generate_file'
#!/bin/sh
export OPERA_DIR=${OPERA_DIR:-@@{PREFIX}/share/opera@@{SUFFIX}}
export OPERA_PERSONALDIR=${OPERA_PERSONALDIR:-$HOME/.opera@@{SUFFIX}}
exec @@{PREFIX}/lib/opera@@{SUFFIX}/opera@@{SUFFIX} "$@"
EOF_generate_file
			;;
		uninstall-opera-next)
			sed -ne '1,/EOF_COMMON/p' "${0##*/}"
			cat <<EOF
PREFIX='$PREFIX'
SUFFIX='$SUFFIX'
EOF
			cat <<'EOF_generate_file'

usage()
{
	version
	cat <<EOF

Options:
    --text          Select plaintext user interface
    --unattended    Ask no questions
    --quiet         Ask no questions and don't show progress (implies --text)
    --force         Ignore all kinds of errors and try to continue
    --help          Show this message
EOF
}

uninstall_file()
{
	if $upgrade_mode
	then
		mv "$PREFIX/$3" "$PREFIX/$3~"
		echo "mv '$PREFIX/$3~' '$PREFIX/$3'" >>$install_tempdir/rollback
		echo "rm -f '$PREFIX/$3~'; rmdir -p '$PREFIX/${3%/*}' 2>/dev/null" >>$install_tempdir/commit
	else
		rm -f "$PREFIX/$3"
		rmdir -p "$PREFIX/${3%/*}" 2>/dev/null
	fi
	ui_progress_advance
}

common_init
ui_init 'Uninstalling Opera Next'

upgrade_mode=false

while [ -n "$1" ]
do
	common_opt "$1" || case "$1" in
		--upgrade)
			shift
			upgrade_mode=true
			talk=false
			interactive=false
			driver=plain
			force=true
			install_tempdir="$1"
			;;
		*)
			driver=plain
			usage
			exit
			;;
	esac
	shift
done

if $talk
then
	msg="This script uninstalls Opera Next 11.50 build 1015 for Linux on i386 installed as $PREFIX/bin/opera$SUFFIX."
	if $interactive
	then
		ui_warn "$msg"
	else
		ui_message "$msg"
	fi
fi

if [ ! -w $PREFIX ] && ! $force
then
	ui_error "You do not have write permissions for $PREFIX. Perhaps you should be uninstalling as root?"
fi

ui_progress_begin "Removing files"
iterate uninstall_file
ui_progress_end

if ! $upgrade_mode
then
	if $talk
	then
		ui_info "Finalizing uninstallation..."
	fi
	finalize_desktop
fi

if $talk
then
	ui_message "Opera Next has been uninstalled successfully. However, users' profile directories, which are by default ~/.opera$SUFFIX, have been left intact. You might want to delete them manually."
fi
EOF_generate_file
			;;
		*)
			return 1
	esac
}

rollback()
{
	ui_progress_begin "Undoing installation"
	iterate rollback_file
	ui_progress_end
	if [ -f $tempdir/rollback ]
	then
		. $tempdir/rollback
	fi
}

rollback_file()
{
	local dest
	dest=$INTO/$(use_suffix "$SUFFIX" "$3")
	rm -f "$dest"
	while [ -n "$dest" ]
	do
		dest=${dest%/*}
		case "$dest" in
			$INTO/*/opera*)
				rmdir "$dest" 2>/dev/null || break
				;;
		esac
	done
	ui_progress_advance
}

verify_file()
{
	local md5 file
	md5="$2"
	file=$(use_suffix '-next' "$3")
	case "$1" in
		[GL]?)
			ui_progress_advance
			return
			;;
	esac
	if [ ! -f "$file" ]
	then
		make_tempdir
		echo "$file" >>$tempdir/damaged
	elif [ -n "$md5prog" ]
	then
		if [ $(get_md5 "$file") != "$md5" ]
		then
			make_tempdir
			echo "$file" >>$tempdir/damaged
		fi
	fi
	ui_progress_advance
}

get_md5()
{
	if [ "$md5prog" = md5 ]
	then
		md5 -q "$1"
	else
		md5sum "$1" | { read sum file; echo $sum; }
	fi
}

use_suffix()
{
	echo "$2" | sed -e "s:@@{SUFFIX}:$1:g"
}

process()
{
	sed -e "s:@@{PREFIX}:$PREFIX:g;s:@@{SUFFIX}:$SUFFIX:g;s:@@{_SUFFIX}:$_SUFFIX:g;s:@@{USUFFIX}:$USUFFIX:g"
}

PREFIX=''
INTO=''
orig_pwd=$PWD
suffix_set=false

cd "${0%/*}"

common_init
ui_init 'Installing Opera Next'

if available md5
then
	md5prog=md5
elif available md5sum
then
	md5prog=md5sum
else
	md5prog=''
fi

while [ -n "$1" ]
do
	common_opt "$1" || case "$1" in
		--user)
			PREFIX=$HOME/.local
			;;
		--system)
			PREFIX=/usr/local
			;;
		--prefix)
			shift
			PREFIX="$1"
			;;
		--name)
			shift
			case "$1" in
				opera|opera-*)
					SUFFIX=${1#opera}
					;;
				*)
					ui_error '--name string must either be "opera" or begin with "opera-".'
					;;
			esac
			suffix_set=true
			;;
		--suffix)
			shift
			if [ -n "$1" ]
			then
				SUFFIX="-$1"
			else
				SUFFIX=''
			fi
			suffix_set=true
			;;
		--repackage)
			shift
			INTO="$1"
			repackage=true
			interactive=false
			driver=plain
			case "$INTO" in
				'')
					ui_error "--repackage needs a non-empty argument."
					;;
				/*)
					;;
				*)
					INTO=$orig_pwd/$INTO
					;;
			esac
			;;
		--version)
			driver=plain
			version
			exit
			;;
		*)
			driver=plain
			usage
			exit
			;;
	esac
	shift
done

if $talk
then
	version
fi

if ! $interactive && [ -z "$PREFIX" ]
then
	ui_error "Please specify --prefix, --user or --system for unattended installation."
fi

if ! $force && ! $repackage
then
	check_os
fi

if [ $(id -u) -eq 0 ]
then
	prefix_who="running as root"
	prefix_for="for all users"
	prefix_default=/usr/local
else
	prefix_who="not running as root"
	prefix_for="just for yourself"
	prefix_default=$HOME/.local
fi

while true
do
	if [ -n "$PREFIX" ]
	then
		answer=$PREFIX
		bad_answer=ui_error
	elif $interactive
	then
		ui_input "Please choose an installation directory. Opera Next will be installed in bin, share and lib directories under the specified location.

Since you are $prefix_who, you probably want to install Opera Next $prefix_for. The recommended installation prefix in this case is $prefix_default.

Press Enter to accept the recommended location, or specify a different prefix." || exit
		if [ -z "$answer" ]
		then
			answer=$prefix_default
		fi
		bad_answer=ui_message
	else
		ui_warn "Since you are $prefix_who, assuming you want to install Opera Next $prefix_for. Using $prefix_default as the installation prefix."
		answer=$prefix_default
		bad_answer=ui_error
	fi
	case "$answer" in
		''|[!/]*)
			$bad_answer "The installation prefix must begin with a slash."
			continue
			;;
		*' '*)
			$bad_answer "The installation prefix is not allowed to contain whitespace."
			continue
			;;
	esac
	while [ $answer != / -a "${answer%/}" != $answer ]
	do
		answer=${answer%/}
	done
	if $repackage
	then
		PREFIX=$answer
		break
	fi
	prefix_parent=$answer
	while [ ! -e "$prefix_parent" ]
	do
		prefix_parent=${prefix_parent%/*}
		if [ -z "$prefix_parent" ]
		then
			prefix_parent=/
		fi
	done
	if [ -w $prefix_parent ]
	then
		PREFIX=$answer
		break
	elif [ -d $prefix_parent ]
	then
		$bad_answer "You do not have write permissions for $prefix_parent. Perhaps you should be installing as root?"
	else
		$bad_answer "$prefix_parent is not a directory."
	fi
done

if [ -z "$INTO" ]
then
	INTO=$PREFIX
fi

while true
do
	if $suffix_set
	then
		answer=opera$SUFFIX
		bad_answer=ui_error
	elif $interactive
	then
		ui_input "You can install Opera Next with an alternative package name, so that the installation does not conflict with other installations of Opera you might have. For example, if you specify opera-11.50 as the package name, Opera files will be installed under $PREFIX/share/opera-11.50 and $PREFIX/lib/opera-11.50, and you will have to run $PREFIX/bin/opera-11.50 to run it. The default location of your profile directory will then be ~/.opera-11.50. If you want that, please enter the desired package name below. The name must be either \"opera\" or begin with \"opera-\". Only Latin letters, digits, periods and dashes are allowed.

Pressing Enter to accept the default and install as \"opera-next\" is a safe choice." || exit
		bad_answer=ui_message
	else
		answer=''
	fi
	case "$answer" in
		'')
			SUFFIX='-next'
			_SUFFIX=' Next'
			USUFFIX='-NEXT'
			break
			;;
		opera-*[!-.A-Za-z0-9]*)
			$bad_answer "The package name is only allowed to contain Latin letters, digits, periods and dashes."
			;;
		opera-*)
			SUFFIX=${answer#opera}
			_SUFFIX=' '$(echo ${answer#opera-} | cut -c 1 | tr a-z A-Z)${answer#opera-?}
			USUFFIX=-$(echo ${answer#opera-} | tr a-z A-Z)
			break
			;;
		opera)
			SUFFIX=''
			_SUFFIX=''
			USUFFIX=''
			break
			;;
		*)
			$bad_answer "The package name must either be \"opera\" or begin with \"opera-\"."
			;;
	esac
done

if ! $repackage && [ -f "$INTO/share/opera$SUFFIX/package-id.ini" ]
then
	upgrade_product=$(sed -ne '/^Product=\(.*\)$/s//\1/p' "$INTO/share/opera$SUFFIX/package-id.ini")
	upgrade_version=$(sed -ne '/^Version=\(.*\)$/s//\1/p' "$INTO/share/opera$SUFFIX/package-id.ini")
	upgrade_build=$(sed -ne '/^Build=\(.*\)$/s//\1/p' "$INTO/share/opera$SUFFIX/package-id.ini")
	if [ -z "$upgrade_product" ]
	then
		upgrade_product=opera
	fi
	if [ "$upgrade_product" = opera ]
	then
		upgrade_title='Opera'
	else
		upgrade_title='Opera '$(echo ${upgrade_product#opera-} | cut -c 1 | tr a-z A-Z)${answer#?}
	fi
	if [ -n "$upgrade_version" -a -n "$upgrade_build" ]
	then
		if [ "$upgrade_product" = opera-next -a "$upgrade_version" = 11.50 -a "$upgrade_build" = 1015 ]
		then
			msg="The chosen location already contains an installation of $upgrade_title 11.50 build 1015. The installer will attempt to refresh it."
		elif [ "$upgrade_product" = opera-next ]
		then
			msg="The chosen location contains an installation of $upgrade_title $upgrade_version build $upgrade_build. The installer will attempt to upgrade it to version 11.50 build 1015."
		else
			msg="The chosen location contains an installation of $upgrade_title $upgrade_version build $upgrade_build. The installer will attempt to replace it with Opera Next version 11.50 build 1015."
		fi
		if $interactive
		then
			ui_warn "$msg"
		elif $talk
		then
			ui_message "$msg"
		fi
	fi
fi

ui_progress_begin "Verifying package"
iterate verify_file
ui_progress_end

if [ -n "$tempdir" -a -f $tempdir/damaged ] && ! $force
then
	ui_error "The following files are missing or damaged:" $tempdir/damaged
fi

if ! $force && ! $repackage
then
	need_rollback=true
fi

make_tempdir

if ! $repackage && [ -x "$PREFIX/bin/uninstall-opera$SUFFIX" ]
then
	if $talk
	then
		ui_info "Removing old files..."
	fi
	"$PREFIX/bin/uninstall-opera$SUFFIX" --upgrade $tempdir
fi

ui_progress_begin "Installing files"
iterate install_file
ui_progress_end

need_rollback=false

if ! $repackage
then
	if $talk
	then
		ui_info "Finalizing installation..."
	fi
	if [ -f $tempdir/commit ]
	then
		. $tempdir/commit
	fi
	if $talk && [ "$driver" = plain ]
	then
		finalize_desktop
	else
		finalize_desktop >/dev/null 2>&1
	fi
fi

if $talk
then
	if [ -n "$upgrade_version" -a -n "$upgrade_build" ]
	then
		done='upgraded'
	else
		done='installed'
	fi
	if $repackage
	then
		ui_message "Opera Next has been installed successfully under $INTO as if it were $PREFIX."
	else
		ui_message "Opera Next has been $done successfully. To start, run $PREFIX/bin/opera$SUFFIX (you might want to add this location to your PATH).

To uninstall Opera Next, run $PREFIX/bin/uninstall-opera$SUFFIX."
	fi
fi
