Difference between revisions of "User:Colin"
From AMule Project FAQ
m |
(+ script) |
||
Line 1: | Line 1: | ||
Satisfied amule customer since sept. 2004. | Satisfied amule customer since sept. 2004. | ||
---- | ---- | ||
− | + | I am also known as '''ezeltje''' in the forum (''ezel'' means "mule" in touch, in case anyone is wondering). | |
− | + | ||
+ | So far, I have created the [[Events]] pages with the example script. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | Here is a simple script to remove the obligatory command-line parameter you need to use to run aMule CVS: | ||
+ | |||
+ | <pre> | ||
+ | /*bin/true;exec rexx "$0" "$@";exit # REXX */ | ||
+ | |||
+ | FileIn = "src/amule.cpp" | ||
+ | FileOut = "colin.tmp" | ||
+ | Found = 0 | ||
+ | |||
+ | do while lines(FileIn) > 0 | ||
+ | OneLine = lineIn(FileIn) | ||
+ | if pos("!cmdline.Found",OneLine) > 1 & Found <> 1 then | ||
+ | do | ||
+ | call LineOut FileOut, "// ------ Commented out by amuleCVSfx ------ " | ||
+ | call LineOut FileOut, "//" OneLine | ||
+ | do i = 0 to 4 | ||
+ | OneLine = lineIn(FileIn) | ||
+ | call LineOut FileOut, "//" OneLine | ||
+ | i = i + 1 | ||
+ | end | ||
+ | Found = 1 | ||
+ | end | ||
+ | else | ||
+ | call LineOut FileOut, OneLine | ||
+ | end | ||
+ | if Found = 1 then | ||
+ | do | ||
+ | "mv -f" FileIn FileIn || '~' "2>&1" | ||
+ | "mv -f" FileOut FileIn "2>&1" | ||
+ | say "Fixed!" | ||
+ | end | ||
+ | else | ||
+ | do | ||
+ | say "Not found" | ||
+ | "rm -f" FileOut | ||
+ | end | ||
+ | return | ||
+ | </pre> | ||
+ | |||
+ | You need to run it in the '''../amule-cvs''' directory. | ||
+ | |||
+ | It is written in Rexx, so you will need to have a Rexx interpreter on your system. To install Rexx in Fedora, type '''yum install oorexx'''. | ||
+ | For Ubuntu, type '''apt-get install rexx-regina'''. Other distros probably have Rexx in their repositories under one name or another. | ||
+ | |||
+ | I originally wrote it as a shell script, but file I/O works much better in Rexx, which is designed for this kind of thing. |
Revision as of 02:28, 17 December 2006
Satisfied amule customer since sept. 2004.
I am also known as ezeltje in the forum (ezel means "mule" in touch, in case anyone is wondering).
So far, I have created the Events pages with the example script.
Here is a simple script to remove the obligatory command-line parameter you need to use to run aMule CVS:
/*bin/true;exec rexx "$0" "$@";exit # REXX */ FileIn = "src/amule.cpp" FileOut = "colin.tmp" Found = 0 do while lines(FileIn) > 0 OneLine = lineIn(FileIn) if pos("!cmdline.Found",OneLine) > 1 & Found <> 1 then do call LineOut FileOut, "// ------ Commented out by amuleCVSfx ------ " call LineOut FileOut, "//" OneLine do i = 0 to 4 OneLine = lineIn(FileIn) call LineOut FileOut, "//" OneLine i = i + 1 end Found = 1 end else call LineOut FileOut, OneLine end if Found = 1 then do "mv -f" FileIn FileIn || '~' "2>&1" "mv -f" FileOut FileIn "2>&1" say "Fixed!" end else do say "Not found" "rm -f" FileOut end return
You need to run it in the ../amule-cvs directory.
It is written in Rexx, so you will need to have a Rexx interpreter on your system. To install Rexx in Fedora, type yum install oorexx. For Ubuntu, type apt-get install rexx-regina. Other distros probably have Rexx in their repositories under one name or another.
I originally wrote it as a shell script, but file I/O works much better in Rexx, which is designed for this kind of thing.