[Android Apps and Games] emph4tic:
Trouble executing AutoPatch script and/or Manually applying ptaches

First off thanks so much CollegeDev and the community surrounding PDroid2.0. This has been a really great project and ever since auto-patcher integration stopped for the later revisions, I've been trying to learn how to compile ROMs from source and apply the patches. I'm a noob when it comes to linux and git, but I was able to successfully patch a ROM at one point with the 1.57 patches. Ever since then and with the new AutoPatch script, I can't seem to successfully get this compiling properly.

After running a initializing/running a repo sync for the ROM sources, and setting up the source build/envsetup.sh, I specified directories to point CWD and PDroid PATCHES as mentioned in the thread, but ran into these problems:

jk@jk-VirtualBox:~/android/patches$ /bin/bash ./AutoPatch
./AutoPatch: line 6: $'\r': command not found
./AutoPatch: line 10: $'\r': command not found
./AutoPatch: line 11: $'\r': command not found
/build: No such file or directoryk/cm10.1
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
/libcore: No such file or directorycm10.1
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
/frameworks/base: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
/frameworks/opt/telephony: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
/packages/apps/Mms: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
: No such file or directoryhome/jk/cm10.1
' is not a valid name
./AutoPatch: line 21: $'\r': command not found
./AutoPatch: line 22: $'\r': command not found
/build: No such file or directoryk/cm10.1
fatal: Not a git repository (or any of the parent directories): .git
./AutoPatch: line 25: $'\r': command not found
/libcore: No such file or directorycm10.1
fatal: Not a git repository (or any of the parent directories): .git
./AutoPatch: line 26: $'\r': command not found
/packages/apps/Mms: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git
./AutoPatch: line 27: $'\r': command not found
/frameworks/base: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git
./AutoPatch: line 28: $'\r': command not found
/frameworks/opt/telephony: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git
./AutoPatch: line 29: $'\r': command not found
: No such file or directoryhome/jk/cm10.1
/CM10.1_build.patch: No such file or directory/
: No such file or directory/jk/android/patches/
: No such file or directory/jk/android/patches/
: No such file or directory/jk/android/patches/
/CM10.1_PDAgent.patch: No such file or directory

I wasn't sure how to properly use the git commands to link the PDroid2.0 github repo and execute the necessary calls in the script.

I downloaded the zip from github manually, but is there a step that I missed in trying to use the AutoPatch script correctly?

Alternatively, I tried to apply the patches manually as I was able to a month ago by running the "patch -p1 < <patch-location/xx.patch> in all relevant directories (system/build, system/frameworks, system/packages/apps/Mms, system/libcore, and the system build directories). Unfortunately, the patches don't seem to locate the folder paths. So I manually enter in the path for each file manually.

can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -rupN '--exclude=.svn' '--exclude=.git*' '--exclude=*.java~' '--exclude=*.mk~' '--exclude=*.orig~' '--exclude=*.txt' '--exclude=*.orig' '--exclude=*.rej' '--exclude=*.latest' '--exclude=*.txt~' '--exclude=*.xml~' '--exclude=*xml.orig~' '--exclude=*.xml.orig' '--exclude=*.patch~' '--exclude=*.patch' '--exclude=*.diff~' '--exclude=*.diff~' '--exclude=*.aidl~' '--exclude=*.xml~' '--exclude=*.latest' '--exclude=*.latest~' '--exclude=*~' /media/ROM-Speicher/CM10.1/build/core/pathmap.mk pang/build/core/pathmap.mk
|--- /media/ROM-Speicher/CM10.1/build/core/pathmap.mk	2013-04-02 21:33:47.704221108 +0545
|+++ pang/build/core/pathmap.mk	2013-05-03 21:49:34.303696789 +0545
--------------------------
File to patch: /home/jk/android/system/build/core/pathmap.mk

Despite even manually running through the patches one by one, during the build process it stops with this error message:

Install: /home/jk/android/system/out/host/linux-x86/bin/aidl
make: *** No rule to make target 'frameworks/base/privacy/java/android/privacy/PrivacycSettings.aidl', needed by '/home/jk/android/system/out/target/common/obj/framework.aidl'. Stop.

I was able to locate these aidl files searching, but it seems like they were in a different folder level ("android/system/frameworks/frameworks/base/privacy/java/android/privacy/PrivacySettings.aidl").

I've started from a clean sync several times and am little bit lost in what I've read here to figure out what exactly I'm doing wrong.

Any ideas on what I could be missing here?

Thanks again and appreciate your guys' help.