You are not logged in.
Hi all!
Due to my private need for Pacman supporting proxy, I have made a small Ruby script called Pacman2, which do just that. The script is for made solely for my own benefit, but it is general usefull for users who are behind a proxy. Pacman2 can quite easily, thanks to the design of Arch packages, be expanded to provide the full functionality of Pacman as we know it today.
If you are interested, take a look at: http://www.cs.auc.dk/~ks/pacman2.shtml
Cheers, Kristian Sørensen.
Offline
Hi, well, i think is a good idea, but i was thinking that the "pacman2" name, may confuse other people...
Also i came up with an easy name for it: Proxyman
wouldnt that be more suitable? or maybe, just ask nicely to apeiro giving that function to pacman, now that the only thing he would need to do, is check, copy and paste the code.
Leonardo Andrés Gallego
www.archlinux-es.org || Comunidad Hispana de Arch Linux
Offline
1.when I su to root and run the script,it says i must be root to run this script.
2.surprisingly,i have to remove the --passive-ftp option to get wget download
files correctly.
3.when i tried to install a package,i got:
[root@chenjf pacman2]# ./pacman2 -S gtkmm
searching for gtkmm
adding gtkmm--2.2.8-1 for download
resolving dependency, adding libsigc++2 for download
./pacman2:107:in `resolveDependencies': nested *?+ in regexp: /libsigc++2/ (RegexpError)
from ./pacman2:101:in `each'
from ./pacman2:101:in `resolveDependencies'
from ./pacman2:100:in `each'
from ./pacman2:100:in `resolveDependencies'
from ./pacman2:184
Offline
Hi Hughchen!
1.when I su to root and run the script,it says i must be root to run this script.
I guess that is a shell problem. The script reads the USER variable in your shell in order to determine your username... if somehow this variable is not avilable the script will exit. Which shell are you using and what does the commend "env" produce?
2.surprisingly,i have to remove the --passive-ftp option to get wget download files correctly.
This is most certainly a problem of your connection. Actually most times passive ftp will succeed when "normal" will not.
3.when i tried to install a package,i got:
[root@chenjf pacman2]# ./pacman2 -S gtkmm
searching for gtkmm
adding gtkmm--2.2.8-1 for download
resolving dependency, adding libsigc++2 for download
./pacman2:107:in `resolveDependencies': nested *?+ in regexp: /libsigc++2/ (RegexpError)
from ./pacman2:101:in `each'
from ./pacman2:101:in `resolveDependencies'
from ./pacman2:100:in `each'
from ./pacman2:100:in `resolveDependencies'
from ./pacman2:184
This sound mysterious. Are you using the newest version of Ruby?
Try inserting: puts "DEBUG: " + search
into line 105 (right after the IF). What does this produce?
Anyone else got this problem?
Cheers, KS.
Offline
Hi, well, i think is a good idea, but i was thinking that the "pacman2" name, may confuse other people...
Also i came up with an easy name for it: Proxyman
That might be a good idea Thanks for your input!
wouldnt that be more suitable? or maybe, just ask nicely to apeiro giving that function to pacman, now that the only thing he would need to do, is check, copy and paste the code.
Well the original pacman program is written in pure C, so copy paste code is not an option
I could not get an overview of the pacman code, and I needed the proxy support. It is overkill to implement such simple behaveour in C, so there fore the Ruby script
Cheers, KS.
Offline
That might be a good idea Thanks for your input!
You'r welcome!
Well the original pacman program is written in pure C, so copy paste code is not an option
I could not get an overview of the pacman code, and I needed the proxy support. It is overkill to implement such simple behaveour in C, so there fore the Ruby script
Ooops! didnt knew that! well then, guess your ¿modification? will be very usefull for everyone using a proxy. Including me in some time from now
Leonardo Andrés Gallego
www.archlinux-es.org || Comunidad Hispana de Arch Linux
Offline
To those using pacman2, please download the new release, which includes a fix for downloading from unofficial mirrors. This failed before due to a type error )
Offline
Hi Hughchen!
hughchen wrote:1.when I su to root and run the script,it says i must be root to run this script.
I guess that is a shell problem. The script reads the USER variable in your shell in order to determine your username... if somehow this variable is not avilable the script will exit. Which shell are you using and what does the commend "env" produce?
hughchen wrote:2.surprisingly,i have to remove the --passive-ftp option to get wget download files correctly.
This is most certainly a problem of your connection. Actually most times passive ftp will succeed when "normal" will not.
hughchen wrote:3.when i tried to install a package,i got:
[root@chenjf pacman2]# ./pacman2 -S gtkmm
searching for gtkmm
adding gtkmm--2.2.8-1 for download
resolving dependency, adding libsigc++2 for download
./pacman2:107:in `resolveDependencies': nested *?+ in regexp: /libsigc++2/ (RegexpError)
from ./pacman2:101:in `each'
from ./pacman2:101:in `resolveDependencies'
from ./pacman2:100:in `each'
from ./pacman2:100:in `resolveDependencies'
from ./pacman2:184This sound mysterious. Are you using the newest version of Ruby?
Try inserting: puts "DEBUG: " + search
into line 105 (right after the IF). What does this produce?Anyone else got this problem?
Cheers, KS.
I had some time to kill yesterday,so I went through the pacman2 script
and had the following findings:
1.I think "`whoami`" should be used to determine the username instead of
"`echo $USER`' since if a normal user switch to root by su,"`echo $USER`"
return the name of the original normal user instead of root.
2.The script currently can't handle some packages correctly whose names
contain special charaters like +,that is why I can't install gtkmm with
this script since the gtkmm pakcage depends on libsigc++2 package whose
name contains + and then I got a regular expression error message.I think
we should search the package name and add a "" prefix to the special
charaters if any.
3.Looking through the script,I found several line codes to remove the
leading hyphenation of a package version,but in fact,the leading "-"
of the package version still there and that lead to an annoysing "file
not found" problem when downloading the package.I think it must be the
problem of the following line:
version = pkgPath.at(1).reverse.chomp.reverse
but there's nothing I can help there since I'm not a Ruby programmer.
Hi,
1.I think "`whoami`" should be used to determine the username instead of
"`echo $USER`' since if a normal user switch to root by su,"`echo $USER`"
return the name of the original normal user instead of root.
That is right, I've corrected is now.
2.The script currently can't handle some packages correctly whose names
contain special charaters like +,that is why I can't install gtkmm with
this script since the gtkmm pakcage depends on libsigc++2 package whose
name contains + and then I got a regular expression error message.I think
we should search the package name and add a "" prefix to the special
charaters if any.
You're right. I have forgot to escape package names when using them as search string in a regular expression. That is also fixed now.
3.Looking through the script,I found several line codes to remove the
leading hyphenation of a package version,but in fact,the leading "-"
of the package version still there and that lead to an annoysing "file
not found" problem when downloading the package.I think it must be the
problem of the following line:
version = pkgPath.at(1).reverse.chomp.reverse
but there's nothing I can help there since I'm not a Ruby programmer.
That error was allready corrected in the version available for download The error was that I accidently used "chomp" in stead of "chop" in the above line. Chomp removes n, t and others from the end of the line. Chop just removes the last character, and this is needed to remove '-'.
Thanks a lot for your input!! An updated version is available on http://www.cs.auc.dk/~ks/pacman2.shtml
Cheers, ipqw.
Offline
Hi,
Thanks a lot for your input!! An updated version is available on http://www.cs.auc.dk/~ks/pacman2.shtml
Cheers, ipqw.
You're welcome,ipqw.You've really done a great job!And now I
am wondering if I can update an installed package with this
script.But when I try to update an installed package xxx with
this script.I got a "package xxx already installed" message and
the script exits.Does this script can only install new package or did I do someting wrong?
P.S. I forgot to login when I posted my last message.
Offline
Hi again )
You've really done a great job!And now I
am wondering if I can update an installed package with this
script.But when I try to update an installed package xxx with
this script.I got a "package xxx already installed" message and
the script exits.Does this script can only install new package or did I do someting wrong?
Thanks a lot!
At present, I have not made the implementation for automatic updates of allready installed packages. However you might download the packages, using pacman2, and when the script fails, then manually use the original pacman to install the packages like:
(cd /var/cache/pacman/pkg; pacman -U pkg_1 pkg_2 .. pkg_n)
I will post to this thread, if/when this feature is implemented. It is a rellatively simple expanding of the script, so if you - or anyone else would like to implement the feature, just send me a patch, and I'll update the homepage
Cheers, ipqw.
Offline