Skip to content

Instantly share code, notes, and snippets.

@shebin512
Last active January 29, 2016 13:31
Show Gist options
  • Save shebin512/18b0c1cf032680aec408 to your computer and use it in GitHub Desktop.
Save shebin512/18b0c1cf032680aec408 to your computer and use it in GitHub Desktop.
Bash Scripts used in Magento Patch works.

WELCOME :trollface:

CE Patch

grep -i -e"diff --git" PATCH_SUPEE-*|awk '{print $3}'|while read line;do meld /var/www/html/magento1911/$line /var/www/html/puma/$line  ;done

tar -zcvf  evoke_live.tgz htdocs/ --exclude=media --exclude=var --exclude="*.tgz" --exclude="*.gz" --exclude="*.tar" --exclude=blog --exclude=media_bck --exclude=.svn --exclude=blog_old --exclude=media_orig


grep -i -e"diff --git" PATCH_SUPEE-*|awk '{print $3}'|while read line;do meld /var/www/html/magento1911/$line /var/www/html/puma/$line  ;done

grep -i -e"diff --git" PATCH_SUPEE-*|awk '{print $3}'

grep -e"-e " app/etc/applied.patches.list|awk '{print $6}'

In Branch folder:

$ svn merge -c 1638,1639  https://svn.embdev.in/SVN/ace_turtle/trunk .

Compare patch files

grep -i -e"diff --git" PATCH_SUPEE-*|awk '{print "./"$3}'

cat /tmp/file_list.txt | xargs tar czvf /tmp/Puma_v1_prod_unpatchedfiles`date +%d%b%Y`.tgz

cat ~/Desktop/file_list.txt | xargs tar czvf /tmp/Puma_v1_prod_unpatchedfiles`date +%d%b%Y`.tgz

backup:

mkdir -p ~/puma_v1_unpatched_`date +%d%b%Y`
cd /var/www/in.puma.com/public_html/v1/
cat /tmp/file_list.txt |while read line;do cp  -v $line ~/puma_v1_unpatched_`date +%d%b%Y` --parents;done

Release:

From Local machine:

cat /tmp/file_list.txt|xargs tar zcf puma_v1_patch.tgz
cd /var/www/in.puma.com/public_html/v1/
tar zxf puma_v1_patch.tgz

Revert:

for fpath in $(cat /tmp/file_list.txt); do if [ -f ~/puma_v1_unpatched_`date +%d%b%Y`/$fpath ]; then cp -pv --remove-destination ~/puma_v1_unpatched_`date +%d%b%Y`/$fpath /var/www/in.puma.com/public_html/v1/$fpath; else rm -fv /var/www/in.puma.com/public_html/v1/$fpath; fi; done

~~ ~~

EE Patch Check

grep -i -e"diff --git" PATCH_SUPEE-*|awk '{print $3}'|while read line;do meld /var/www/html/magentoee1.13.0.2/$line /var/www/flyingmachine/htdocs/$line  ;done

Backup of puma Command

mkdir -p ~/puma_v1_unpatchedACL_`date +%d%b%Y`
cd /var/www/in.puma.com/public_html/v1/
cat /tmp/file_list.`date +%F`.txt |while read line;do cp  -v $line ~/puma_v1_unpatchedACL_`date +%d%b%Y` --parents;done

FM_KK Enterprise edition Patch.

grep -i -e"diff --git" PATCH_SUPEE-{6237,6285,6482}*|awk '{print $3}'> /tmp/patch_files.txt
cat /tmp/patch_files.txt|while read line;do meld /tmp/FM_KK_PATCH/$line /tmp/FM_KK_live/$line;done
cat /tmp/patch_files.txt|xargs tar zcf /tmp/FM_KK_patch_EE.tgz

diff -bBrq FM_KK_PATCH/app/code/local/ FM_KK_live/app/code/local |grep "differ"
diff -bBrq FM_KK_PATCH/app/code/fm FM_KK_live/app/code/fm |grep "differ"
diff -bBrq FM_KK_PATCH/app/code/community FM_KK_live/app/code/community |grep "differ"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment