[Galaxy S 5 Q&A, Help & Troubleshooting] MR. Wiz:
Script errors with CM ROMs,

This is my first post here. I'm pretty green but fast learning. I've rooted and messed with a few diff phones.

Currently have a sm-g860p (GS5 sport klte Sprint) and I rooted it through chainfire.

Then I flashed a custom CWM since the one in play store doesn't support the phone it it was all I could find. The twrp that came with chainfire root didn't work properly or maybe it was me. Anyways the custom CWM works good and it is what I am used too. This is the CWM I used http://xdaforums.com/sprint-galaxy-s5/development/recovery-cwm-s5-sport-sm-g680p-t2907945

I have been trying to flash the Cyanogenmod ROMs with no luck. It seems that the scripts are not written/coded correctly. First issue was status 7, I fixed it in two different ways. (tried multiple CM ROMs including one of this one modded by someone on here, link) First way I removed the first line of code up to first ; , second way was to add "kltespr,klte" right after "this device is".

Then I get status 6 error. I fixed a couple of those and got stumped at one I don't know how to fix. FYI all the CM ROMs I have tried are giving the exact same script errors.

Here is the code and I will bold letter the code section that has the synapse error. The show log gives the error saying>Line 1 col 63 synapse error unexpected BAD< Which is right at "ifelse". I'm no DEV nor have I ever written code nor have any formal education with code writing so I am not sure what the error is, any help is appreciated. Thanks in advance and sorry for the long post. Just trying to be informative.

("this device is klte") + getprop("ro.product.device") + ".");

ifelse(is_mounted("/system"), unmount("/system"));

package_extract_dir("install", "/tmp/install");

set_metadata_recursive("/tmp/install", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644);

set_metadata_recursive("/tmp/install/bin", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755);

mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");

run_program("/tmp/install/bin/backuptool.sh", "backup");

unmount("/system");

if is_mounted("/data") then

package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");

run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");

else

mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data", "");

package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");

run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");

unmount("/data");

endif);

show_progress(0.750000, 0);

ui_print("Patching system image unconditionally...");

block_image_update("/dev/block/platform/msm_sdcc.1/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");

show_progress(0.020000, 10);

mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");

run_program("/tmp/install/bin/backuptool.sh", "restore");

unmount("/system");

show_progress(0.050000, 5);

package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");

show_progress(0.200000, 10);