View Single Post
  #6   (View Single Post)  
Old 24th September 2008
DNAeon DNAeon is offline
Shell Scout
 
Join Date: Sep 2008
Location: Bulgaria
Posts: 138
Default

Quote:
Originally Posted by anomie
I like the idea. One question: I see that when searching a local path it matches a pattern. Does it also try to match a pattern for a remote ftp server?
No.
If you look at the code you'll see that it first tries to find every single match of the given pattern in the given path and make a list of them, so you can choose which one for example to install. This way if don't even know the real name of the package you will still have the chance to choose from a list of available options. If no match is found there then it tries to fetch it and install it from a remote FTP server (just using pkg_add -r pattern for this one)

For example if you run:
Code:
smart_add /cdrom/packages/ blablabla
And there is no found pattern it will run pkg_add this way assuming that the package is not in /cdrom/packages/ but it's a real name of package which will be installed from the ftp server:
Code:
pkg_add -r blablabla
This of course will not work if the package is not in the ftp server, but I think that your idea about searching a pattern on an ftp server is very good. Thanks for that idea! I'll give it a shot with this one - try to add a feature that searches an ftp server for a given pattern and include it in the program. I think that libcurl would do the job.

Quote:
Originally Posted by vermaden
Very nice mate, add a post to lists.freebsd.org also, maybe you will start new base system utility.
Thanks vermaden, maybe I'll will, but first I think that I have to include some extra features in it (like the one anomie and ephemera suggested) so it will be really useful (if of course someone finds it useful anyway) and that's why I posted here first, so I can gather up some ideas in my mind which to include in the code later

Quote:
Originally Posted by Weaseal
You can sort of already do this with pkg_replace, which is in ports:
Code:
export PKGREPO=/usr/mypackages
export PACKAGEROOT=""
pkg_replace -P $PKGREPO/file.tgz
Granted your way seems to tie this together a lot easier, and this won't search online after it's done there anyway.
I'm sorry, I didn't understand you. I know nothing about pkg_replace, but from what I've learned about it it is a tool for upgrading packages - just like portupgrade is. The program I wrote is not trying to upgrade any existing package, but installs it instead.
Of course you can easily change the behaviour of the program if you just change the CMD* macros In fact now I've got another idea on how to improve it - I'll add a command-line options for the various pkg_* commands - pkg_add, pkg_delete, pkg_info, etc.. and upon that option the specified action will be taken onto the chosen package.

Wow, that is long post I've written, hope I didn't bored you from reading

Thanks everyone!
Reply With Quote