irc_xpi.patch 99 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897
  1. # HG changeset patch
  2. # User Ian Neal <iann_cvs@blueyonder.co.uk>
  3. # Date 1613311926 0
  4. # Parent bacc3a87f4bb904a491845d99c7765d1b9e78afe
  5. diff --git a/suite/extensions/irc/Makefile.in b/suite/extensions/irc/Makefile.in
  6. deleted file mode 100644
  7. --- a/suite/extensions/irc/Makefile.in
  8. +++ /dev/null
  9. @@ -1,47 +0,0 @@
  10. -#
  11. -# This Source Code Form is subject to the terms of the Mozilla Public
  12. -# License, v. 2.0. If a copy of the MPL was not distributed with this
  13. -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  14. -
  15. -DEPTH = ../../../..
  16. -topsrcdir = @top_srcdir@
  17. -srcdir = @srcdir@
  18. -VPATH = @srcdir@
  19. -
  20. -include $(DEPTH)/config/autoconf.mk
  21. -include $(srcdir)/maxversions.mk
  22. -
  23. -PACKAGE_FILE = chatzilla.pkg
  24. -
  25. -DIST_FILES = xpi/resources/install.rdf
  26. -
  27. -CHATZILLA_VERSION=$(shell grep "const __cz_version" "$(srcdir)/xul/content/static.js" | sed "s|.*\"\([^\"]\{1,\}\)\".*|\1|")
  28. -
  29. -XPI_NAME = chatzilla
  30. -INSTALL_EXTENSION_ID = {59c81df5-4b7a-477b-912d-4e0fdf64e5f2}
  31. -XPI_PKGNAME = chatzilla-$(CHATZILLA_VERSION)
  32. -
  33. -# include config.mk before using the AB_CD var it sets in an if statement
  34. -include $(topsrcdir)/config/config.mk
  35. -
  36. -# always build en-US locale, add build locale if supported
  37. -BUILD_LOCALES = en-US
  38. -ifneq (,$(filter $(AB_CD),$(shell cat $(srcdir)/locales/all-locales)))
  39. -BUILD_LOCALES += $(AB_CD)
  40. -endif
  41. -
  42. -DEFINES += -DCHATZILLA_VERSION=$(CHATZILLA_VERSION) \
  43. - -DSEAMONKEY_MAXVERSION=$(SEAMONKEY_MAXVERSION) \
  44. - $(NULL)
  45. -
  46. -include $(topsrcdir)/config/rules.mk
  47. -
  48. -libs realchrome:: locales/Makefile
  49. - @$(EXIT_ON_ERROR) \
  50. - for locale in $(BUILD_LOCALES); do \
  51. - $(MAKE) -C locales AB_CD=$$locale; \
  52. - done
  53. -
  54. -export::
  55. - $(NSINSTALL) -D $(FINAL_TARGET)/chrome/icons/default
  56. - $(INSTALL) $(srcdir)/xpi/resources/chatzilla-window* $(FINAL_TARGET)/chrome/icons/default
  57. diff --git a/suite/extensions/irc/locale-jar.mn b/suite/extensions/irc/locale-jar.mn
  58. deleted file mode 100644
  59. --- a/suite/extensions/irc/locale-jar.mn
  60. +++ /dev/null
  61. @@ -1,13 +0,0 @@
  62. -# This Source Code Form is subject to the terms of the Mozilla Public
  63. -# License, v. 2.0. If a copy of the MPL was not distributed with this
  64. -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  65. -
  66. -chatzilla-@LOCALE@.jar:
  67. - locale/@LOCALE@/chatzilla/chatzillaOverlay.dtd (xul/locale/@LOCALE@/chatzillaOverlay.dtd)
  68. - locale/@LOCALE@/chatzilla/browserOverlay.dtd (xul/locale/@LOCALE@/browserOverlay.dtd)
  69. - locale/@LOCALE@/chatzilla/pref-irc.dtd (xul/locale/@LOCALE@/pref-irc.dtd)
  70. - locale/@LOCALE@/chatzilla/chatzilla.dtd (xul/locale/@LOCALE@/chatzilla.dtd)
  71. - locale/@LOCALE@/chatzilla/chatzilla.properties (xul/locale/@LOCALE@/chatzilla.properties)
  72. - locale/@LOCALE@/chatzilla/config.dtd (xul/locale/@LOCALE@/config.dtd)
  73. - locale/@LOCALE@/chatzilla/channels.dtd (xul/locale/@LOCALE@/channels.dtd)
  74. - locale/@LOCALE@/chatzilla/ceip.dtd (xul/locale/@LOCALE@/ceip.dtd)
  75. diff --git a/suite/extensions/irc/locales/Makefile.in b/suite/extensions/irc/locales/Makefile.in
  76. --- a/suite/extensions/irc/locales/Makefile.in
  77. +++ b/suite/extensions/irc/locales/Makefile.in
  78. @@ -1,84 +1,6 @@
  79. -#
  80. # This Source Code Form is subject to the terms of the Mozilla Public
  81. # License, v. 2.0. If a copy of the MPL was not distributed with this
  82. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  83. -
  84. -DEPTH=../../../../..
  85. -topsrcdir=@top_srcdir@
  86. -srcdir=@srcdir@
  87. -VPATH=@srcdir@
  88. -relativesrcdir = comm/suite/extensions/irc/locales
  89. -
  90. -include $(srcdir)/../maxversions.mk
  91. -
  92. -EXTERNALLY_MANAGED_MAKE_FILE := 1
  93. -STANDALONE_MAKEFILE := 1
  94. -JAR_MANIFEST := $(srcdir)/jar.mn
  95. -
  96. -CHATZILLA_VERSION=$(shell grep "const __cz_version" "$(srcdir)/../xul/content/static.js" | sed "s|.*\"\([^\"]\{1,\}\)\".*|\1|")
  97. -CHATZILLA_BASE_VERSION=$(shell echo "$(CHATZILLA_VERSION)" | sed "s|\([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\).*|\1|")
  98. -
  99. -XPI_NAME = chatzilla
  100. -INSTALL_EXTENSION_ID = {59c81df5-4b7a-477b-912d-4e0fdf64e5f2}
  101. -XPI_PKGNAME = chatzilla-$(CHATZILLA_VERSION)
  102. -
  103. -# include config.mk before we override the AB_CD var it sets
  104. -include $(topsrcdir)/config/config.mk
  105. -
  106. -# if the wanted language is not in all-locales, fall back to en-US
  107. -ifeq (,$(filter $(AB_CD),$(shell cat $(srcdir)/all-locales)))
  108. -override AB_CD = en-US
  109. -endif
  110. -
  111. -ifneq (en-US,$(AB_CD))
  112. -XPI_NAME = chatzilla-$(AB_CD)
  113. -INSTALL_EXTENSION_ID = langpack-$(AB_CD)@chatzilla.mozilla.org
  114. -XPI_PKGNAME = chatzilla-$(CHATZILLA_VERSION).$(AB_CD)
  115. -relativesrcdir = extensions/irc/locales
  116. -endif
  117. -
  118. -DEFINES += -DAB_CD=$(AB_CD) \
  119. - -DSEAMONKEY_MAXVERSION=$(SEAMONKEY_MAXVERSION) \
  120. - -DINSTALL_EXTENSION_ID='$(INSTALL_EXTENSION_ID)' \
  121. - -DCHATZILLA_VERSION=$(CHATZILLA_VERSION) \
  122. - -DCHATZILLA_BASE_VERSION=$(CHATZILLA_BASE_VERSION) \
  123. - $(NULL)
  124. -
  125. -APP_DEFINES = $(firstword $(wildcard $(LOCALE_SRCDIR)/defines.inc) \
  126. - $(srcdir)/en-US/defines.inc)
  127. -
  128. -TK_DEFINES = $(firstword \
  129. - $(wildcard $(call EXPAND_LOCALE_SRCDIR,toolkit/locales)/defines.inc) \
  130. - $(MOZILLA_DIR)/toolkit/locales/en-US/defines.inc)
  131. -
  132. -include $(topsrcdir)/config/rules.mk
  133. -
  134. -ifneq (en-US,$(AB_CD))
  135. -libs realchrome::
  136. - @echo "Comparing $(AB_CD) to en-US"
  137. - @$(PERL) $(topsrcdir)/toolkit/locales/compare-locales.pl $(srcdir)/en-US $(LOCALE_SRCDIR)
  138. - cp -rp $(topsrcdir)/comm/suite/extensions/irc/locales/manifest.json $(DIST)/xpi-stage/$(XPI_NAME)/manifest.json
  139. -endif
  140. -
  141. -libs-%: AB_CD=$*
  142. -libs-%:
  143. - # XXX: it would be nice if we could just do nothing if no langpack is being done
  144. - # currently, we just go and (re)build en-US if called with a non-supported locale
  145. - $(MAKE) libs AB_CD=$*
  146. -
  147. -repackage-zip: $(STAGEDIST)
  148. -ifneq (en-US,$(AB_CD))
  149. - $(RM) -rf $(STAGEDIST)/extensions/$(INSTALL_EXTENSION_ID)
  150. - mkdir $(STAGEDIST)/extensions/$(INSTALL_EXTENSION_ID)
  151. - if test -d "$(DIST)/xpi-stage/$(XPI_NAME)/chrome/chatzilla.jar"; then \
  152. - $(RM) -r $(DIST)/xpi-stage/$(XPI_NAME)/chrome/chatzilla;\
  153. - fi
  154. - # use tar for copying as cp doesn't portably preserve timestamps
  155. - cd $(DIST)/xpi-stage/$(XPI_NAME) && \
  156. - tar $(TAR_CREATE_FLAGS) - * | ( cd $(STAGEDIST)/extensions/$(INSTALL_EXTENSION_ID) && tar -xf - )
  157. - @echo "$(AB_CD)"
  158. -endif
  159. -
  160. -repackage-zip-%: $(STAGEDIST)
  161. - @$(MAKE) repackage-zip AB_CD=$* STAGEDIST=$(STAGEDIST)
  162. +LOCALE_TOPDIR=$(topsrcdir)/comm
  163. +LOCALE_RELATIVEDIR=suite/extensions/irc/locales
  164. diff --git a/suite/extensions/irc/locales/generic/install.js b/suite/extensions/irc/locales/generic/install.js
  165. deleted file mode 100644
  166. --- a/suite/extensions/irc/locales/generic/install.js
  167. +++ /dev/null
  168. @@ -1,58 +0,0 @@
  169. -# This Source Code Form is subject to the terms of the Mozilla Public
  170. -# License, v. 2.0. If a copy of the MPL was not distributed with this
  171. -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  172. -
  173. -#filter substitution
  174. -// variables
  175. -var version = "@CHATZILLA_VERSION@";
  176. -var locale = "@AB_CD@";
  177. -var jarFile = "chatzilla.jar";
  178. -var installName = "ChatZilla " + version + " @MOZ_LANG_TITLE@ Language Pack";
  179. -// size of the locale jar file in kibibytes (1024 bytes per KiB)
  180. -// en-US files need about 110 KiB currently, estimate up to 200 KiB for others
  181. -var srDest = 200;
  182. -
  183. -// end variables, start real work
  184. -
  185. -// this function verifies disk space in kilobytes
  186. -function verifyDiskSpace(dirPath, spaceRequired)
  187. -{
  188. - var spaceAvailable;
  189. -
  190. - // Get the available disk space on the given path
  191. - spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
  192. -
  193. - // Convert the available disk space into kilobytes
  194. - spaceAvailable = parseInt(spaceAvailable / 1024);
  195. -
  196. - // do the verification
  197. - if(spaceAvailable < spaceRequired)
  198. - {
  199. - logComment("Insufficient disk space: " + dirPath);
  200. - logComment(" required : " + spaceRequired + " K");
  201. - logComment(" available: " + spaceAvailable + " K");
  202. - return(false);
  203. - }
  204. -
  205. - return(true);
  206. -}
  207. -
  208. -var err = initInstall(installName, "ChatZilla " + locale, version);
  209. -logComment("initInstall: " + err);
  210. -
  211. -if (verifyDiskSpace(getFolder("Program"), srDest))
  212. -{
  213. - addFile("ChatZilla " + locale,
  214. - "chrome/" + jarFile, // jar source folder
  215. - getFolder("Chrome"), // target folder
  216. - ""); // target subdir
  217. -
  218. - registerChrome(LOCALE | DELAYED_CHROME, getFolder("Chrome", jarFile), "locale/" + locale + "/chatzilla/");
  219. -
  220. - if (err==SUCCESS)
  221. - performInstall();
  222. - else
  223. - cancelInstall(err);
  224. -}
  225. -else
  226. - cancelInstall(INSUFFICIENT_DISK_SPACE);
  227. diff --git a/suite/extensions/irc/locales/generic/install.rdf b/suite/extensions/irc/locales/generic/install.rdf
  228. deleted file mode 100644
  229. --- a/suite/extensions/irc/locales/generic/install.rdf
  230. +++ /dev/null
  231. @@ -1,40 +0,0 @@
  232. -<?xml version="1.0"?>
  233. -<!-- This Source Code Form is subject to the terms of the Mozilla Public
  234. - - License, v. 2.0. If a copy of the MPL was not distributed with this
  235. - - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
  236. -
  237. -#filter substitution
  238. -
  239. -#ifndef IRC_STANDALONE_BUILD
  240. -#include @TK_DEFINES@
  241. -#include @APP_DEFINES@
  242. -#endif
  243. -
  244. -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  245. - xmlns:em="http://www.mozilla.org/2004/em-rdf#">
  246. - <Description about="urn:mozilla:install-manifest"
  247. - em:id="@INSTALL_EXTENSION_ID@"
  248. - em:name="ChatZilla @MOZ_LANG_TITLE@ Language Pack"
  249. - em:internalName="langpack_cZ/@AB_CD@"
  250. - em:version="@CHATZILLA_VERSION@"
  251. - em:type="8"
  252. - em:creator="@MOZ_LANGPACK_CREATOR@"
  253. - em:homepageURL="@MOZ_LANGPACK_HOMEPAGE@">
  254. -#ifdef MOZ_LANGPACK_CONTRIBUTORS
  255. - @MOZ_LANGPACK_CONTRIBUTORS@
  256. -#endif
  257. -
  258. - <em:iconURL>chrome://chatzilla/skin/images/logo.png</em:iconURL>
  259. -
  260. - <!-- BEGIN COPY BETWEEN /xpi/resources/install.rdf AND /locales/generic/install.rdf -->
  261. - <em:targetApplication>
  262. - <Description>
  263. - <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
  264. - <em:minVersion>2.0</em:minVersion>
  265. - <em:maxVersion>@SEAMONKEY_MAXVERSION@</em:maxVersion>
  266. - </Description>
  267. - </em:targetApplication>
  268. - <!-- END COPY BETWEEN /xpi/resources/install.rdf AND /locales/generic/install.rdf -->
  269. - <em:unpack>true</em:unpack>
  270. - </Description>
  271. -</RDF>
  272. diff --git a/suite/extensions/irc/locales/generic/manifest.json.in b/suite/extensions/irc/locales/generic/manifest.json.in
  273. deleted file mode 100644
  274. --- a/suite/extensions/irc/locales/generic/manifest.json.in
  275. +++ /dev/null
  276. @@ -1,28 +0,0 @@
  277. -{
  278. - "languages": {
  279. - "de": {
  280. - "chrome_resources": {
  281. - "chatzilla": "chrome/chatzilla/locale/@AB_CD@/chatzilla/"
  282. - },
  283. - "version": "20200429162930"
  284. - }
  285. - },
  286. - "applications": {
  287. - "gecko": {
  288. - "strict_min_version": "@FIREFOX_MAXVERSION@",
  289. - "id": "@INSTALL_EXTENSION_ID@",
  290. - "strict_max_version": "@FIREFOX_MAXVERSION@"
  291. - }
  292. - },
  293. - "langpack_id": "de",
  294. - "version": "@CHATZILLA_VERSION@",
  295. - "name": "ChatZilla @MOZ_LANG_TITLE@ Language Pack",
  296. - "manifest_version": 2,
  297. - "sources": {
  298. - "browser": {
  299. - "base_path": "browser/"
  300. - }
  301. - },
  302. - "author": "Robert Kaiser",
  303. - "description": "ChatZilla @MOZ_LANG_TITLE@ Language Pack"
  304. -}
  305. diff --git a/suite/extensions/irc/locales/jar.mn b/suite/extensions/irc/locales/jar.mn
  306. --- a/suite/extensions/irc/locales/jar.mn
  307. +++ b/suite/extensions/irc/locales/jar.mn
  308. @@ -1,15 +1,15 @@
  309. # This Source Code Form is subject to the terms of the Mozilla Public
  310. # License, v. 2.0. If a copy of the MPL was not distributed with this
  311. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  312. #filter substitution
  313. -chatzilla.jar:
  314. +@AB_CD@.jar:
  315. # the "% locale" line gets put into the .manifest used by toolkit-based apps
  316. % locale chatzilla @AB_CD@ %locale/@AB_CD@/chatzilla/
  317. locale/@AB_CD@/chatzilla/chatzillaOverlay.dtd (%chrome/chatzillaOverlay.dtd)
  318. locale/@AB_CD@/chatzilla/browserOverlay.dtd (%chrome/browserOverlay.dtd)
  319. locale/@AB_CD@/chatzilla/pref-irc.dtd (%chrome/pref-irc.dtd)
  320. locale/@AB_CD@/chatzilla/chatzilla.dtd (%chrome/chatzilla.dtd)
  321. locale/@AB_CD@/chatzilla/chatzilla.properties (%chrome/chatzilla.properties)
  322. locale/@AB_CD@/chatzilla/config.dtd (%chrome/config.dtd)
  323. diff --git a/suite/extensions/irc/locales/l10n.toml b/suite/extensions/irc/locales/l10n.toml
  324. new file mode 100644
  325. --- /dev/null
  326. +++ b/suite/extensions/irc/locales/l10n.toml
  327. @@ -0,0 +1,37 @@
  328. +# This Source Code Form is subject to the terms of the Mozilla Public
  329. +# License, v. 2.0. If a copy of the MPL was not distributed with this
  330. +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  331. +
  332. +basepath = "../../../.."
  333. +
  334. +locales = [
  335. + "cs",
  336. + "de",
  337. + "en-GB",
  338. + "es-ES",
  339. + "fi",
  340. + "fr",
  341. + "it",
  342. + "ja",
  343. + "ja-JP-mac",
  344. + "nb-NO",
  345. + "pl",
  346. + "pt-BR",
  347. + "pt-PT",
  348. + "ru",
  349. + "sk",
  350. + "sv-SE",
  351. +]
  352. +
  353. +[env]
  354. + l = "{l10n_base}/{locale}/"
  355. +
  356. +[[paths]]
  357. + reference = "suite/extensions/irc/locales/en-US/**"
  358. + l10n = "{l}extensions/irc/**"
  359. +
  360. +# ignore MOZ_LANGPACK_CONTRIBUTORS
  361. +[[filters]]
  362. + path = "{l}extensions/irc/defines.inc"
  363. + key = "MOZ_LANGPACK_CONTRIBUTORS"
  364. + action = "ignore"
  365. diff --git a/suite/extensions/irc/locales/manifest.json b/suite/extensions/irc/locales/manifest.json
  366. deleted file mode 100644
  367. --- a/suite/extensions/irc/locales/manifest.json
  368. +++ /dev/null
  369. @@ -1,28 +0,0 @@
  370. -{
  371. - "languages": {
  372. - "de": {
  373. - "chrome_resources": {
  374. - "chatzilla": "chrome/chatzilla/locale/de/chatzilla/"
  375. - },
  376. - "version": "20200429162930"
  377. - }
  378. - },
  379. - "applications": {
  380. - "gecko": {
  381. - "strict_min_version": "60.9.1",
  382. - "id": "langpack-de@chatzilla.mozilla.org",
  383. - "strict_max_version": "60.9.1"
  384. - }
  385. - },
  386. - "langpack_id": "de",
  387. - "version": "60.9.1",
  388. - "name": "ChatZilla Deutsch (DE) Language Pack",
  389. - "manifest_version": 2,
  390. - "sources": {
  391. - "browser": {
  392. - "base_path": "browser/"
  393. - }
  394. - },
  395. - "author": "Robert Kaiser",
  396. - "description": "ChatZilla Deutsch (DE) Language Pack"
  397. -}
  398. diff --git a/suite/extensions/irc/locales/moz.build b/suite/extensions/irc/locales/moz.build
  399. --- a/suite/extensions/irc/locales/moz.build
  400. +++ b/suite/extensions/irc/locales/moz.build
  401. @@ -1,6 +1,6 @@
  402. # vim: set filetype=python:
  403. # This Source Code Form is subject to the terms of the Mozilla Public
  404. # License, v. 2.0. If a copy of the MPL was not distributed with this
  405. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  406. -USE_EXTENSION_MANIFEST = True
  407. +JAR_MANIFESTS += ['jar.mn']
  408. diff --git a/suite/extensions/irc/maxversions.mk b/suite/extensions/irc/maxversions.mk
  409. deleted file mode 100644
  410. --- a/suite/extensions/irc/maxversions.mk
  411. +++ /dev/null
  412. @@ -1,9 +0,0 @@
  413. -# This Source Code Form is subject to the terms of the Mozilla Public
  414. -# License, v. 2.0. If a copy of the MPL was not distributed with this
  415. -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  416. -
  417. -# For extensions we require a max version that is compatible across security releases.
  418. -# SEAMONKEY_MAXVERSION is our method for doing that.
  419. -# Alpha versions 10.0a1 and 10.0a2 aren't affected
  420. -# For Seamonkey, 2.17 becomes 2.17.*, 2.17.1 becomes 2.17.*
  421. -SEAMONKEY_MAXVERSION := 2.57.*
  422. diff --git a/suite/extensions/irc/moz.build b/suite/extensions/irc/moz.build
  423. --- a/suite/extensions/irc/moz.build
  424. +++ b/suite/extensions/irc/moz.build
  425. @@ -1,22 +1,15 @@
  426. # vim: set filetype=python:
  427. # This Source Code Form is subject to the terms of the Mozilla Public
  428. # License, v. 2.0. If a copy of the MPL was not distributed with this
  429. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  430. -CONFIGURE_SUBST_FILES += ['locales/Makefile']
  431. -NO_JS_MANIFEST = True
  432. -USE_EXTENSION_MANIFEST = True
  433. -
  434. -XPI_NAME = 'chatzilla'
  435. -export('XPI_NAME')
  436. +DIRS += [
  437. + 'locales',
  438. +]
  439. JAR_MANIFESTS += ['jar.mn']
  440. EXTRA_COMPONENTS += [
  441. 'js/lib/chatzilla-service.js',
  442. 'js/lib/chatzilla-service.manifest',
  443. ]
  444. -
  445. -FINAL_TARGET_PP_FILES += [
  446. - 'xpi/resources/install.rdf',
  447. -]
  448. diff --git a/suite/extensions/irc/xpi/config/Expression.py b/suite/extensions/irc/xpi/config/Expression.py
  449. deleted file mode 100644
  450. --- a/suite/extensions/irc/xpi/config/Expression.py
  451. +++ /dev/null
  452. @@ -1,175 +0,0 @@
  453. -# This Source Code Form is subject to the terms of the Mozilla Public
  454. -# License, v. 2.0. If a copy of the MPL was not distributed with this
  455. -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  456. -
  457. -"""
  458. -Parses and evaluates simple statements for Preprocessor:
  459. -
  460. -Expression currently supports the following grammar, whitespace is ignored:
  461. -
  462. -expression :
  463. - unary ( ( '==' | '!=' ) unary ) ? ;
  464. -unary :
  465. - '!'? value ;
  466. -value :
  467. - [0-9]+ # integer
  468. - | \w+ # string identifier or value;
  469. -"""
  470. -
  471. -import re
  472. -
  473. -class Expression:
  474. - def __init__(self, expression_string):
  475. - """
  476. - Create a new expression with this string.
  477. - The expression will already be parsed into an Abstract Syntax Tree.
  478. - """
  479. - self.content = expression_string
  480. - self.offset = 0
  481. - self.__ignore_whitespace()
  482. - self.e = self.__get_equality()
  483. - if self.content:
  484. - raise Expression.ParseError, self
  485. -
  486. - def __get_equality(self):
  487. - """
  488. - Production: unary ( ( '==' | '!=' ) unary ) ?
  489. - """
  490. - if not len(self.content):
  491. - return None
  492. - rv = Expression.__AST("equality")
  493. - # unary
  494. - rv.append(self.__get_unary())
  495. - self.__ignore_whitespace()
  496. - if not re.match('[=!]=', self.content):
  497. - # no equality needed, short cut to our prime unary
  498. - return rv[0]
  499. - # append operator
  500. - rv.append(Expression.__ASTLeaf('op', self.content[:2]))
  501. - self.__strip(2)
  502. - self.__ignore_whitespace()
  503. - rv.append(self.__get_unary())
  504. - self.__ignore_whitespace()
  505. - return rv
  506. -
  507. - def __get_unary(self):
  508. - """
  509. - Production: '!'? value
  510. - """
  511. - # eat whitespace right away, too
  512. - not_ws = re.match('!\s*', self.content)
  513. - if not not_ws:
  514. - return self.__get_value()
  515. - rv = Expression.__AST('not')
  516. - self.__strip(not_ws.end())
  517. - rv.append(self.__get_value())
  518. - self.__ignore_whitespace()
  519. - return rv
  520. -
  521. - def __get_value(self):
  522. - """
  523. - Production: ( [0-9]+ | \w+)
  524. - Note that the order is important, and the expression is kind-of
  525. - ambiguous as \w includes 0-9. One could make it unambiguous by
  526. - removing 0-9 from the first char of a string literal.
  527. - """
  528. - rv = None
  529. - word_len = re.match('[0-9]*', self.content).end()
  530. - if word_len:
  531. - rv = Expression.__ASTLeaf('int', int(self.content[:word_len]))
  532. - else:
  533. - word_len = re.match('\w*', self.content).end()
  534. - if word_len:
  535. - rv = Expression.__ASTLeaf('string', self.content[:word_len])
  536. - else:
  537. - raise Expression.ParseError, self
  538. - self.__strip(word_len)
  539. - self.__ignore_whitespace()
  540. - return rv
  541. -
  542. - def __ignore_whitespace(self):
  543. - ws_len = re.match('\s*', self.content).end()
  544. - self.__strip(ws_len)
  545. - return
  546. -
  547. - def __strip(self, length):
  548. - """
  549. - Remove a given amount of chars from the input and update
  550. - the offset.
  551. - """
  552. - self.content = self.content[length:]
  553. - self.offset += length
  554. -
  555. - def evaluate(self, context):
  556. - """
  557. - Evaluate the expression with the given context
  558. - """
  559. -
  560. - # Helper function to evaluate __get_equality results
  561. - def eval_equality(tok):
  562. - left = opmap[tok[0].type](tok[0])
  563. - right = opmap[tok[2].type](tok[2])
  564. - rv = left == right
  565. - if tok[1].value == '!=':
  566. - rv = not rv
  567. - return rv
  568. - # Mapping from token types to evaluator functions
  569. - # Apart from (non-)equality, all these can be simple lambda forms.
  570. - opmap = {
  571. - 'equality': eval_equality,
  572. - 'not': lambda tok: not opmap[tok[0].type](tok[0]),
  573. - 'string': lambda tok: context[tok.value],
  574. - 'int': lambda tok: tok.value}
  575. -
  576. - return opmap[self.e.type](self.e);
  577. -
  578. - class __AST(list):
  579. - """
  580. - Internal class implementing Abstract Syntax Tree nodes
  581. - """
  582. - def __init__(self, type):
  583. - self.type = type
  584. - super(self.__class__, self).__init__(self)
  585. -
  586. - class __ASTLeaf:
  587. - """
  588. - Internal class implementing Abstract Syntax Tree leafs
  589. - """
  590. - def __init__(self, type, value):
  591. - self.value = value
  592. - self.type = type
  593. - def __str__(self):
  594. - return self.value.__str__()
  595. - def __repr__(self):
  596. - return self.value.__repr__()
  597. -
  598. - class ParseError(StandardError):
  599. - """
  600. - Error raised when parsing fails.
  601. - It has two members, offset and content, which give the offset of the
  602. - error and the offending content.
  603. - """
  604. - def __init__(self, expression):
  605. - self.offset = expression.offset
  606. - self.content = expression.content[:3]
  607. - def __str__(self):
  608. - return 'Unexpected content at offset %i, "%s"'%(self.offset, self.content)
  609. -
  610. -class Context(dict):
  611. - """
  612. - This class holds variable values by subclassing dict, and while it
  613. - truthfully reports True and False on
  614. -
  615. - name in context
  616. -
  617. - it returns the variable name itself on
  618. -
  619. - context["name"]
  620. -
  621. - to reflect the ambiguity between string literals and preprocessor
  622. - variables.
  623. - """
  624. - def __getitem__(self, key):
  625. - if key in self:
  626. - return super(self.__class__, self).__getitem__(key)
  627. - return key
  628. diff --git a/suite/extensions/irc/xpi/config/JarMaker.py b/suite/extensions/irc/xpi/config/JarMaker.py
  629. deleted file mode 100644
  630. --- a/suite/extensions/irc/xpi/config/JarMaker.py
  631. +++ /dev/null
  632. @@ -1,465 +0,0 @@
  633. -# This Source Code Form is subject to the terms of the Mozilla Public
  634. -# License, v. 2.0. If a copy of the MPL was not distributed with this
  635. -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  636. -
  637. -'''jarmaker.py provides a python class to package up chrome content by
  638. -processing jar.mn files.
  639. -
  640. -See the documentation for jar.mn on MDC for further details on the format.
  641. -'''
  642. -
  643. -import sys
  644. -import os
  645. -import os.path
  646. -import re
  647. -import logging
  648. -from time import localtime
  649. -from optparse import OptionParser
  650. -from MozZipFile import ZipFile
  651. -from cStringIO import StringIO
  652. -from datetime import datetime
  653. -
  654. -from utils import pushback_iter
  655. -from Preprocessor import Preprocessor
  656. -
  657. -__all__ = ['JarMaker']
  658. -
  659. -class ZipEntry:
  660. - '''Helper class for jar output.
  661. -
  662. - This class defines a simple file-like object for a zipfile.ZipEntry
  663. - so that we can consecutively write to it and then close it.
  664. - This methods hooks into ZipFile.writestr on close().
  665. - '''
  666. - def __init__(self, name, zipfile):
  667. - self._zipfile = zipfile
  668. - self._name = name
  669. - self._inner = StringIO()
  670. -
  671. - def write(self, content):
  672. - 'Append the given content to this zip entry'
  673. - self._inner.write(content)
  674. - return
  675. -
  676. - def close(self):
  677. - 'The close method writes the content back to the zip file.'
  678. - self._zipfile.writestr(self._name, self._inner.getvalue())
  679. -
  680. -def getModTime(aPath):
  681. - if not os.path.isfile(aPath):
  682. - return 0
  683. - mtime = os.stat(aPath).st_mtime
  684. - return localtime(mtime)
  685. -
  686. -
  687. -class JarMaker(object):
  688. - '''JarMaker reads jar.mn files and process those into jar files or
  689. - flat directories, along with chrome.manifest files.
  690. - '''
  691. -
  692. - ignore = re.compile('\s*(\#.*)?$')
  693. - jarline = re.compile('(?:(?P<jarfile>[\w\d.\-\_\\\/]+).jar\:)|(?:\s*(\#.*)?)\s*$')
  694. - regline = re.compile('\%\s+(.*)$')
  695. - entryre = '(?P<optPreprocess>\*)?(?P<optOverwrite>\+?)\s+'
  696. - entryline = re.compile(entryre + '(?P<output>[\w\d.\-\_\\\/\+]+)\s*(\((?P<locale>\%?)(?P<source>[\w\d.\-\_\\\/]+)\))?\s*$')
  697. -
  698. - def __init__(self, outputFormat = 'flat', useJarfileManifest = True,
  699. - useChromeManifest = False):
  700. - self.outputFormat = outputFormat
  701. - self.useJarfileManifest = useJarfileManifest
  702. - self.useChromeManifest = useChromeManifest
  703. - self.pp = Preprocessor()
  704. -
  705. - def getCommandLineParser(self):
  706. - '''Get a optparse.OptionParser for jarmaker.
  707. -
  708. - This OptionParser has the options for jarmaker as well as
  709. - the options for the inner PreProcessor.
  710. - '''
  711. - # HACK, we need to unescape the string variables we get,
  712. - # the perl versions didn't grok strings right
  713. - p = self.pp.getCommandLineParser(unescapeDefines = True)
  714. - p.add_option('-f', type="choice", default="jar",
  715. - choices=('jar', 'flat', 'symlink'),
  716. - help="fileformat used for output", metavar="[jar, flat, symlink]")
  717. - p.add_option('-v', action="store_true", dest="verbose",
  718. - help="verbose output")
  719. - p.add_option('-q', action="store_false", dest="verbose",
  720. - help="verbose output")
  721. - p.add_option('-e', action="store_true",
  722. - help="create chrome.manifest instead of jarfile.manifest")
  723. - p.add_option('--both-manifests', action="store_true",
  724. - dest="bothManifests",
  725. - help="create chrome.manifest and jarfile.manifest")
  726. - p.add_option('-s', type="string", action="append", default=[],
  727. - help="source directory")
  728. - p.add_option('-t', type="string",
  729. - help="top source directory")
  730. - p.add_option('-c', '--l10n-src', type="string", action="append",
  731. - help="localization directory")
  732. - p.add_option('--l10n-base', type="string", action="append", default=[],
  733. - help="base directory to be used for localization (multiple)")
  734. - p.add_option('-j', type="string",
  735. - help="jarfile directory")
  736. - # backwards compat, not needed
  737. - p.add_option('-a', action="store_false", default=True,
  738. - help="NOT SUPPORTED, turn auto-registration of chrome off (installed-chrome.txt)")
  739. - p.add_option('-d', type="string",
  740. - help="UNUSED, chrome directory")
  741. - p.add_option('-o', help="cross compile for auto-registration, ignored")
  742. - p.add_option('-l', action="store_true",
  743. - help="ignored (used to switch off locks)")
  744. - p.add_option('-x', action="store_true",
  745. - help="force Unix")
  746. - p.add_option('-z', help="backwards compat, ignored")
  747. - p.add_option('-p', help="backwards compat, ignored")
  748. - return p
  749. -
  750. - def processIncludes(self, includes):
  751. - '''Process given includes with the inner PreProcessor.
  752. -
  753. - Only use this for #defines, the includes shouldn't generate
  754. - content.
  755. - '''
  756. - self.pp.out = StringIO()
  757. - for inc in includes:
  758. - self.pp.do_include(inc)
  759. - includesvalue = self.pp.out.getvalue()
  760. - if includesvalue:
  761. - logging.info("WARNING: Includes produce non-empty output")
  762. - self.pp.out = None
  763. - pass
  764. -
  765. - def finalizeJar(self, jarPath, chromebasepath, register,
  766. - doZip=True):
  767. - '''Helper method to write out the chrome registration entries to
  768. - jarfile.manifest or chrome.manifest, or both.
  769. -
  770. - The actual file processing is done in updateManifest.
  771. - '''
  772. - # rewrite the manifest, if entries given
  773. - if not register:
  774. - return
  775. - if self.useJarfileManifest:
  776. - self.updateManifest(jarPath + '.manifest', chromebasepath % '',
  777. - register)
  778. - if self.useChromeManifest:
  779. - manifestPath = os.path.join(os.path.dirname(jarPath),
  780. - '..', 'chrome.manifest')
  781. - self.updateManifest(manifestPath, chromebasepath % 'chrome/',
  782. - register)
  783. -
  784. - def updateManifest(self, manifestPath, chromebasepath, register):
  785. - '''updateManifest replaces the % in the chrome registration entries
  786. - with the given chrome base path, and updates the given manifest file.
  787. - '''
  788. - myregister = dict.fromkeys(map(lambda s: s.replace('%', chromebasepath),
  789. - register.iterkeys()))
  790. - manifestExists = os.path.isfile(manifestPath)
  791. - mode = (manifestExists and 'r+b') or 'wb'
  792. - mf = open(manifestPath, mode)
  793. - if manifestExists:
  794. - # import previous content into hash, ignoring empty ones and comments
  795. - imf = re.compile('(#.*)?$')
  796. - for l in re.split('[\r\n]+', mf.read()):
  797. - if imf.match(l):
  798. - continue
  799. - myregister[l] = None
  800. - mf.seek(0)
  801. - for k in myregister.iterkeys():
  802. - mf.write(k + os.linesep)
  803. - mf.close()
  804. -
  805. - def makeJar(self, infile=None,
  806. - jardir='',
  807. - sourcedirs=[], topsourcedir='', localedirs=None):
  808. - '''makeJar is the main entry point to JarMaker.
  809. -
  810. - It takes the input file, the output directory, the source dirs and the
  811. - top source dir as argument, and optionally the l10n dirs.
  812. - '''
  813. - if isinstance(infile, basestring):
  814. - logging.info("processing " + infile)
  815. - pp = self.pp.clone()
  816. - pp.out = StringIO()
  817. - pp.do_include(infile)
  818. - lines = pushback_iter(pp.out.getvalue().splitlines())
  819. - try:
  820. - while True:
  821. - l = lines.next()
  822. - m = self.jarline.match(l)
  823. - if not m:
  824. - raise RuntimeError(l)
  825. - if m.group('jarfile') is None:
  826. - # comment
  827. - continue
  828. - self.processJarSection(m.group('jarfile'), lines,
  829. - jardir, sourcedirs, topsourcedir,
  830. - localedirs)
  831. - except StopIteration:
  832. - # we read the file
  833. - pass
  834. - return
  835. -
  836. - def makeJars(self, infiles, l10nbases,
  837. - jardir='',
  838. - sourcedirs=[], topsourcedir='', localedirs=None):
  839. - '''makeJars is the second main entry point to JarMaker.
  840. -
  841. - It takes an iterable sequence of input file names, the l10nbases,
  842. - the output directory, the source dirs and the
  843. - top source dir as argument, and optionally the l10n dirs.
  844. -
  845. - It iterates over all inputs, guesses srcdir and l10ndir from the
  846. - path and topsourcedir and calls into makeJar.
  847. -
  848. - The l10ndirs are created by guessing the relativesrcdir, and resolving
  849. - that against the l10nbases. l10nbases can either be path strings, or
  850. - callables. In the latter case, that will be called with the
  851. - relativesrcdir as argument, and is expected to return a path string.
  852. - This logic is disabled if the jar.mn path is not inside the topsrcdir.
  853. - '''
  854. - topsourcedir = os.path.normpath(os.path.abspath(topsourcedir))
  855. - def resolveL10nBase(relpath):
  856. - def _resolve(base):
  857. - if isinstance(base, basestring):
  858. - return os.path.join(base, relpath)
  859. - if callable(base):
  860. - return base(relpath)
  861. - return base
  862. - return _resolve
  863. - for infile in infiles:
  864. - srcdir = os.path.normpath(os.path.abspath(os.path.dirname(infile)))
  865. - l10ndir = srcdir
  866. - if os.path.basename(srcdir) == 'locales':
  867. - l10ndir = os.path.dirname(l10ndir)
  868. -
  869. - l10ndirs = None
  870. - # srcdir may not be a child of topsourcedir, in which case
  871. - # we assume that the caller passed in suitable sourcedirs,
  872. - # and just skip passing in localedirs
  873. - if srcdir.startswith(topsourcedir):
  874. - rell10ndir = l10ndir[len(topsourcedir):].lstrip(os.sep)
  875. -
  876. - l10ndirs = map(resolveL10nBase(rell10ndir), l10nbases)
  877. - if localedirs is not None:
  878. - l10ndirs += [os.path.normpath(os.path.abspath(s))
  879. - for s in localedirs]
  880. - srcdirs = [os.path.normpath(os.path.abspath(s))
  881. - for s in sourcedirs] + [srcdir]
  882. - self.makeJar(infile=infile,
  883. - sourcedirs=srcdirs, topsourcedir=topsourcedir,
  884. - localedirs=l10ndirs,
  885. - jardir=jardir)
  886. -
  887. -
  888. - def processJarSection(self, jarfile, lines,
  889. - jardir, sourcedirs, topsourcedir, localedirs):
  890. - '''Internal method called by makeJar to actually process a section
  891. - of a jar.mn file.
  892. -
  893. - jarfile is the basename of the jarfile or the directory name for
  894. - flat output, lines is a pushback_iterator of the lines of jar.mn,
  895. - the remaining options are carried over from makeJar.
  896. - '''
  897. -
  898. - # chromebasepath is used for chrome registration manifests
  899. - # %s is getting replaced with chrome/ for chrome.manifest, and with
  900. - # an empty string for jarfile.manifest
  901. - chromebasepath = '%s' + jarfile
  902. - if self.outputFormat == 'jar':
  903. - chromebasepath = 'jar:' + chromebasepath + '.jar!'
  904. - chromebasepath += '/'
  905. -
  906. - jarfile = os.path.join(jardir, jarfile)
  907. - jf = None
  908. - if self.outputFormat == 'jar':
  909. - #jar
  910. - jarfilepath = jarfile + '.jar'
  911. - try:
  912. - os.makedirs(os.path.dirname(jarfilepath))
  913. - except OSError:
  914. - pass
  915. - jf = ZipFile(jarfilepath, 'a', lock = True)
  916. - outHelper = self.OutputHelper_jar(jf)
  917. - else:
  918. - outHelper = getattr(self, 'OutputHelper_' + self.outputFormat)(jarfile)
  919. - register = {}
  920. - # This loop exits on either
  921. - # - the end of the jar.mn file
  922. - # - an line in the jar.mn file that's not part of a jar section
  923. - # - on an exception raised, close the jf in that case in a finally
  924. - try:
  925. - while True:
  926. - try:
  927. - l = lines.next()
  928. - except StopIteration:
  929. - # we're done with this jar.mn, and this jar section
  930. - self.finalizeJar(jarfile, chromebasepath, register)
  931. - if jf is not None:
  932. - jf.close()
  933. - # reraise the StopIteration for makeJar
  934. - raise
  935. - if self.ignore.match(l):
  936. - continue
  937. - m = self.regline.match(l)
  938. - if m:
  939. - rline = m.group(1)
  940. - register[rline] = 1
  941. - continue
  942. - m = self.entryline.match(l)
  943. - if not m:
  944. - # neither an entry line nor chrome reg, this jar section is done
  945. - self.finalizeJar(jarfile, chromebasepath, register)
  946. - if jf is not None:
  947. - jf.close()
  948. - lines.pushback(l)
  949. - return
  950. - self._processEntryLine(m, sourcedirs, topsourcedir, localedirs,
  951. - outHelper, jf)
  952. - finally:
  953. - if jf is not None:
  954. - jf.close()
  955. - return
  956. -
  957. - def _processEntryLine(self, m,
  958. - sourcedirs, topsourcedir, localedirs,
  959. - outHelper, jf):
  960. - out = m.group('output')
  961. - src = m.group('source') or os.path.basename(out)
  962. - # pick the right sourcedir -- l10n, topsrc or src
  963. - if m.group('locale'):
  964. - src_base = localedirs
  965. - elif src.startswith('/'):
  966. - # path/in/jar/file_name.xul (/path/in/sourcetree/file_name.xul)
  967. - # refers to a path relative to topsourcedir, use that as base
  968. - # and strip the leading '/'
  969. - src_base = [topsourcedir]
  970. - src = src[1:]
  971. - else:
  972. - # use srcdirs and the objdir (current working dir) for relative paths
  973. - src_base = sourcedirs + ['.']
  974. - # check if the source file exists
  975. - realsrc = None
  976. - for _srcdir in src_base:
  977. - if os.path.isfile(os.path.join(_srcdir, src)):
  978. - realsrc = os.path.join(_srcdir, src)
  979. - break
  980. - if realsrc is None:
  981. - if jf is not None:
  982. - jf.close()
  983. - raise RuntimeError('File "%s" not found in %s' % (src, ', '.join(src_base)))
  984. - if m.group('optPreprocess'):
  985. - outf = outHelper.getOutput(out)
  986. - inf = open(realsrc)
  987. - pp = self.pp.clone()
  988. - if src[-4:] == '.css':
  989. - pp.setMarker('%')
  990. - pp.out = outf
  991. - pp.do_include(inf)
  992. - outf.close()
  993. - inf.close()
  994. - return
  995. - # copy or symlink if newer or overwrite
  996. - if (m.group('optOverwrite')
  997. - or (getModTime(realsrc) >
  998. - outHelper.getDestModTime(m.group('output')))):
  999. - if self.outputFormat == 'symlink' and hasattr(os, 'symlink'):
  1000. - outHelper.symlink(realsrc, out)
  1001. - return
  1002. - outf = outHelper.getOutput(out)
  1003. - # open in binary mode, this can be images etc
  1004. - inf = open(realsrc, 'rb')
  1005. - outf.write(inf.read())
  1006. - outf.close()
  1007. - inf.close()
  1008. -
  1009. -
  1010. - class OutputHelper_jar(object):
  1011. - '''Provide getDestModTime and getOutput for a given jarfile.
  1012. - '''
  1013. - def __init__(self, jarfile):
  1014. - self.jarfile = jarfile
  1015. - def getDestModTime(self, aPath):
  1016. - try :
  1017. - info = self.jarfile.getinfo(aPath)
  1018. - return info.date_time
  1019. - except:
  1020. - return 0
  1021. - def getOutput(self, name):
  1022. - return ZipEntry(name, self.jarfile)
  1023. -
  1024. - class OutputHelper_flat(object):
  1025. - '''Provide getDestModTime and getOutput for a given flat
  1026. - output directory. The helper method ensureDirFor is used by
  1027. - the symlink subclass.
  1028. - '''
  1029. - def __init__(self, basepath):
  1030. - self.basepath = basepath
  1031. - def getDestModTime(self, aPath):
  1032. - return getModTime(os.path.join(self.basepath, aPath))
  1033. - def getOutput(self, name):
  1034. - out = self.ensureDirFor(name)
  1035. - # remove previous link or file
  1036. - try:
  1037. - os.remove(out)
  1038. - except OSError, e:
  1039. - if e.errno != 2:
  1040. - raise
  1041. - return open(out, 'wb')
  1042. - def ensureDirFor(self, name):
  1043. - out = os.path.join(self.basepath, name)
  1044. - outdir = os.path.dirname(out)
  1045. - if not os.path.isdir(outdir):
  1046. - os.makedirs(outdir)
  1047. - return out
  1048. -
  1049. - class OutputHelper_symlink(OutputHelper_flat):
  1050. - '''Subclass of OutputHelper_flat that provides a helper for
  1051. - creating a symlink including creating the parent directories.
  1052. - '''
  1053. - def symlink(self, src, dest):
  1054. - out = self.ensureDirFor(dest)
  1055. - # remove previous link or file
  1056. - try:
  1057. - os.remove(out)
  1058. - except OSError, e:
  1059. - if e.errno != 2:
  1060. - raise
  1061. - os.symlink(src, out)
  1062. -
  1063. -def main():
  1064. - jm = JarMaker()
  1065. - p = jm.getCommandLineParser()
  1066. - (options, args) = p.parse_args()
  1067. - jm.processIncludes(options.I)
  1068. - jm.outputFormat = options.f
  1069. - if options.e:
  1070. - jm.useChromeManifest = True
  1071. - jm.useJarfileManifest = False
  1072. - if options.bothManifests:
  1073. - jm.useChromeManifest = True
  1074. - jm.useJarfileManifest = True
  1075. - noise = logging.INFO
  1076. - if options.verbose is not None:
  1077. - noise = (options.verbose and logging.DEBUG) or logging.WARN
  1078. - if sys.version_info[:2] > (2,3):
  1079. - logging.basicConfig(format = "%(message)s")
  1080. - else:
  1081. - logging.basicConfig()
  1082. - logging.getLogger().setLevel(noise)
  1083. - topsrc = options.t
  1084. - topsrc = os.path.normpath(os.path.abspath(topsrc))
  1085. - if not args:
  1086. - jm.makeJar(infile=sys.stdin,
  1087. - sourcedirs=options.s, topsourcedir=topsrc,
  1088. - localedirs=options.l10n_src,
  1089. - jardir=options.j)
  1090. - else:
  1091. - jm.makeJars(args, options.l10n_base,
  1092. - jardir=options.j,
  1093. - sourcedirs=options.s, topsourcedir=topsrc,
  1094. - localedirs=options.l10n_src)
  1095. -
  1096. -if __name__ == "__main__":
  1097. - main()
  1098. diff --git a/suite/extensions/irc/xpi/config/MozZipFile.py b/suite/extensions/irc/xpi/config/MozZipFile.py
  1099. deleted file mode 100644
  1100. --- a/suite/extensions/irc/xpi/config/MozZipFile.py
  1101. +++ /dev/null
  1102. @@ -1,137 +0,0 @@
  1103. -# This Source Code Form is subject to the terms of the Mozilla Public
  1104. -# License, v. 2.0. If a copy of the MPL was not distributed with this
  1105. -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1106. -
  1107. -import zipfile
  1108. -import time
  1109. -import binascii, struct
  1110. -import zlib
  1111. -import os
  1112. -from utils import lockFile
  1113. -
  1114. -class ZipFile(zipfile.ZipFile):
  1115. - """ Class with methods to open, read, write, close, list zip files.
  1116. -
  1117. - Subclassing zipfile.ZipFile to allow for overwriting of existing
  1118. - entries, though only for writestr, not for write.
  1119. - """
  1120. - def __init__(self, file, mode="r", compression=zipfile.ZIP_STORED,
  1121. - lock = False):
  1122. - if lock:
  1123. - assert isinstance(file, basestring)
  1124. - self.lockfile = lockFile(file + '.lck')
  1125. - else:
  1126. - self.lockfile = None
  1127. -
  1128. - if mode == 'a' and lock:
  1129. - # appending to a file which doesn't exist fails, but we can't check
  1130. - # existence util we hold the lock
  1131. - if (not os.path.isfile(file)) or os.path.getsize(file) == 0:
  1132. - mode = 'w'
  1133. -
  1134. - zipfile.ZipFile.__init__(self, file, mode, compression)
  1135. - self._remove = []
  1136. - self.end = self.fp.tell()
  1137. - self.debug = 0
  1138. -
  1139. - def writestr(self, zinfo_or_arcname, bytes):
  1140. - """Write contents into the archive.
  1141. -
  1142. - The contents is the argument 'bytes', 'zinfo_or_arcname' is either
  1143. - a ZipInfo instance or the name of the file in the archive.
  1144. - This method is overloaded to allow overwriting existing entries.
  1145. - """
  1146. - if not isinstance(zinfo_or_arcname, zipfile.ZipInfo):
  1147. - zinfo = zipfile.ZipInfo(filename=zinfo_or_arcname,
  1148. - date_time=time.localtime(time.time()))
  1149. - zinfo.compress_type = self.compression
  1150. - # Add some standard UNIX file access permissions (-rw-r--r--).
  1151. - zinfo.external_attr = (0x81a4 & 0xFFFF) << 16L
  1152. - else:
  1153. - zinfo = zinfo_or_arcname
  1154. -
  1155. - # Now to the point why we overwrote this in the first place,
  1156. - # remember the entry numbers if we already had this entry.
  1157. - # Optimizations:
  1158. - # If the entry to overwrite is the last one, just reuse that.
  1159. - # If we store uncompressed and the new content has the same size
  1160. - # as the old, reuse the existing entry.
  1161. -
  1162. - doSeek = False # store if we need to seek to the eof after overwriting
  1163. - if self.NameToInfo.has_key(zinfo.filename):
  1164. - # Find the last ZipInfo with our name.
  1165. - # Last, because that's catching multiple overwrites
  1166. - i = len(self.filelist)
  1167. - while i > 0:
  1168. - i -= 1
  1169. - if self.filelist[i].filename == zinfo.filename:
  1170. - break
  1171. - zi = self.filelist[i]
  1172. - if ((zinfo.compress_type == zipfile.ZIP_STORED
  1173. - and zi.compress_size == len(bytes))
  1174. - or (i + 1) == len(self.filelist)):
  1175. - # make sure we're allowed to write, otherwise done by writestr below
  1176. - self._writecheck(zi)
  1177. - # overwrite existing entry
  1178. - self.fp.seek(zi.header_offset)
  1179. - if (i + 1) == len(self.filelist):
  1180. - # this is the last item in the file, just truncate
  1181. - self.fp.truncate()
  1182. - else:
  1183. - # we need to move to the end of the file afterwards again
  1184. - doSeek = True
  1185. - # unhook the current zipinfo, the writestr of our superclass
  1186. - # will add a new one
  1187. - self.filelist.pop(i)
  1188. - self.NameToInfo.pop(zinfo.filename)
  1189. - else:
  1190. - # Couldn't optimize, sadly, just remember the old entry for removal
  1191. - self._remove.append(self.filelist.pop(i))
  1192. - zipfile.ZipFile.writestr(self, zinfo, bytes)
  1193. - self.filelist.sort(lambda l, r: cmp(l.header_offset, r.header_offset))
  1194. - if doSeek:
  1195. - self.fp.seek(self.end)
  1196. - self.end = self.fp.tell()
  1197. -
  1198. - def close(self):
  1199. - """Close the file, and for mode "w" and "a" write the ending
  1200. - records.
  1201. -
  1202. - Overwritten to compact overwritten entries.
  1203. - """
  1204. - if not self._remove:
  1205. - # we don't have anything special to do, let's just call base
  1206. - r = zipfile.ZipFile.close(self)
  1207. - self.lockfile = None
  1208. - return r
  1209. -
  1210. - if self.fp.mode != 'r+b':
  1211. - # adjust file mode if we originally just wrote, now we rewrite
  1212. - self.fp.close()
  1213. - self.fp = open(self.filename, 'r+b')
  1214. - all = map(lambda zi: (zi, True), self.filelist) + \
  1215. - map(lambda zi: (zi, False), self._remove)
  1216. - all.sort(lambda l, r: cmp(l[0].header_offset, r[0].header_offset))
  1217. - # empty _remove for multiple closes
  1218. - self._remove = []
  1219. -
  1220. - lengths = [all[i+1][0].header_offset - all[i][0].header_offset
  1221. - for i in xrange(len(all)-1)]
  1222. - lengths.append(self.end - all[-1][0].header_offset)
  1223. - to_pos = 0
  1224. - for (zi, keep), length in zip(all, lengths):
  1225. - if not keep:
  1226. - continue
  1227. - oldoff = zi.header_offset
  1228. - # python <= 2.4 has file_offset
  1229. - if hasattr(zi, 'file_offset'):
  1230. - zi.file_offset = zi.file_offset + to_pos - oldoff
  1231. - zi.header_offset = to_pos
  1232. - self.fp.seek(oldoff)
  1233. - content = self.fp.read(length)
  1234. - self.fp.seek(to_pos)
  1235. - self.fp.write(content)
  1236. - to_pos += length
  1237. - self.fp.truncate()
  1238. - zipfile.ZipFile.close(self)
  1239. - self.lockfile = None
  1240. diff --git a/suite/extensions/irc/xpi/config/Preprocessor.py b/suite/extensions/irc/xpi/config/Preprocessor.py
  1241. deleted file mode 100644
  1242. --- a/suite/extensions/irc/xpi/config/Preprocessor.py
  1243. +++ /dev/null
  1244. @@ -1,444 +0,0 @@
  1245. -"""
  1246. -This is a very primitive line based preprocessor, for times when using
  1247. -a C preprocessor isn't an option.
  1248. -"""
  1249. -
  1250. -# This Source Code Form is subject to the terms of the Mozilla Public
  1251. -# License, v. 2.0. If a copy of the MPL was not distributed with this
  1252. -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1253. -
  1254. -import sys
  1255. -import os
  1256. -import os.path
  1257. -import re
  1258. -from optparse import OptionParser
  1259. -
  1260. -# hack around win32 mangling our line endings
  1261. -# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65443
  1262. -if sys.platform == "win32":
  1263. - import msvcrt
  1264. - msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
  1265. - os.linesep = '\n'
  1266. -
  1267. -import Expression
  1268. -
  1269. -__all__ = ['Preprocessor', 'preprocess']
  1270. -
  1271. -
  1272. -class Preprocessor:
  1273. - """
  1274. - Class for preprocessing text files.
  1275. - """
  1276. - class Error(RuntimeError):
  1277. - def __init__(self, cpp, MSG, context):
  1278. - self.file = cpp.context['FILE']
  1279. - self.line = cpp.context['LINE']
  1280. - self.key = MSG
  1281. - RuntimeError.__init__(self, (self.file, self.line, self.key, context))
  1282. - def __init__(self):
  1283. - self.context = Expression.Context()
  1284. - for k,v in {'FILE': '',
  1285. - 'LINE': 0,
  1286. - 'DIRECTORY': os.path.abspath('.')}.iteritems():
  1287. - self.context[k] = v
  1288. - self.disableLevel = 0
  1289. - # ifStates can be
  1290. - # 0: hadTrue
  1291. - # 1: wantsTrue
  1292. - # 2: #else found
  1293. - self.ifStates = []
  1294. - self.checkLineNumbers = False
  1295. - self.writtenLines = 0
  1296. - self.filters = []
  1297. - self.cmds = {}
  1298. - for cmd, level in {'define': 0,
  1299. - 'undef': 0,
  1300. - 'if': sys.maxint,
  1301. - 'ifdef': sys.maxint,
  1302. - 'ifndef': sys.maxint,
  1303. - 'else': 1,
  1304. - 'elif': 1,
  1305. - 'elifdef': 1,
  1306. - 'elifndef': 1,
  1307. - 'endif': sys.maxint,
  1308. - 'expand': 0,
  1309. - 'literal': 0,
  1310. - 'filter': 0,
  1311. - 'unfilter': 0,
  1312. - 'include': 0,
  1313. - 'includesubst': 0,
  1314. - 'error': 0}.iteritems():
  1315. - self.cmds[cmd] = (level, getattr(self, 'do_' + cmd))
  1316. - self.out = sys.stdout
  1317. - self.setMarker('#')
  1318. - self.LE = '\n'
  1319. - self.varsubst = re.compile('@(?P<VAR>\w+)@', re.U)
  1320. -
  1321. - def setLineEndings(self, aLE):
  1322. - """
  1323. - Set the line endings to be used for output.
  1324. - """
  1325. - self.LE = {'cr': '\x0D', 'lf': '\x0A', 'crlf': '\x0D\x0A'}[aLE]
  1326. -
  1327. - def setMarker(self, aMarker):
  1328. - """
  1329. - Set the marker to be used for processing directives.
  1330. - Used for handling CSS files, with pp.setMarker('%'), for example.
  1331. - """
  1332. - self.marker = aMarker
  1333. - self.instruction = re.compile('%s(?P<cmd>[a-z]+)(?:\s(?P<args>.*))?$'%aMarker, re.U)
  1334. - self.comment = re.compile(aMarker, re.U)
  1335. -
  1336. - def clone(self):
  1337. - """
  1338. - Create a clone of the current processor, including line ending
  1339. - settings, marker, variable definitions, output stream.
  1340. - """
  1341. - rv = Preprocessor()
  1342. - rv.context.update(self.context)
  1343. - rv.setMarker(self.marker)
  1344. - rv.LE = self.LE
  1345. - rv.out = self.out
  1346. - return rv
  1347. -
  1348. - def write(self, aLine):
  1349. - """
  1350. - Internal method for handling output.
  1351. - """
  1352. - if self.checkLineNumbers:
  1353. - self.writtenLines += 1
  1354. - ln = self.context['LINE']
  1355. - if self.writtenLines != ln:
  1356. - self.out.write('//@line %(line)d "%(file)s"%(le)s'%{'line': ln,
  1357. - 'file': self.context['FILE'],
  1358. - 'le': self.LE})
  1359. - self.writtenLines = ln
  1360. - for f in self.filters:
  1361. - aLine = f[1](aLine)
  1362. - # ensure our line ending. Only need to handle \n, as we're reading
  1363. - # with universal line ending support, at least for files.
  1364. - aLine = re.sub('\n', self.LE, aLine)
  1365. - self.out.write(aLine)
  1366. -
  1367. - def handleCommandLine(self, args, defaultToStdin = False):
  1368. - """
  1369. - Parse a commandline into this parser.
  1370. - Uses OptionParser internally, no args mean sys.argv[1:].
  1371. - """
  1372. - p = self.getCommandLineParser()
  1373. - (options, args) = p.parse_args(args=args)
  1374. - includes = options.I
  1375. - if defaultToStdin and len(args) == 0:
  1376. - args = [sys.stdin]
  1377. - includes.extend(args)
  1378. - for f in includes:
  1379. - self.do_include(f)
  1380. - pass
  1381. -
  1382. - def getCommandLineParser(self, unescapeDefines = False):
  1383. - escapedValue = re.compile('".*"$')
  1384. - def handleE(option, opt, value, parser):
  1385. - for k,v in os.environ.iteritems():
  1386. - self.context[k] = v
  1387. - def handleD(option, opt, value, parser):
  1388. - vals = value.split('=', 1)
  1389. - if len(vals) == 1:
  1390. - vals.append(1)
  1391. - elif unescapeDefines and escapedValue.match(vals[1]):
  1392. - # strip escaped string values
  1393. - vals[1] = vals[1][1:-1]
  1394. - self.context[vals[0]] = vals[1]
  1395. - def handleU(option, opt, value, parser):
  1396. - del self.context[value]
  1397. - def handleF(option, opt, value, parser):
  1398. - self.do_filter(value)
  1399. - def handleLE(option, opt, value, parser):
  1400. - self.setLineEndings(value)
  1401. - def handleMarker(option, opt, value, parser):
  1402. - self.setMarker(value)
  1403. - p = OptionParser()
  1404. - p.add_option('-I', action='append', type="string", default = [],
  1405. - metavar="FILENAME", help='Include file')
  1406. - p.add_option('-E', action='callback', callback=handleE,
  1407. - help='Import the environment into the defined variables')
  1408. - p.add_option('-D', action='callback', callback=handleD, type="string",
  1409. - metavar="VAR[=VAL]", help='Define a variable')
  1410. - p.add_option('-U', action='callback', callback=handleU, type="string",
  1411. - metavar="VAR", help='Undefine a variable')
  1412. - p.add_option('-F', action='callback', callback=handleF, type="string",
  1413. - metavar="FILTER", help='Enable the specified filter')
  1414. - p.add_option('--line-endings', action='callback', callback=handleLE,
  1415. - type="string", metavar="[cr|lr|crlf]",
  1416. - help='Use the specified line endings [Default: OS dependent]')
  1417. - p.add_option('--marker', action='callback', callback=handleMarker,
  1418. - type="string",
  1419. - help='Use the specified marker instead of #')
  1420. - return p
  1421. -
  1422. - def handleLine(self, aLine):
  1423. - """
  1424. - Handle a single line of input (internal).
  1425. - """
  1426. - m = self.instruction.match(aLine)
  1427. - if m:
  1428. - args = None
  1429. - cmd = m.group('cmd')
  1430. - try:
  1431. - args = m.group('args')
  1432. - except IndexError:
  1433. - pass
  1434. - if cmd not in self.cmds:
  1435. - raise Preprocessor.Error(self, 'INVALID_CMD', aLine)
  1436. - level, cmd = self.cmds[cmd]
  1437. - if (level >= self.disableLevel):
  1438. - cmd(args)
  1439. - elif self.disableLevel == 0 and not self.comment.match(aLine):
  1440. - self.write(aLine)
  1441. - pass
  1442. -
  1443. - # Instruction handlers
  1444. - # These are named do_'instruction name' and take one argument
  1445. -
  1446. - # Variables
  1447. - def do_define(self, args):
  1448. - m = re.match('(?P<name>\w+)(?:\s(?P<value>.*))?', args, re.U)
  1449. - if not m:
  1450. - raise Preprocessor.Error(self, 'SYNTAX_DEF', args)
  1451. - val = 1
  1452. - if m.group('value'):
  1453. - val = m.group('value')
  1454. - try:
  1455. - if val[0] == '0':
  1456. - val = int(val, 8)
  1457. - else:
  1458. - val = int(val)
  1459. - except:
  1460. - pass
  1461. - self.context[m.group('name')] = val
  1462. - def do_undef(self, args):
  1463. - m = re.match('(?P<name>\w+)$', args, re.U)
  1464. - if not m:
  1465. - raise Preprocessor.Error(self, 'SYNTAX_DEF', args)
  1466. - if args in self.context:
  1467. - del self.context[args]
  1468. - # Logic
  1469. - def ensure_not_else(self):
  1470. - if len(self.ifStates) == 0 or self.ifStates[-1] == 2:
  1471. - sys.stderr.write('WARNING: bad nesting of #else\n')
  1472. - def do_if(self, args, replace=False):
  1473. - if self.disableLevel and not replace:
  1474. - self.disableLevel += 1
  1475. - return
  1476. - val = None
  1477. - try:
  1478. - e = Expression.Expression(args)
  1479. - val = e.evaluate(self.context)
  1480. - except Exception:
  1481. - # XXX do real error reporting
  1482. - raise Preprocessor.Error(self, 'SYNTAX_ERR', args)
  1483. - if type(val) == str:
  1484. - # we're looking for a number value, strings are false
  1485. - val = False
  1486. - if not val:
  1487. - self.disableLevel = 1
  1488. - if replace:
  1489. - if val:
  1490. - self.disableLevel = 0
  1491. - self.ifStates[-1] = self.disableLevel
  1492. - else:
  1493. - self.ifStates.append(self.disableLevel)
  1494. - pass
  1495. - def do_ifdef(self, args, replace=False):
  1496. - if self.disableLevel and not replace:
  1497. - self.disableLevel += 1
  1498. - return
  1499. - if re.match('\W', args, re.U):
  1500. - raise Preprocessor.Error(self, 'INVALID_VAR', args)
  1501. - if args not in self.context:
  1502. - self.disableLevel = 1
  1503. - if replace:
  1504. - if args in self.context:
  1505. - self.disableLevel = 0
  1506. - self.ifStates[-1] = self.disableLevel
  1507. - else:
  1508. - self.ifStates.append(self.disableLevel)
  1509. - pass
  1510. - def do_ifndef(self, args, replace=False):
  1511. - if self.disableLevel and not replace:
  1512. - self.disableLevel += 1
  1513. - return
  1514. - if re.match('\W', args, re.U):
  1515. - raise Preprocessor.Error(self, 'INVALID_VAR', args)
  1516. - if args in self.context:
  1517. - self.disableLevel = 1
  1518. - if replace:
  1519. - if args not in self.context:
  1520. - self.disableLevel = 0
  1521. - self.ifStates[-1] = self.disableLevel
  1522. - else:
  1523. - self.ifStates.append(self.disableLevel)
  1524. - pass
  1525. - def do_else(self, args, ifState = 2):
  1526. - self.ensure_not_else()
  1527. - hadTrue = self.ifStates[-1] == 0
  1528. - self.ifStates[-1] = ifState # in-else
  1529. - if hadTrue:
  1530. - self.disableLevel = 1
  1531. - return
  1532. - self.disableLevel = 0
  1533. - def do_elif(self, args):
  1534. - if self.disableLevel == 1:
  1535. - if self.ifStates[-1] == 1:
  1536. - self.do_if(args, replace=True)
  1537. - else:
  1538. - self.do_else(None, self.ifStates[-1])
  1539. - def do_elifdef(self, args):
  1540. - if self.disableLevel == 1:
  1541. - if self.ifStates[-1] == 1:
  1542. - self.do_ifdef(args, replace=True)
  1543. - else:
  1544. - self.do_else(None, self.ifStates[-1])
  1545. - def do_elifndef(self, args):
  1546. - if self.disableLevel == 1:
  1547. - if self.ifStates[-1] == 1:
  1548. - self.do_ifndef(args, replace=True)
  1549. - else:
  1550. - self.do_else(None, self.ifStates[-1])
  1551. - def do_endif(self, args):
  1552. - if self.disableLevel > 0:
  1553. - self.disableLevel -= 1
  1554. - if self.disableLevel == 0:
  1555. - self.ifStates.pop()
  1556. - # output processing
  1557. - def do_expand(self, args):
  1558. - lst = re.split('__(\w+)__', args, re.U)
  1559. - do_replace = False
  1560. - def vsubst(v):
  1561. - if v in self.context:
  1562. - return str(self.context[v])
  1563. - return ''
  1564. - for i in range(1, len(lst), 2):
  1565. - lst[i] = vsubst(lst[i])
  1566. - lst.append('\n') # add back the newline
  1567. - self.write(reduce(lambda x, y: x+y, lst, ''))
  1568. - def do_literal(self, args):
  1569. - self.write(args + self.LE)
  1570. - def do_filter(self, args):
  1571. - filters = [f for f in args.split(' ') if hasattr(self, 'filter_' + f)]
  1572. - if len(filters) == 0:
  1573. - return
  1574. - current = dict(self.filters)
  1575. - for f in filters:
  1576. - current[f] = getattr(self, 'filter_' + f)
  1577. - filterNames = current.keys()
  1578. - filterNames.sort()
  1579. - self.filters = [(fn, current[fn]) for fn in filterNames]
  1580. - return
  1581. - def do_unfilter(self, args):
  1582. - filters = args.split(' ')
  1583. - current = dict(self.filters)
  1584. - for f in filters:
  1585. - if f in current:
  1586. - del current[f]
  1587. - filterNames = current.keys()
  1588. - filterNames.sort()
  1589. - self.filters = [(fn, current[fn]) for fn in filterNames]
  1590. - return
  1591. - # Filters
  1592. - #
  1593. - # emptyLines
  1594. - # Strips blank lines from the output.
  1595. - def filter_emptyLines(self, aLine):
  1596. - if aLine == '\n':
  1597. - return ''
  1598. - return aLine
  1599. - # slashslash
  1600. - # Strips everything after //
  1601. - def filter_slashslash(self, aLine):
  1602. - [aLine, rest] = aLine.split('//', 1)
  1603. - if rest:
  1604. - aLine += '\n'
  1605. - return aLine
  1606. - # spaces
  1607. - # Collapses sequences of spaces into a single space
  1608. - def filter_spaces(self, aLine):
  1609. - return re.sub(' +', ' ', aLine).strip(' ')
  1610. - # substition
  1611. - # helper to be used by both substition and attemptSubstitution
  1612. - def filter_substitution(self, aLine, fatal=True):
  1613. - def repl(matchobj):
  1614. - varname = matchobj.group('VAR')
  1615. - if varname in self.context:
  1616. - return str(self.context[varname])
  1617. - if fatal:
  1618. - raise Preprocessor.Error(self, 'UNDEFINED_VAR', varname)
  1619. - return ''
  1620. - return self.varsubst.sub(repl, aLine)
  1621. - def filter_attemptSubstitution(self, aLine):
  1622. - return self.filter_substitution(aLine, fatal=False)
  1623. - # File ops
  1624. - def do_include(self, args):
  1625. - """
  1626. - Preprocess a given file.
  1627. - args can either be a file name, or a file-like object.
  1628. - Files should be opened, and will be closed after processing.
  1629. - """
  1630. - isName = type(args) == str or type(args) == unicode
  1631. - oldWrittenLines = self.writtenLines
  1632. - oldCheckLineNumbers = self.checkLineNumbers
  1633. - self.checkLineNumbers = False
  1634. - if isName:
  1635. - try:
  1636. - args = str(args)
  1637. - if not os.path.isabs(args):
  1638. - args = os.path.join(self.context['DIRECTORY'], args)
  1639. - args = open(args, 'rU')
  1640. - except:
  1641. - raise Preprocessor.Error(self, 'FILE_NOT_FOUND', str(args))
  1642. - self.checkLineNumbers = bool(re.search('\.js(?:\.in)?$', args.name))
  1643. - oldFile = self.context['FILE']
  1644. - oldLine = self.context['LINE']
  1645. - oldDir = self.context['DIRECTORY']
  1646. - if args.isatty():
  1647. - # we're stdin, use '-' and '' for file and dir
  1648. - self.context['FILE'] = '-'
  1649. - self.context['DIRECTORY'] = ''
  1650. - else:
  1651. - abspath = os.path.abspath(args.name)
  1652. - self.context['FILE'] = abspath
  1653. - self.context['DIRECTORY'] = os.path.dirname(abspath)
  1654. - self.context['LINE'] = 0
  1655. - self.writtenLines = 0
  1656. - for l in args:
  1657. - self.context['LINE'] += 1
  1658. - self.handleLine(l)
  1659. - args.close()
  1660. - self.context['FILE'] = oldFile
  1661. - self.checkLineNumbers = oldCheckLineNumbers
  1662. - self.writtenLines = oldWrittenLines
  1663. - self.context['LINE'] = oldLine
  1664. - self.context['DIRECTORY'] = oldDir
  1665. - def do_includesubst(self, args):
  1666. - args = self.filter_substitution(args)
  1667. - self.do_include(args)
  1668. - def do_error(self, args):
  1669. - raise Preprocessor.Error(self, 'Error: ', str(args))
  1670. -
  1671. -def main():
  1672. - pp = Preprocessor()
  1673. - pp.handleCommandLine(None, True)
  1674. - return
  1675. -
  1676. -def preprocess(includes=[sys.stdin], defines={},
  1677. - output = sys.stdout,
  1678. - line_endings='\n', marker='#'):
  1679. - pp = Preprocessor()
  1680. - pp.context.update(defines)
  1681. - pp.setLineEndings(line_endings)
  1682. - pp.setMarker(marker)
  1683. - pp.out = output
  1684. - for f in includes:
  1685. - pp.do_include(f)
  1686. -
  1687. -if __name__ == "__main__":
  1688. - main()
  1689. diff --git a/suite/extensions/irc/xpi/config/utils.py b/suite/extensions/irc/xpi/config/utils.py
  1690. deleted file mode 100644
  1691. --- a/suite/extensions/irc/xpi/config/utils.py
  1692. +++ /dev/null
  1693. @@ -1,121 +0,0 @@
  1694. -# This Source Code Form is subject to the terms of the Mozilla Public
  1695. -# License, v. 2.0. If a copy of the MPL was not distributed with this
  1696. -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1697. -
  1698. -'''Utility methods to be used by python build infrastructure.
  1699. -'''
  1700. -
  1701. -import os
  1702. -import errno
  1703. -import sys
  1704. -import time
  1705. -import stat
  1706. -
  1707. -class LockFile(object):
  1708. - '''LockFile is used by the lockFile method to hold the lock.
  1709. -
  1710. - This object should not be used directly, but only through
  1711. - the lockFile method below.
  1712. - '''
  1713. - def __init__(self, lockfile):
  1714. - self.lockfile = lockfile
  1715. - def __del__(self):
  1716. - while True:
  1717. - try:
  1718. - os.remove(self.lockfile)
  1719. - break
  1720. - except OSError, e:
  1721. - if e.errno == errno.EACCES:
  1722. - # another process probably has the file open, we'll retry.
  1723. - # just a short sleep since we want to drop the lock ASAP
  1724. - # (but we need to let some other process close the file first)
  1725. - time.sleep(0.1)
  1726. - else:
  1727. - # re-raise unknown errors
  1728. - raise
  1729. -
  1730. -def lockFile(lockfile, max_wait = 600):
  1731. - '''Create and hold a lockfile of the given name, with the given timeout.
  1732. -
  1733. - To release the lock, delete the returned object.
  1734. - '''
  1735. - while True:
  1736. - try:
  1737. - fd = os.open(lockfile, os.O_EXCL | os.O_RDWR | os.O_CREAT)
  1738. - # we created the lockfile, so we're the owner
  1739. - break
  1740. - except OSError, e:
  1741. - if e.errno == errno.EEXIST or \
  1742. - (sys.platform == "win32" and e.errno == errno.EACCES):
  1743. - pass
  1744. - else:
  1745. - # should not occur
  1746. - raise
  1747. -
  1748. - try:
  1749. - # the lock file exists, try to stat it to get its age
  1750. - # and read its contents to report the owner PID
  1751. - f = open(lockfile, "r")
  1752. - s = os.stat(lockfile)
  1753. - except EnvironmentError, e:
  1754. - if e.errno == errno.ENOENT or \
  1755. - (sys.platform == "win32" and e.errno == errno.EACCES):
  1756. - # we didn't create the lockfile, so it did exist, but it's
  1757. - # gone now. Just try again
  1758. - continue
  1759. - sys.exit("%s exists but stat() failed: %s" %
  1760. - (lockfile, e.strerror))
  1761. -
  1762. - # we didn't create the lockfile and it's still there, check
  1763. - # its age
  1764. - now = int(time.time())
  1765. - if now - s[stat.ST_MTIME] > max_wait:
  1766. - pid = f.readline().rstrip()
  1767. - sys.exit("%s has been locked for more than " \
  1768. - "%d seconds (PID %s)" % (lockfile, max_wait,
  1769. - pid))
  1770. -
  1771. - # it's not been locked too long, wait a while and retry
  1772. - f.close()
  1773. - time.sleep(1)
  1774. -
  1775. - # if we get here. we have the lockfile. Convert the os.open file
  1776. - # descriptor into a Python file object and record our PID in it
  1777. -
  1778. - f = os.fdopen(fd, "w")
  1779. - f.write("%d\n" % os.getpid())
  1780. - f.close()
  1781. - return LockFile(lockfile)
  1782. -
  1783. -class pushback_iter(object):
  1784. - '''Utility iterator that can deal with pushed back elements.
  1785. -
  1786. - This behaves like a regular iterable, just that you can call
  1787. - iter.pushback(item)
  1788. - to get the givem item as next item in the iteration.
  1789. - '''
  1790. - def __init__(self, iterable):
  1791. - self.it = iter(iterable)
  1792. - self.pushed_back = []
  1793. -
  1794. - def __iter__(self):
  1795. - return self
  1796. -
  1797. - def __nonzero__(self):
  1798. - if self.pushed_back:
  1799. - return True
  1800. -
  1801. - try:
  1802. - self.pushed_back.insert(0, self.it.next())
  1803. - except StopIteration:
  1804. - return False
  1805. - else:
  1806. - return True
  1807. -
  1808. - def next(self):
  1809. - if self.pushed_back:
  1810. - return self.pushed_back.pop()
  1811. - return self.it.next()
  1812. -
  1813. - def pushback(self, item):
  1814. - self.pushed_back.append(item)
  1815. diff --git a/suite/extensions/irc/xpi/makexpi.py b/suite/extensions/irc/xpi/makexpi.py
  1816. deleted file mode 100755
  1817. --- a/suite/extensions/irc/xpi/makexpi.py
  1818. +++ /dev/null
  1819. @@ -1,418 +0,0 @@
  1820. -#!/usr/bin/python
  1821. -# This Source Code Form is subject to the terms of the Mozilla Public
  1822. -# License, v. 2.0. If a copy of the MPL was not distributed with this
  1823. -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
  1824. -
  1825. -"""
  1826. -Rewrite of ChatZilla's makexpi.sh into python
  1827. -
  1828. -This code isnt especially pythonic, as I have
  1829. -tried to follow the code and control flow from
  1830. -the original shell script
  1831. -"""
  1832. -
  1833. -import os
  1834. -import os.path
  1835. -import sys
  1836. -import shutil
  1837. -import re
  1838. -import zipfile
  1839. -from os.path import join as joinpath
  1840. -
  1841. -# Set up settings and paths for finding files.
  1842. -pwd = os.path.dirname(__file__)
  1843. -
  1844. -ffversion = '56.*'
  1845. -smversion = '2.57.*'
  1846. -
  1847. -if pwd == '':
  1848. - pwd = os.getcwd()
  1849. -else:
  1850. - os.chdir(pwd)
  1851. -
  1852. -def getenv(var, default, dir=False, check=False):
  1853. - """
  1854. - Grab an environment variable, or a default
  1855. - """
  1856. - try:
  1857. - value = os.environ[var]
  1858. - except KeyError:
  1859. - value = default
  1860. - if dir:
  1861. - if not os.path.isabs(value):
  1862. - value = os.path.normpath(joinpath(pwd, value))
  1863. - else:
  1864. - value = os.path.normpath(value)
  1865. - if check and not os.path.isdir(value):
  1866. - print 'ERROR: Directory %s not found.' % value
  1867. - sys.exit(1)
  1868. -
  1869. - return value
  1870. -
  1871. -
  1872. -debug = int(getenv('DEBUG', 0))
  1873. -configdir = getenv('CONFIGDIR', joinpath(pwd, 'config'), dir=True, check=True)
  1874. -
  1875. -# Display all the settings and paths if we're in debug mode.
  1876. -if debug > 0:
  1877. - print 'DEBUG = %s' % debug
  1878. - print 'CONFIGDIR = %s' % configdir
  1879. -
  1880. -# append the config dir to path before importing the utils
  1881. -sys.path.append(configdir)
  1882. -
  1883. -from Preprocessor import preprocess
  1884. -from JarMaker import JarMaker
  1885. -
  1886. -## define functions to replace the OS calls from makexpi.sh
  1887. -
  1888. -def echo(str):
  1889. - """
  1890. - print a string without a newline or trailing space
  1891. -
  1892. - generally used in place of "echo -n" from the original code
  1893. - """
  1894. - sys.stdout.write(str)
  1895. -
  1896. -def rm(path):
  1897. - """
  1898. - remove file or directory, recurses on directory
  1899. -
  1900. - This will fail silently if the file is not found
  1901. - but any other exceptions will be raised
  1902. - """
  1903. - try:
  1904. - if os.path.isdir(path):
  1905. - shutil.rmtree(path)
  1906. - else:
  1907. - os.remove(path)
  1908. - except WindowsError, ex:
  1909. - if ex.errno != 2:
  1910. - raise
  1911. -def mkdir(dir):
  1912. - """
  1913. - acts like mkdir -p
  1914. - """
  1915. - try:
  1916. - os.makedirs(dir)
  1917. - except os.error:
  1918. - pass # dont error out if there dir already exists
  1919. -
  1920. -def copy(src, dst):
  1921. - """
  1922. - copy file
  1923. - """
  1924. - shutil.copy(src, dst)
  1925. -
  1926. -def move(src, dst):
  1927. - """
  1928. - move file
  1929. - """
  1930. - shutil.move(src, dst)
  1931. -
  1932. -def sed((pattern, replacement), input, output):
  1933. - """
  1934. - similar functionality to unix command 'sed'
  1935. - """
  1936. - regex = re.compile(pattern)
  1937. - for line in input:
  1938. - line = regex.sub(replacement, line)
  1939. - output.write(line)
  1940. -
  1941. -def zip(filename, source_dir, include=None, exclude=None):
  1942. - """
  1943. - create a zip file of a directory's contents
  1944. -
  1945. - include and exclude are filtering functions, they will
  1946. - be passed the basename of each file in the directory
  1947. - and should either return true or false if the file
  1948. - should be included or excluded respectively
  1949. - """
  1950. - z = zipfile.ZipFile(filename, 'w', zipfile.ZIP_DEFLATED)
  1951. - for dirpath, dirnames, filenames in os.walk(source_dir):
  1952. - for filename in filenames:
  1953. - if include is not None and not include(filename) \
  1954. - or exclude is not None and exclude(filename):
  1955. - continue
  1956. - full_filename = joinpath(dirpath, filename)
  1957. - offset = len(os.path.commonprefix([source_dir,full_filename])) + 1
  1958. - archive_filename = full_filename[offset:]
  1959. - z.write(full_filename, archive_filename)
  1960. - z.close()
  1961. -
  1962. -## Begin real program ##
  1963. -
  1964. -def clean():
  1965. - """
  1966. - check arguments for cleanup flag
  1967. - """
  1968. - for arg in sys.argv:
  1969. - if arg == 'clean':
  1970. - return True
  1971. - return False
  1972. -
  1973. -def locale():
  1974. - """
  1975. - check arguments for locale or return None
  1976. - """
  1977. - locale_pattern = re.compile(r'^[a-z]{1,3}(?:-[A-Z]{1,3}(?:-[a-z]{1,3})?)?$')
  1978. - for arg in sys.argv:
  1979. - locale_match = locale_pattern.match(arg)
  1980. - if locale_match is not None:
  1981. - return arg
  1982. - return None
  1983. -
  1984. -def version(fedir):
  1985. - """
  1986. - get version number from source files
  1987. - """
  1988. - version_pattern = re.compile(r'const __cz_version\s+=\s*\"([^\"]+)\"')
  1989. - for line in open(joinpath(fedir, 'xul', 'content', 'static.js'), 'r'):
  1990. - match = version_pattern.match(line)
  1991. - if match is None:
  1992. - continue
  1993. - return match.group(1)
  1994. - print 'ERROR: Unable to get version number.'
  1995. - sys.exit(1)
  1996. -
  1997. -fedir = getenv('FEDIR', joinpath(pwd, '..'), dir=True, check=True)
  1998. -xpifiles = getenv('XPIFILES', joinpath(pwd, 'resources'), dir=True, check=True)
  1999. -xpiroot = getenv('XPIROOT', joinpath(pwd, 'xpi-tree'), dir=True)
  2000. -jarroot = getenv('JARROOT', joinpath(pwd, 'jar-tree'), dir=True)
  2001. -localedir = getenv('LOCALEDIR', joinpath(fedir, 'locales'), dir=True, check=True)
  2002. -locale = locale()
  2003. -if locale is None:
  2004. - locale = getenv('LOCALE', None)
  2005. -else:
  2006. - xpiroot = '%s-%s' % (xpiroot, locale)
  2007. - jarroot = '%s-%s' % (jarroot, locale)
  2008. -
  2009. -version = version(fedir)
  2010. -xpiname = None
  2011. -
  2012. -if debug > 0:
  2013. - print 'FEDIR = %s' % fedir
  2014. - print 'XPIFILES = %s' % xpifiles
  2015. - print 'XPIROOT = %s' % xpiroot
  2016. - print 'JARROOT = %s' % jarroot
  2017. - print 'LOCALEDIR = %s' % localedir
  2018. - print 'LOCALE = %s' % locale
  2019. -
  2020. -
  2021. -def check_xpiname(name):
  2022. - if debug > 1:
  2023. - print ' XPI name: %s' % name
  2024. - if os.path.exists(joinpath(pwd, name)):
  2025. - print ' WARNING: Output XPI will be overwritten.'
  2026. - return name
  2027. -
  2028. -def progress_chmod(file, mode):
  2029. - if debug > 1:
  2030. - print ' chmod 0%o %s' % (mode, file)
  2031. - else:
  2032. - echo('.')
  2033. - os.chmod(file, mode)
  2034. -
  2035. -def progress_copy(infile, outfile):
  2036. - if debug > 1:
  2037. - print ' copy %s %s' % (infile, outfile)
  2038. - else:
  2039. - echo('.')
  2040. - copy(infile, outfile)
  2041. -
  2042. -def progress_echo(message):
  2043. - if debug > 1:
  2044. - print message
  2045. - else:
  2046. - echo(message)
  2047. -
  2048. -def progress_jarmaker():
  2049. - if debug > 1:
  2050. - print ' JarMaker()'
  2051. - else:
  2052. - echo('.')
  2053. - jm = JarMaker()
  2054. - jm.outputFormat = 'jar'
  2055. - jm.useChromeManifest = True
  2056. - jm.useJarfileManifest = False
  2057. - return jm
  2058. -
  2059. -def progress_jarmaker_make(jm, infile, indir, localedirs=None):
  2060. - if debug > 1:
  2061. - print ' makeJar %s %s %s' % (infile, indir, localedirs)
  2062. - else:
  2063. - echo('.')
  2064. - jm.makeJar(
  2065. - infile = open(infile, 'r'),
  2066. - jardir = jarroot,
  2067. - sourcedirs = [indir],
  2068. - localedirs = localedirs,
  2069. - )
  2070. -
  2071. -def progress_mkdir(dir):
  2072. - if debug > 1:
  2073. - print ' mkdir %s' % dir
  2074. - else:
  2075. - echo('.')
  2076. - if not os.path.isdir(dir):
  2077. - mkdir(dir)
  2078. -
  2079. -def progress_move(infile, outfile):
  2080. - if debug > 1:
  2081. - print ' move %s %s' % (infile, outfile)
  2082. - else:
  2083. - echo('.')
  2084. - move(infile, outfile)
  2085. -
  2086. -def progress_preprocess(infile, outfile, defines):
  2087. - if debug > 1:
  2088. - print ' preprocess %s %s %s' % (defines, infile, outfile)
  2089. - else:
  2090. - echo('.')
  2091. - if not isinstance(infile, (list)):
  2092. - infile = [infile]
  2093. - preprocess_outfile = open(outfile, 'w')
  2094. - preprocess(
  2095. - includes = infile,
  2096. - defines = defines,
  2097. - output = preprocess_outfile,
  2098. - line_endings = 'lf',
  2099. - )
  2100. - preprocess_outfile.close()
  2101. -
  2102. -def progress_rm(file):
  2103. - if debug > 1:
  2104. - print ' rm %s' % file
  2105. - else:
  2106. - echo('.')
  2107. - rm(file)
  2108. -
  2109. -def progress_sed(infile, outfile, patterns):
  2110. - if debug > 1:
  2111. - print ' sed %s %s %s' % (patterns, infile, outfile)
  2112. - else:
  2113. - echo('.')
  2114. - sed_infile = open(infile, 'r')
  2115. - sed_outfile = open(outfile, 'w')
  2116. - sed(
  2117. - patterns,
  2118. - input = sed_infile,
  2119. - output = sed_outfile,
  2120. - )
  2121. - sed_infile.close()
  2122. - sed_outfile.close()
  2123. -
  2124. -def progress_zip(indir, outfile):
  2125. - if debug > 1:
  2126. - print ' zip %s %s' % (indir, outfile)
  2127. - else:
  2128. - echo('.')
  2129. - zip(
  2130. - filename = os.path.normpath(outfile),
  2131. - source_dir = indir,
  2132. - include = lambda fn: True,
  2133. - exclude = lambda fn: fn.startswith('log')
  2134. - )
  2135. -
  2136. -
  2137. -def do_clean():
  2138. - echo('Cleaning up files')
  2139. - echo('.')
  2140. - rm(xpiroot)
  2141. - echo('.')
  2142. - rm(jarroot)
  2143. - print('. done.')
  2144. -
  2145. -def do_build_base():
  2146. - print 'Beginning build of ChatZilla %s...' % version
  2147. - xpiname = check_xpiname('chatzilla-%s.xpi' % version)
  2148. -
  2149. - progress_echo(' Checking XPI structure')
  2150. - progress_mkdir(xpiroot)
  2151. - progress_mkdir(joinpath(xpiroot, 'chrome'))
  2152. - progress_mkdir(joinpath(xpiroot, 'chrome', 'icons'))
  2153. - progress_mkdir(joinpath(xpiroot, 'chrome', 'icons', 'default'))
  2154. - progress_mkdir(joinpath(xpiroot, 'components'))
  2155. - print ' done'
  2156. -
  2157. - progress_echo(' Checking JAR structure')
  2158. - progress_mkdir(jarroot)
  2159. - print ' done'
  2160. -
  2161. - progress_echo(' Updating extension files')
  2162. - progress_preprocess(joinpath(xpifiles, 'install.rdf'), joinpath(xpiroot, 'install.rdf'), {'CHATZILLA_VERSION': version, 'SEAMONKEY_MAXVERSION': smversion})
  2163. - progress_copy(joinpath(xpifiles, 'chatzilla-window.ico'), joinpath(xpiroot, 'chrome', 'icons', 'default', 'chatzilla-window.ico'))
  2164. - progress_copy(joinpath(xpifiles, 'chatzilla-window.xpm'), joinpath(xpiroot, 'chrome', 'icons', 'default', 'chatzilla-window.xpm'))
  2165. - progress_copy(joinpath(xpifiles, 'chatzilla-window16.xpm'), joinpath(xpiroot, 'chrome', 'icons', 'default', 'chatzilla-window16.xpm'))
  2166. - print ' done'
  2167. -
  2168. - progress_echo(' Constructing JAR package')
  2169. - jm = progress_jarmaker()
  2170. - progress_jarmaker_make(jm, joinpath(fedir, 'jar.mn'), fedir)
  2171. - progress_jarmaker_make(jm, joinpath(fedir, 'sm', 'jar.mn'), joinpath(fedir, 'sm'))
  2172. - progress_jarmaker_make(jm, joinpath(fedir, 'ff', 'jar.mn'), joinpath(fedir, 'ff'))
  2173. - progress_preprocess(joinpath(localedir, 'jar.mn'), joinpath(localedir, 'jar.mn.pp'), {'AB_CD': 'en-US'})
  2174. - # Define a preprocessor var for the next call to makeJar
  2175. - jm.pp.context['AB_CD'] = 'en-US'
  2176. - progress_jarmaker_make(jm, joinpath(localedir, 'jar.mn.pp'), localedir, [joinpath(localedir, 'en-US')])
  2177. - progress_rm(joinpath(localedir, 'jar.mn.pp'))
  2178. - print ' done'
  2179. -
  2180. - progress_echo(' Constructing XPI package')
  2181. - progress_copy(joinpath(jarroot, 'chatzilla.jar'), joinpath(xpiroot, 'chrome'))
  2182. - progress_copy(joinpath(fedir, 'js', 'lib', 'chatzilla-service.js'), joinpath(xpiroot, 'components'))
  2183. - progress_move(joinpath(jarroot, '..', 'chrome.manifest'), joinpath(xpiroot, 'chrome.manifest'))
  2184. - progress_chmod(joinpath(xpiroot, 'chrome', 'chatzilla.jar'), 0664)
  2185. - progress_chmod(joinpath(xpiroot, 'components', 'chatzilla-service.js'), 0664)
  2186. - progress_zip(xpiroot, joinpath(pwd, xpiname))
  2187. - print ' done'
  2188. -
  2189. - print 'Build of ChatZilla %s... ALL DONE' % version
  2190. -
  2191. -
  2192. -def do_build_locale():
  2193. - print 'Beginning build of %s locale for ChatZilla %s...' % (locale, version)
  2194. - xpiname = check_xpiname('chatzilla-%s.%s.xpi' % (version, locale))
  2195. -
  2196. - progress_echo(' Checking XPI structure')
  2197. - progress_mkdir(xpiroot)
  2198. - progress_mkdir(joinpath(xpiroot, 'chrome'))
  2199. - print ' done'
  2200. -
  2201. - progress_echo(' Checking JAR structure')
  2202. - progress_mkdir(jarroot)
  2203. - print ' done'
  2204. -
  2205. - progress_echo(' Updating extension files')
  2206. - progress_preprocess([joinpath(localedir, locale, 'defines.inc'), joinpath(localedir, 'generic', 'install.rdf')], joinpath(xpiroot, 'install.rdf.pp'),
  2207. - {'IRC_STANDALONE_BUILD': '1', 'CHATZILLA_VERSION': version, 'CHATZILLA_BASE_VERSION': version, 'AB_CD': locale, 'INSTALL_EXTENSION_ID': 'langpack-%s@chatzilla.mozilla.org' % locale, 'MOZ_LANG_TITLE': locale, 'SEAMONKEY_MAXVERSION': smversion})
  2208. - progress_sed(joinpath(xpiroot, 'install.rdf.pp'), joinpath(xpiroot, 'install.rdf'), ('chatzilla.jar', 'chatzilla-%s.jar' % locale))
  2209. - progress_rm(joinpath(xpiroot, 'install.rdf.pp'))
  2210. - print ' done'
  2211. -
  2212. - progress_echo(' Constructing JAR package')
  2213. - jm = progress_jarmaker()
  2214. - progress_preprocess(joinpath(localedir, 'jar.mn'), joinpath(localedir, 'jar.mn.pp'), {'AB_CD': locale})
  2215. - jm.pp.context['AB_CD'] = locale
  2216. - progress_jarmaker_make(jm, joinpath(localedir, 'jar.mn.pp'), localedir, [joinpath(localedir, locale)])
  2217. - progress_rm(joinpath(localedir, 'jar.mn.pp'))
  2218. - progress_move(joinpath(jarroot, 'chatzilla.jar'), joinpath(jarroot, 'chatzilla-%s.jar' % locale))
  2219. - print ' done'
  2220. -
  2221. - progress_echo(' Constructing XPI package')
  2222. - progress_copy(joinpath(jarroot, 'chatzilla-%s.jar' % locale), joinpath(xpiroot, 'chrome'))
  2223. - progress_sed(joinpath(jarroot, '..', 'chrome.manifest'), joinpath(xpiroot, 'chrome.manifest'), ('chatzilla.jar', 'chatzilla-%s.jar' % locale))
  2224. - progress_rm(joinpath(jarroot, '..', 'chrome.manifest'))
  2225. - progress_chmod(joinpath(xpiroot, 'chrome', 'chatzilla-%s.jar' % locale), 0664)
  2226. - progress_zip(xpiroot, joinpath(pwd, xpiname))
  2227. - print ' done'
  2228. -
  2229. - print 'Build of %s locale for ChatZilla %s... ALL DONE' % (locale, version)
  2230. -
  2231. -
  2232. -if clean():
  2233. - do_clean()
  2234. -elif locale is None:
  2235. - do_build_base()
  2236. -else:
  2237. - do_build_locale()
  2238. diff --git a/suite/extensions/irc/xpi/resources/chatzilla-window.ico b/suite/extensions/irc/xpi/resources/chatzilla-window.ico
  2239. deleted file mode 100644
  2240. index c3beee23a57bf542b5bce221d999f68130265e7d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
  2241. GIT binary patch
  2242. literal 0
  2243. Hc$@<O00001
  2244. diff --git a/suite/extensions/irc/xpi/resources/chatzilla-window.xpm b/suite/extensions/irc/xpi/resources/chatzilla-window.xpm
  2245. deleted file mode 100644
  2246. --- a/suite/extensions/irc/xpi/resources/chatzilla-window.xpm
  2247. +++ /dev/null
  2248. @@ -1,102 +0,0 @@
  2249. -/* XPM */
  2250. -/* This Source Code Form is subject to the terms of the Mozilla Public
  2251. - * License, v. 2.0. If a copy of the MPL was not distributed with this
  2252. - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  2253. -
  2254. -static char *cz_logo_32[] = {
  2255. -/* columns rows colors chars-per-pixel */
  2256. -"32 32 60 1",
  2257. -" c #374552",
  2258. -". c #384653",
  2259. -"X c #3b4956",
  2260. -"o c #3e4b58",
  2261. -"O c #414e5b",
  2262. -"+ c #43505d",
  2263. -"@ c #4a5762",
  2264. -"# c #4d5965",
  2265. -"$ c #515d68",
  2266. -"% c #55616c",
  2267. -"& c #58646e",
  2268. -"* c #5a6671",
  2269. -"= c #5d6873",
  2270. -"- c #616c77",
  2271. -"; c #636e78",
  2272. -": c #66707a",
  2273. -"> c #6a747e",
  2274. -", c #6c7780",
  2275. -"< c #6e7881",
  2276. -"1 c #717b84",
  2277. -"2 c #767f88",
  2278. -"3 c #7a838c",
  2279. -"4 c #7e8790",
  2280. -"5 c #828b93",
  2281. -"6 c #8b939a",
  2282. -"7 c #90979f",
  2283. -"8 c #949ca3",
  2284. -"9 c #9ca3aa",
  2285. -"0 c #a0a7ad",
  2286. -"q c #a2a8ae",
  2287. -"w c #a5abb1",
  2288. -"e c #a9afb4",
  2289. -"r c #abb1b6",
  2290. -"t c #adb2b8",
  2291. -"y c #b0b5ba",
  2292. -"u c #b3b8bd",
  2293. -"i c #b7bcc1",
  2294. -"p c #b8bdc2",
  2295. -"a c #bbc0c4",
  2296. -"s c #bfc4c8",
  2297. -"d c #c2c6ca",
  2298. -"f c #c5c9cc",
  2299. -"g c #caced1",
  2300. -"h c #cdd1d4",
  2301. -"j c #d0d3d6",
  2302. -"k c #d4d7da",
  2303. -"l c #d6d9dc",
  2304. -"z c #d9dcde",
  2305. -"x c #dbdde0",
  2306. -"c c #dde0e2",
  2307. -"v c #e1e3e5",
  2308. -"b c #e5e7e9",
  2309. -"n c #e7e8ea",
  2310. -"m c #eaebed",
  2311. -"M c #eff0f1",
  2312. -"N c #f4f5f5",
  2313. -"B c #f6f7f8",
  2314. -"V c #f7f8f8",
  2315. -"C c #fefefe",
  2316. -"Z c None",
  2317. -/* pixels */
  2318. -"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
  2319. -"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
  2320. -"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
  2321. -"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
  2322. -"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
  2323. -"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
  2324. -"ZZZZZZZZZZZZZZZZZZVVNBNBNNNNNVCZ",
  2325. -"ZZZZZZZZZZZZZZZZMu<&&=**&==&==6v",
  2326. -"ZZZZZZZZZZZZZZZC8O155555555553O>",
  2327. -"ZZZZZZZZZZZZZZZc@9VCCCCCCCCCCC9o",
  2328. -"ZZZZVca856ygmZV6@cCCVcxxcVCCCC9#",
  2329. -"ZZCh<+o+&$Oo&ugO0CCN6OOO2MCCCg@3",
  2330. -"ZCt@$9gvNmlp3O%&mCC8X2$$kCCCv&$k",
  2331. -"ZpO5cCCCCCCCN3 9CCrO56+aCCCN3+fZ",
  2332. -"m=*mCCCCCCVnCv;5k0+6u+9CCCC8oeCZ",
  2333. -"eOfCCCCnfmCCCC9.++6f$3BCCCuO6VZZ",
  2334. -"1;NCCB8$ <xCBv;;yjv>;vCCCk$<NVCZ",
  2335. -"#6CCCdO4w&$4;$+pZV5#hCCCn>&hu<6v",
  2336. -"OyCCC5@bZk&. .6CCr+uCCCV5#y<O;O,",
  2337. -"#8CCC9OfVa+$5:+0d@6VCCC9O9>OrB6X",
  2338. -">,VCCc%@>#>xCN2+@1NCCCf+55OrCC6#",
  2339. -"8@zCCCv9&=hCCCpX&vCCCz%.#OrCCx#6",
  2340. -"c#1NCCCCmMCCCC9@fCCCCu555uCCC8#c",
  2341. -"CqowNCCCCCCCCg#9CCCCCCCCCCCCl#6C",
  2342. -"ZN6O,smNCCVbi$X<uuuuuuuuuuuu1#cZ",
  2343. -"ZZBr#o$=35;@O1t=OOOOOOOOOOOO#0CZ",
  2344. -"ZZZCbd63=&18hNZNxxxzxxxzxxzxbCZZ",
  2345. -"ZZZZZZZCNNCZZZZZZZZZZZZZZZZZZZZZ",
  2346. -"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
  2347. -"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
  2348. -"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ",
  2349. -"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
  2350. -};
  2351. diff --git a/suite/extensions/irc/xpi/resources/chatzilla-window16.xpm b/suite/extensions/irc/xpi/resources/chatzilla-window16.xpm
  2352. deleted file mode 100644
  2353. --- a/suite/extensions/irc/xpi/resources/chatzilla-window16.xpm
  2354. +++ /dev/null
  2355. @@ -1,84 +0,0 @@
  2356. -/* XPM */
  2357. -/* This Source Code Form is subject to the terms of the Mozilla Public
  2358. - * License, v. 2.0. If a copy of the MPL was not distributed with this
  2359. - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  2360. -
  2361. -static char *cz_logo_16[] = {
  2362. -/* columns rows colors chars-per-pixel */
  2363. -"16 16 58 1",
  2364. -" c #374552",
  2365. -". c #384653",
  2366. -"X c #3c4956",
  2367. -"o c #3d4b58",
  2368. -"O c #414e5b",
  2369. -"+ c #44515e",
  2370. -"@ c #475460",
  2371. -"# c #4a5762",
  2372. -"$ c #4c5965",
  2373. -"% c #54606b",
  2374. -"& c #59646f",
  2375. -"* c #5b6671",
  2376. -"= c #5d6873",
  2377. -"- c #626d77",
  2378. -"; c #636e78",
  2379. -": c #66717b",
  2380. -"> c #69747d",
  2381. -", c #6c7780",
  2382. -"< c #6e7881",
  2383. -"1 c #717b84",
  2384. -"2 c #757f88",
  2385. -"3 c #7a838c",
  2386. -"4 c #7f8890",
  2387. -"5 c #838c94",
  2388. -"6 c #8d959c",
  2389. -"7 c #90979f",
  2390. -"8 c #90989f",
  2391. -"9 c #949ca3",
  2392. -"0 c #9aa1a7",
  2393. -"q c #9ca3a9",
  2394. -"w c #a6acb2",
  2395. -"e c #a9afb4",
  2396. -"r c #abb1b6",
  2397. -"t c #adb2b8",
  2398. -"y c #b0b6bb",
  2399. -"u c #b3b8bd",
  2400. -"i c #b7bcc1",
  2401. -"p c #b8bdc2",
  2402. -"a c #bdc1c6",
  2403. -"s c #c3c7cb",
  2404. -"d c #c5c9cd",
  2405. -"f c #caced1",
  2406. -"g c #cdd0d4",
  2407. -"h c #d0d3d6",
  2408. -"j c #d3d6d9",
  2409. -"k c #d5d8da",
  2410. -"l c #d8dbdd",
  2411. -"z c #dbdde0",
  2412. -"x c #e1e3e5",
  2413. -"c c #e4e6e8",
  2414. -"v c #e6e8e9",
  2415. -"b c #eaeced",
  2416. -"n c #eff0f1",
  2417. -"m c #f3f4f5",
  2418. -"M c #f6f7f8",
  2419. -"N c #f7f8f8",
  2420. -"B c #fefefe",
  2421. -"V c None",
  2422. -/* pixels */
  2423. -"VVVVVVVVVVVVVVVV",
  2424. -"VVVVVVVVVVVVVVVV",
  2425. -"VVVVVVVVVNmmMmmB",
  2426. -"VVVVVVVmw;=*=*=8",
  2427. -"VVmfisx6#355553O",
  2428. -"Ba>o+o#+iBmzbBm:",
  2429. -"6@2tls9>mz>%jBeX",
  2430. -"O8BBnBMqw%XeBd+>",
  2431. -"+jBq-ij> .5Nx*.4",
  2432. -"&mb$ .O .>bm1.=O",
  2433. -"+lN0$5t:%lB6.1b1",
  2434. -"+6BBvNN5aBc66cg+",
  2435. -"8#2tgu6=tuuuuy:&",
  2436. -"Na>OoX$#OOOOOO+r",
  2437. -"VVmjugcvlzzzzzxN",
  2438. -"VVVVVVVVVVVVVVVV"
  2439. -};
  2440. diff --git a/suite/extensions/irc/xpi/resources/install.rdf b/suite/extensions/irc/xpi/resources/install.rdf
  2441. deleted file mode 100644
  2442. --- a/suite/extensions/irc/xpi/resources/install.rdf
  2443. +++ /dev/null
  2444. @@ -1,45 +0,0 @@
  2445. -<?xml version="1.0"?>
  2446. -<!-- This Source Code Form is subject to the terms of the Mozilla Public
  2447. - - License, v. 2.0. If a copy of the MPL was not distributed with this
  2448. - - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
  2449. -
  2450. -#filter substitution
  2451. -
  2452. -<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  2453. - xmlns:em="http://www.mozilla.org/2004/em-rdf#">
  2454. - <Description about="urn:mozilla:install-manifest">
  2455. - <!-- core data -->
  2456. - <em:id>{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}</em:id>
  2457. - <em:version>@CHATZILLA_VERSION@</em:version>
  2458. - <em:type>2</em:type>
  2459. -
  2460. - <!-- BEGIN COPY BETWEEN /xpi/resources/install.rdf AND /locales/generic/install.rdf -->
  2461. - <em:targetApplication>
  2462. - <Description>
  2463. - <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
  2464. - <em:minVersion>2.0</em:minVersion>
  2465. - <em:maxVersion>@SEAMONKEY_MAXVERSION@</em:maxVersion>
  2466. - </Description>
  2467. - </em:targetApplication>
  2468. - <!-- END COPY BETWEEN /xpi/resources/install.rdf AND /locales/generic/install.rdf -->
  2469. -
  2470. - <!-- front-end metadata -->
  2471. - <em:name>ChatZilla</em:name>
  2472. - <em:description>A clean, easy to use and highly extensible Internet Relay Chat (IRC) client.</em:description>
  2473. - <em:creator>The ChatZilla Team</em:creator>
  2474. - <em:contributor>Lim Chee Aun (graphics)</em:contributor>
  2475. - <em:contributor>Robert Ginda</em:contributor>
  2476. - <em:contributor>Gijs Kruitbosch</em:contributor>
  2477. - <em:contributor>James Ross</em:contributor>
  2478. - <em:contributor>Samuel Sieb</em:contributor>
  2479. - <em:iconURL>chrome://chatzilla/skin/images/logo.png</em:iconURL>
  2480. - <em:homepageURL>http://chatzilla.hacksrus.com/</em:homepageURL>
  2481. - <em:aboutURL>chrome://chatzilla/content/about/about.xul</em:aboutURL>
  2482. - <em:optionsURL>chrome://chatzilla/content/config.xul</em:optionsURL>
  2483. - <em:multiprocessCompatible>true</em:multiprocessCompatible>
  2484. -
  2485. - <!-- Force unpack the xpi, otherwise window icons do not work
  2486. - on Gecko 2.0 and higher. -->
  2487. - <em:unpack>true</em:unpack>
  2488. - </Description>
  2489. -</RDF>
  2490. diff --git a/suite/installer/package-manifest.in b/suite/installer/package-manifest.in
  2491. --- a/suite/installer/package-manifest.in
  2492. +++ b/suite/installer/package-manifest.in
  2493. @@ -670,20 +670,18 @@ man/*
  2494. #endif
  2495. #ifdef MOZ_CLANG_RT_ASAN_LIB
  2496. @BINPATH@/@MOZ_CLANG_RT_ASAN_LIB@
  2497. #endif
  2498. [chatzilla]
  2499. #ifdef MOZ_IRC
  2500. -@RESPATH@/extensions/{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi
  2501. -#ifdef LOCALE_BUILD
  2502. -@RESPATH@/extensions/langpack-@AB_CD@@chatzilla.mozilla.org.xpi
  2503. -#endif
  2504. +@RESPATH@/chrome/chatzilla@JAREXT@
  2505. +@RESPATH@/chrome/chatzilla.manifest
  2506. #endif
  2507. [debugqa]
  2508. #ifdef MOZ_PACKAGE_DEBUGQA
  2509. @RESPATH@/extensions/debugQA@mozilla.org.xpi
  2510. #endif
  2511. #ifdef MOZ_CALENDAR
  2512. diff --git a/suite/installer/windows/nsis/custom.nsi b/suite/installer/windows/nsis/custom.nsi
  2513. --- a/suite/installer/windows/nsis/custom.nsi
  2514. +++ b/suite/installer/windows/nsis/custom.nsi
  2515. @@ -1,16 +1,15 @@
  2516. # This Source Code Form is subject to the terms of the Mozilla Public
  2517. # License, v. 2.0. If a copy of the MPL was not distributed with this
  2518. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  2519. !macro checkSuiteComponents
  2520. ; If no extensions are available skip the components page
  2521. - ${Unless} ${FileExists} "$EXEDIR\optional\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi"
  2522. - ${AndUnless} ${FileExists} "$EXEDIR\optional\extensions\debugQA@mozilla.org.xpi"
  2523. + ${Unless} ${FileExists} "$EXEDIR\optional\extensions\debugQA@mozilla.org.xpi"
  2524. ${AndUnless} ${FileExists} "$EXEDIR\optional\extensions\{f13b157f-b174-47e7-a34d-4815ddfdfeb8}.xpi"
  2525. Abort
  2526. ${EndUnless}
  2527. !macroend
  2528. !macro createSuiteComponentsIni
  2529. WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Type "label"
  2530. WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Text "$(OPTIONAL_COMPONENTS_LABEL)"
  2531. @@ -22,39 +21,16 @@
  2532. StrCpy $R1 2
  2533. ; Top of checkbox
  2534. StrCpy $R2 15
  2535. ; Bottom of checkbox
  2536. StrCpy $R3 25
  2537. ; Seperation between titles/text
  2538. StrCpy $R4 25
  2539. - ${If} ${FileExists} "$EXEDIR\optional\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi"
  2540. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Type "checkbox"
  2541. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Text "$(CHATZILLA_TITLE)"
  2542. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Left "15"
  2543. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Right "-1"
  2544. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Top "$R2"
  2545. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Bottom "$R3"
  2546. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" State "1"
  2547. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Flags "GROUP"
  2548. - ${GetSize} "$EXEDIR\optional\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi" "/S=0K" $0 $8 $9
  2549. - ${If} ${FileExists} "$EXEDIR\optional\extensions\langpack-${AB_CD}@chatzilla.mozilla.org.xpi"
  2550. - ${GetSize} "$EXEDIR\optional\extensions\langpack-${AB_CD}@chatzilla.mozilla.org.xpi" "/S=0K" $1 $8 $9
  2551. - IntOp $0 $0 + $1
  2552. - ${EndIf}
  2553. - SectionSetSize ${CZ_IDX} $0
  2554. - IntOp $R1 $R1 + 1
  2555. - IntOp $R2 $R2 + $R4
  2556. - IntOp $R3 $R3 + $R4
  2557. - ${Else}
  2558. - ; Hide ChatZilla in the components page if it isn't available.
  2559. - SectionSetText ${CZ_IDX} ""
  2560. - ${EndIf}
  2561. -
  2562. ${If} ${FileExists} "$EXEDIR\optional\extensions\debugQA@mozilla.org.xpi"
  2563. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Type "checkbox"
  2564. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Text "$(DEBUGQA_TITLE)"
  2565. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Left "15"
  2566. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Right "-1"
  2567. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Top "$R2"
  2568. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Bottom "$R3"
  2569. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" State "1"
  2570. @@ -70,28 +46,16 @@
  2571. ${EndIf}
  2572. ; Set new values for the top and bottom of labels
  2573. ; Top of label box
  2574. StrCpy $R2 27
  2575. ; Bottom of label box
  2576. StrCpy $R3 47
  2577. - ${If} ${FileExists} "$EXEDIR\optional\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi"
  2578. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Type "label"
  2579. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Text "$(CHATZILLA_TEXT)"
  2580. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Left "30"
  2581. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Right "-1"
  2582. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Top "$R2"
  2583. - WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Bottom "$R3"
  2584. - IntOp $R1 $R1 + 1
  2585. - IntOp $R2 $R2 + $R4
  2586. - IntOp $R3 $R3 + $R4
  2587. - ${EndIf}
  2588. -
  2589. ${If} ${FileExists} "$EXEDIR\optional\extensions\debugQA@mozilla.org.xpi"
  2590. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Type "label"
  2591. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Text "$(DEBUGQA_TEXT)"
  2592. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Left "30"
  2593. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Right "-1"
  2594. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Top "$R2"
  2595. WriteINIStr "$PLUGINSDIR\components.ini" "Field $R1" Bottom "$R3"
  2596. IntOp $R1 $R1 + 1
  2597. diff --git a/suite/installer/windows/nsis/installer.nsi b/suite/installer/windows/nsis/installer.nsi
  2598. --- a/suite/installer/windows/nsis/installer.nsi
  2599. +++ b/suite/installer/windows/nsis/installer.nsi
  2600. @@ -196,32 +196,16 @@ Section "-InstallStartCleanup"
  2601. ; can rename the file and then delete is when the system is restarted.
  2602. Sleep 5000
  2603. ${DeleteFile} "$INSTDIR\${FileMainEXE}"
  2604. ClearErrors
  2605. ${EndIf}
  2606. ${If} $InstallType == ${INSTALLTYPE_CUSTOM}
  2607. ; Custom installs.
  2608. - ; If ChatZilla is installed and this install includes ChatZilla remove it
  2609. - ; from the installation directory. This will remove it if the user
  2610. - ; deselected ChatZilla on the components page.
  2611. - ${If} ${FileExists} "$EXEDIR\optional\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi"
  2612. - ${DeleteFile} "$INSTDIR\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi"
  2613. - ${If} ${FileExists} "$INSTDIR\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}"
  2614. - RmDir /r "$INSTDIR\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}"
  2615. - ${EndIf}
  2616. - ${EndIf}
  2617. - ${If} ${FileExists} "$EXEDIR\optional\extensions\langpack-${AB_CD}@chatzilla.mozilla.org.xpi"
  2618. - ${DeleteFile} "$INSTDIR\extensions\langpack-${AB_CD}@chatzilla.mozilla.org.xpi"
  2619. - ${If} ${FileExists} "$INSTDIR\extensions\langpack-${AB_CD}@chatzilla.mozilla.org"
  2620. - RmDir /r "$INSTDIR\extensions\langpack-${AB_CD}@chatzilla.mozilla.org"
  2621. - ${EndIf}
  2622. - ${EndIf}
  2623. -
  2624. ; If DebugQA is installed and this install includes DebugQA remove it
  2625. ; from the installation directory. This will remove it if the user
  2626. ; deselected DebugQA on the components page.
  2627. ${If} ${FileExists} "$EXEDIR\optional\extensions\debugQA@mozilla.org.xpi"
  2628. ${DeleteFile} "$INSTDIR\extensions\debugQA@mozilla.org.xpi"
  2629. ${If} ${FileExists} "$INSTDIR\extensions\debugQA@mozilla.org"
  2630. RmDir /r "$INSTDIR\extensions\debugQA@mozilla.org"
  2631. ${EndIf}
  2632. @@ -474,39 +458,16 @@ Section "-Application" APP_IDX
  2633. ApplicationID::Set "$DESKTOP\${BrandFullName}.lnk" "$AppUserModelID"
  2634. ${EndIf}
  2635. ${LogMsg} "Added Shortcut: $DESKTOP\${BrandFullName}.lnk"
  2636. ${EndIf}
  2637. !insertmacro MUI_STARTMENU_WRITE_END
  2638. SectionEnd
  2639. -Section /o "IRC Client" CZ_IDX
  2640. - ${If} ${FileExists} "$EXEDIR\optional\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi"
  2641. - SetDetailsPrint both
  2642. - DetailPrint $(STATUS_INSTALL_OPTIONAL)
  2643. - SetDetailsPrint none
  2644. -
  2645. - ${RemoveDir} "$INSTDIR\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}"
  2646. - ${RemoveDir} "$INSTDIR\extensions\langpack-${AB_CD}@chatzilla.mozilla.org"
  2647. - ${DeleteFile} "$INSTDIR\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi"
  2648. - ${DeleteFile} "$INSTDIR\extensions\langpack-${AB_CD}@chatzilla.mozilla.org.xpi"
  2649. - ${DeleteFile} "$INSTDIR\distribution\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi"
  2650. - ${DeleteFile} "$INSTDIR\distribution\extensions\langpack-${AB_CD}@chatzilla.mozilla.org.xpi"
  2651. - ClearErrors
  2652. - ${LogHeader} "Installing IRC Client"
  2653. - CopyFiles /SILENT "$EXEDIR\optional\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi" \
  2654. - "$INSTDIR\extensions\"
  2655. - ${If} ${FileExists} "$EXEDIR\optional\extensions\langpack-${AB_CD}@chatzilla.mozilla.org.xpi"
  2656. - CopyFiles /SILENT "$EXEDIR\optional\extensions\langpack-${AB_CD}@chatzilla.mozilla.org.xpi" \
  2657. - "$INSTDIR\extensions\"
  2658. - ${EndIf}
  2659. - ${EndIf}
  2660. -SectionEnd
  2661. -
  2662. Section /o "Debug and QA Tools" DEBUG_IDX
  2663. ${If} ${FileExists} "$EXEDIR\optional\extensions\debugQA@mozilla.org.xpi"
  2664. SetDetailsPrint both
  2665. DetailPrint $(STATUS_INSTALL_OPTIONAL)
  2666. SetDetailsPrint none
  2667. ${RemoveDir} "$INSTDIR\extensions\debugQA@mozilla.org"
  2668. ${DeleteFile} "$INSTDIR\extensions\debugQA@mozilla.org.xpi"
  2669. @@ -672,30 +633,19 @@ FunctionEnd
  2670. Function preComponents
  2671. ${CheckCustomCommon}
  2672. !insertmacro checkSuiteComponents
  2673. !insertmacro MUI_HEADER_TEXT "$(OPTIONAL_COMPONENTS_TITLE)" "$(OPTIONAL_COMPONENTS_SUBTITLE)"
  2674. !insertmacro MUI_INSTALLOPTIONS_DISPLAY "components.ini"
  2675. FunctionEnd
  2676. Function leaveComponents
  2677. - ; If ChatZilla exists then it will be Field 2.
  2678. - ; If ChatZilla doesn't exist then debugQA will be Field 2).
  2679. + ; If debugQA exists then it will be Field 2.
  2680. StrCpy $R1 2
  2681. - ${If} ${FileExists} "$EXEDIR\optional\extensions\{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi"
  2682. - ${MUI_INSTALLOPTIONS_READ} $R0 "components.ini" "Field $R1" "State"
  2683. - ; State will be 1 for checked and 0 for unchecked so we can use that to set
  2684. - ; the section flags for installation.
  2685. - SectionSetFlags ${CZ_IDX} $R0
  2686. - IntOp $R1 $R1 + 1
  2687. - ${Else}
  2688. - SectionSetFlags ${CZ_IDX} 0 ; Disable install for chatzilla
  2689. - ${EndIf}
  2690. -
  2691. ${If} ${FileExists} "$EXEDIR\optional\extensions\debugQA@mozilla.org.xpi"
  2692. ${MUI_INSTALLOPTIONS_READ} $R0 "components.ini" "Field $R1" "State"
  2693. ; State will be 1 for checked and 0 for unchecked so we can use that to set
  2694. ; the section flags for installation.
  2695. SectionSetFlags ${DEBUG_IDX} $R0
  2696. IntOp $R1 $R1 + 1
  2697. ${Else}
  2698. SectionSetFlags ${DEBUG_IDX} 0 ; Disable install for debugQA
  2699. @@ -823,20 +773,16 @@ Function preSummary
  2700. GetDlgItem $0 $HWNDPARENT 1
  2701. System::Call "user32::SetFocus(i r0, i 0x0007, i,i)i"
  2702. ${MUI_INSTALLOPTIONS_READ} $1 "summary.ini" "Field 2" "HWND"
  2703. SendMessage $1 ${WM_SETTEXT} 0 "STR:$INSTDIR"
  2704. !insertmacro MUI_INSTALLOPTIONS_SHOW
  2705. FunctionEnd
  2706. Function leaveSummary
  2707. - ${If} $InstallType != ${INSTALLTYPE_CUSTOM}
  2708. - ; Set ChatZilla to be installed
  2709. - SectionSetFlags ${CZ_IDX} 1
  2710. - ${EndIf}
  2711. ; Try to delete the app executable and if we can't delete it try to find the
  2712. ; app's message window and prompt the user to close the app. This allows
  2713. ; running an instance that is located in another directory. If for whatever
  2714. ; reason there is no message window we will just rename the app's files and
  2715. ; then remove them on restart.
  2716. ClearErrors
  2717. ${DeleteFile} "$INSTDIR\${FileMainEXE}"
  2718. ${If} ${Errors}
  2719. diff --git a/suite/locales/Makefile.in b/suite/locales/Makefile.in
  2720. --- a/suite/locales/Makefile.in
  2721. +++ b/suite/locales/Makefile.in
  2722. @@ -108,64 +108,52 @@ PANELS_XTRA_FILE = $(call MERGE_FILE,pro
  2723. profile/panels.rdf.in -o $@)
  2724. libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.html ;
  2725. libs:: $(FINAL_TARGET)/defaults/profile/panels.rdf ;
  2726. libs:: $(call MERGE_FILES,$(addprefix profile/chrome/,$(PROFILE_CHROME)))
  2727. $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile/chrome
  2728. -# Extend l10n.mk clobber-% target for our localised extensions
  2729. -ifdef MOZ_IRC
  2730. -clobber-extensions-%:
  2731. - $(RM) -rf $(DIST)/xpi-stage/chatzilla-$* $(DIST)/xpi-stage/chatzilla-*.$*.xpi
  2732. -endif
  2733. -
  2734. libs-%: AB_CD=$*
  2735. libs-%:
  2736. # merge if we're not en-US. Conditional function because
  2737. # we need the current value of AB_CD.
  2738. $(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
  2739. $(NSINSTALL) -D $(DIST)/install
  2740. @$(MAKE) -C $(DEPTH)/toolkit/locales libs-$*
  2741. # @$(MAKE) -C $(DEPTH)/services/sync/locales AB_CD=$* XPI_NAME=locale-$*
  2742. @$(MAKE) -C ../../calendar/locales AB_CD=$* XPI_NAME=locale-$*
  2743. ifdef MOZ_IRC
  2744. - @$(MAKE) -C ../extensions/irc/locales libs-$*
  2745. + @$(MAKE) -C ../extensions/irc/locales AB_CD=$* XPI_NAME=locale-$*
  2746. endif
  2747. ifdef MOZ_DEBUGQA
  2748. @$(MAKE) -C ../extensions/debugQA/locales AB_CD=$* XPI_NAME=locale-$*
  2749. endif
  2750. @$(MAKE) -C $(DEPTH)/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
  2751. @$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
  2752. @$(MAKE) -C $(DEPTH)/devtools/client/locales AB_CD=$* XPI_NAME=locale-$*
  2753. @$(MAKE) -C $(DEPTH)/devtools/shim/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
  2754. @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
  2755. @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
  2756. package-win32-installer: $(SUBMAKEFILES)
  2757. $(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen ZIP_IN='$(ZIP_OUT)' installer
  2758. repackage-extensions: $(STAGEDIST)
  2759. -ifdef MOZ_IRC
  2760. - $(MAKE) -C ../extensions/irc/locales repackage-zip-$(AB_CD) STAGEDIST=$(STAGEDIST)
  2761. -endif
  2762. $(MAKE) -C ../app pack-ext AB_CD=$(AB_CD) STAGEDIST=$(STAGEDIST)/extensions;
  2763. langpack: langpack-$(AB_CD)
  2764. # This is a generic target that will make a langpack, repack ZIP (+tarball)
  2765. # builds, and repack and installer if applicable. It is called from the
  2766. # tinderbox scripts. Alter it with caution.
  2767. installers-%: IS_LANGUAGE_REPACK=1
  2768. installers-%:
  2769. @$(MAKE) clobber-$*
  2770. -ifdef MOZ_IRC
  2771. - @$(MAKE) clobber-extensions-%*
  2772. -endif
  2773. @$(MAKE) libs-$*
  2774. @$(MAKE) package-langpack-$*
  2775. @$(MAKE) repackage-zip-$*
  2776. @$(MAKE) repackage-extensions AB_CD=$*
  2777. ifeq (WINNT,$(OS_ARCH))
  2778. @$(MAKE) package-win32-installer AB_CD=$*
  2779. endif
  2780. @echo 'repackaging done'
  2781. @@ -191,20 +179,16 @@ ident:
  2782. '$(STAGEDIST)/application.ini' App SourceStamp
  2783. @printf 'moz_revision '
  2784. @$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
  2785. '$(STAGEDIST)/platform.ini' Build SourceStamp
  2786. @printf 'buildid '
  2787. @$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
  2788. '$(STAGEDIST)/application.ini' App BuildID
  2789. -ifdef MOZ_IRC
  2790. -MOZ_PKG_EXTRAL10N += extensions/langpack-$(AB_CD)@chatzilla.mozilla.org=$(DIST)/xpi-stage/chatzilla-$(AB_CD)
  2791. -endif
  2792. -
  2793. distribution:
  2794. $(MAKE) -C $(DEPTH)/tools/update-packaging complete-patch PKG_INST_PATH=
  2795. $(foreach locale,$(SHIPPED_LOCALES),$(MAKE) -C $(DEPTH)/comm/suite/locales/ installers-$(locale) MOZ_MAKE_COMPLETE_MAR=1 ;)
  2796. SHIPPED_LOCALES_FILE = $(commtopsrcdir)/suite/locales/shipped-locales
  2797. ifeq ($(OS_ARCH), WINNT)
  2798. SHIPPED_FILTER = -e linux -e osx
  2799. else ifeq ($(OS_ARCH), Darwin)
  2800. diff --git a/suite/locales/en-US/installer/windows/custom.properties b/suite/locales/en-US/installer/windows/custom.properties
  2801. --- a/suite/locales/en-US/installer/windows/custom.properties
  2802. +++ b/suite/locales/en-US/installer/windows/custom.properties
  2803. @@ -19,18 +19,16 @@
  2804. # from en-US contains a \n.
  2805. REG_APP_DESC=$BrandShortName delivers safe, easy web browsing. A familiar user interface, enhanced security features including protection from online identity theft, and integrated search let you get the most out of the web.
  2806. OPTIONAL_COMPONENTS_TITLE=Choose Optional Components
  2807. OPTIONAL_COMPONENTS_SUBTITLE=Choose which features of $BrandFullNameDA you want to install.
  2808. OPTIONAL_COMPONENTS_LABEL=Optional Components:
  2809. DEBUGQA_TITLE=Debug and QA UI
  2810. DEBUGQA_TEXT=Provides additional debug and QA UI for $BrandShortName development.
  2811. -CHATZILLA_TITLE=ChatZilla
  2812. -CHATZILLA_TEXT=A clean, easy to use and highly extensible IRC client.
  2813. CONTEXT_OPTIONS=$BrandShortName &Options
  2814. CONTEXT_SAFE_MODE=$BrandShortName &Safe Mode
  2815. SAFE_MODE=Safe Mode
  2816. # MAILNEWS_TEXT appears in Windows (All) Programs menu as "SeaMonkey $(MAILNEWS_TEXT)"
  2817. MAILNEWS_TEXT=Mail
  2818. PROFILE_TEXT=Profile Manager
  2819. OPTIONS_PAGE_TITLE=Setup Type
  2820. OPTIONS_PAGE_SUBTITLE=Choose setup options
  2821. diff --git a/suite/locales/l10n.ini b/suite/locales/l10n.ini
  2822. --- a/suite/locales/l10n.ini
  2823. +++ b/suite/locales/l10n.ini
  2824. @@ -6,14 +6,15 @@
  2825. depth = ../..
  2826. all = suite/locales/all-locales
  2827. [compare]
  2828. dirs = suite
  2829. suite/branding/seamonkey
  2830. [includes]
  2831. +chatzilla = suite/extensions/irc/locales/l10n.ini
  2832. # include toolkit and services/sync from mozilla.
  2833. # Don't specify which, use l10n-central.ini and friends if you're
  2834. # not working on a local check-out
  2835. toolkit = mozilla/toolkit/locales/l10n.ini
  2836. services_sync = mozilla/services/sync/locales/l10n.ini
  2837. devtools_client = mozilla/devtools/client/locales/l10n.ini
  2838. diff --git a/suite/locales/l10n.toml b/suite/locales/l10n.toml
  2839. --- a/suite/locales/l10n.toml
  2840. +++ b/suite/locales/l10n.toml
  2841. @@ -42,16 +42,19 @@ locales = [
  2842. reference = "suite/branding/seamonkey/locales/en-US/**"
  2843. l10n = "{l}suite/branding/seamonkey/**"
  2844. [[paths]]
  2845. reference = "{mozilla}/services/sync/locales/en-US/**"
  2846. l10n = "{l}services/sync/**"
  2847. [[includes]]
  2848. + path = "suite/extensions/irc/locales/l10n.toml"
  2849. +
  2850. +[[includes]]
  2851. path = "{mozilla}/toolkit/locales/l10n.toml"
  2852. [[includes]]
  2853. path = "calendar/locales/l10n.toml"
  2854. [[includes]]
  2855. path = "{mozilla}/devtools/client/locales/l10n.toml"