Browse Source

script to create patches for bug xul2xhtml.sh

Bill Gianopoulos 4 years ago
parent
commit
6c0b345e63
1 changed files with 42 additions and 0 deletions
  1. 42 0
      scripts/xul2xhtml.sh

+ 42 - 0
scripts/xul2xhtml.sh

@@ -0,0 +1,42 @@
+#!/bin/bash
+GIT_REPO=https://gitlab.com/frg/seamonkey-central-patches.git
+rm -rf /tmp/comm-xul$$ /tmp/git-xul$$
+pushd /tmp
+hg clone https://hg.mozilla.org/comm-central/ /tmp/comm-xul$$
+if [ '$GIT_REPO' != '' ]
+then
+  mkdir /tmp/git-xul$$
+  cd /tmp/git-xul$$
+  git clone $GIT_REPO
+  cd /tmp/comm-xul$$
+  if [ -s /tmp/git-xul$$/seamonkey-central-patches/comm-central/patches/series ]
+  then
+    for i in `cat /tmp/git-xul$$/seamonkey-central-patches/comm-central/patches/series`
+    do
+       grep 1611647 /tmp/git-xul$$/seamonkey-central-patches/comm-central/patches/$i && break
+       hg import /tmp/git-xul$$/seamonkey-central-patches/comm-central/patches/$i
+    done
+  fi
+fi
+cd /tmp/comm-xul$$
+find suite -name '*.xul' -print > /tmp/filelist$$
+for i in `sed -e 's@\.xul$@@' /tmp/filelist$$`
+do
+  hg mv $i.xul $i.xhtml
+done
+hg commit -q -m "Bug 1611647 - Port bug 1579952 - Mass rename .xul files to .xhtml in suite."
+CHANGESET_1=`hg history -l 1 | grep changeset | sed -e 's@changeset:[ ]*@@'`
+find suite -type f -exec grep '\.xul\b' {} \; -a -print > /tmp/filelist$$
+for i in `grep '^suite' /tmp/filelist$$`
+do
+  sed -e 's@\.xul   @.xhtml @g' -e 's@\.xul\.   @.xhtml. @g' -e 's@\.xul\b@.xhtml@g' < $i > $i.$$
+  sed -e 's@there\.is\.only\.xhtml@there.is.only.xul@' < $i.$$ > $i
+  rm $i.$$
+done
+rm /tmp/filelist$$
+hg commit -q -m "Bug 1611647 - Port bug 1579952 - Fix references to xul files in suite."
+CHANGESET_2=`hg history -l 1 | grep changeset | sed -e 's@changeset:[ ]*@@'`
+popd
+hg export -R /tmp/comm-xul$$ $CHANGESET_1 > TOP-1611647-1-rename-xul-suite.patch
+hg export -R /tmp/comm-xul$$ $CHANGESET_2 > TOP-1611647-2-fix-xul-references-suite.patch
+rm -rf /tmp/comm-xul$$ /tmp/git-xul$$