Difference between revisions of "User:Colin"

From AMule Project FAQ
Jump to: navigation, search
m (fxs)
(+ hirnriss.net)
 
(14 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Satisfied amule customer since sept. 2004.
+
Satisfied amule user since September 2004.
 
----
 
----
 
I am also known as '''ezeltje''' in the forum (''ezel'' means "mule" in Dutch, in case anyone is wondering).
 
I am also known as '''ezeltje''' in the forum (''ezel'' means "mule" in Dutch, in case anyone is wondering).
  
So far, I have created the [[Events]] pages with the example script.
+
Things I have done there:
  
----
+
* created the [[Events]] pages with the example script
 +
* reorganized [[AMuleWeb]] and rewrote the intro
 +
* expanded [[AMuleCMD]]
 +
* complained about the CVS flag, just to find out Kry can be a sarcastic condescending son of a bitch.
  
Here is a simple script to remove the obligatory command-line parameter you need to use to run aMule CVS:
+
and other smaller fixes elsewhere...
  
<pre>
+
---
/*bin/true;exec rexx "$0" "$@";exit # REXX */
+
  
/* --------- amuleCVSfx --------- */
+
I keep forgetting where this is: [http://www.hirnriss.net/?area=cvs daily CVS snapshot]
  
/* run this script in ../amule-cvs */
+
---
  
FileIn  = "src/amule.cpp"
+
== amuleCVSfx ==
FileOut = "colin.tmp"
+
Found  = 0
+
  
do while lines(FileIn) > 0
+
Here is a simple script to remove the obligatory command-line parameter you need to use to run aMule CV. Run it in the ../amule-cvs directory. It will make a backup of the original file.
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 before issuing the "make" command.
+
<pre>
 +
#!/bin/bash
 +
FileIn=src/amule.cpp
 +
FileOut=_^$$.tmp
 +
[ -e $FileOut ] && rm -f $FileOut
 +
awk < "$FileIn" > "$FileOut" '
 +
Found < 1 && /.!cmdline\.Found/ {
 +
        n = 6
 +
print "//      ------ Commented out by amuleCVSfx ------"
 +
Found = 1
 +
  }
 +
n > 0 {
 +
        $0 = "// " $0
 +
        n--
 +
        }
 +
{print}'
 +
mv -f $FileIn $FileIn~  2>&1
 +
mv -f $FileOut $FileIn  2>&1
 +
# end
  
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'''.
+
</pre>
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.
+
 
 +
You can view the changes using diff:
 +
<pre>
 +
$ diff --side-by-side --suppress-common-lines src/amule.cpp src/amule.cpp~
 +
</pre>

Latest revision as of 00:43, 8 March 2008

Satisfied amule user since September 2004.


I am also known as ezeltje in the forum (ezel means "mule" in Dutch, in case anyone is wondering).

Things I have done there:

  • created the Events pages with the example script
  • reorganized AMuleWeb and rewrote the intro
  • expanded AMuleCMD
  • complained about the CVS flag, just to find out Kry can be a sarcastic condescending son of a bitch.

and other smaller fixes elsewhere...

---

I keep forgetting where this is: daily CVS snapshot

---

amuleCVSfx

Here is a simple script to remove the obligatory command-line parameter you need to use to run aMule CV. Run it in the ../amule-cvs directory. It will make a backup of the original file.

#!/bin/bash
FileIn=src/amule.cpp
FileOut=_^$$.tmp
[ -e $FileOut ] && rm -f $FileOut
awk < "$FileIn" > "$FileOut" '	
	Found < 1 && /.!cmdline\.Found/ {
        n = 6
	print "//      ------ Commented out by amuleCVSfx ------"
	Found = 1
  	}
	n > 0 {
        $0 = "// " $0
        n--	
        }
{print}'
mv -f $FileIn $FileIn~  2>&1
mv -f $FileOut $FileIn  2>&1
# end


You can view the changes using diff:

$ diff --side-by-side --suppress-common-lines src/amule.cpp src/amule.cpp~