![]() |
|
FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
Hello everyone!
First this is not a new pkg_add command, it's a pkg_add command which acts a little bit different ![]() Anyway, I wanted to share this with you too, since someone may find it useful. It is written in C (I know that I would do the same if I wrote a script for that, but I rarely write scripts though ![]() It's nothing much and perhaps it's a waste of time, but I like programming ![]() Any suggestions on how to improve it are welcome! ![]() Last edited by DNAeon; 5th October 2008 at 05:43 PM. Reason: Program name has changed! name is now `pkg_add_it` |
|
||||
![]()
Very nice mate, add a post to lists.freebsd.org also, maybe you will start new base system utility.
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
|||
![]() Quote:
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 Code:
pkg_add -r blablabla ![]() Quote:
![]() ![]() Quote:
Of course you can easily change the behaviour of the program if you just change the CMD* macros ![]() Wow, that is long post I've written, hope I didn't bored you from reading ![]() Thanks everyone! ![]() |
|
||||
![]() Quote:
You can sure start your port right now (under /usr/ports/ports-mgmt category), just post your source code on lists.freebsd.org ( really, they dont bite :] ) and talk to developers/contributors. You will get a lot more beta testers and feature requests at the same time. I can only wish you good luck for moving and polishing it to be ready for the base system ![]()
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
|||
![]()
OpenBSD has a environment variable PKG_PATH which you can set to a mix of local and remote directories.
Code:
PKG_PATH If a given package name cannot be found, the directories named by PKG_PATH are searched. It should contain a series of entries separated by colons. Each entry consists of a directory name, ending in a slash. URL schemes such as FTP, HTTP, HTTPS, or SCP are also appropriate. The current di- rectory may be indicated implicitly by an empty directory name, or explicitly by a single period (`./'). Code:
The value of the PKG_PATH is used if a given package cannot be found. The environment variable should be a series of entries separated by colons. Each entry consists of a directory name. The current directory may be indicated implicitly by an empty directory name, or explicitly by a single period. ![]() FreeBSD pkg_add also knows PACKAGESITE. From the FBSD man page Code:
The environment variable PACKAGESITE specifies an alternate location for pkg_add to fetch from. This variable subverts the automatic directory logic that pkg_add uses when the -r option is invoked. Thus it should be a complete URL to the remote package file(s).
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
![]()
@J65nko
Yes, I could use these environment variables to set up an alternate location for the packages and they would be used when pkg_add is invoked. The idea about the program is that you don't have to know the full name of the package (like in the screenshot above), so the program will search for a match of the given pattern and let you choose which package to install. Thus if you want to install some of the xorg-fonts-* package, first you'll have to find the package, take it's full name and then install it with pkg_add. For example if the package files are in /cdrom/packages/All/ perhaps you'll have to do something like this: Code:
# find /cdrom/packages/All/ -name "xorg-fonts*" -print --- some output here --- # pkg_add /cdrom/packages/All/xorg-fonts-cyrillic-7.3.tbz # just an example Code:
# smart_add /cdrom/packages/ xorg-font Anyway you could still set these env variables to point to some FTP site(s) since when no matching pattern is found the program invokes pkg_add -r pattern and then the FTP sites will be searched for the package. But as I mentioned in my first post - "this is not a new pkg_add command, it's a pkg_add command which acts a little bit different" - this way giving you the chance to search for a pattern and of course a little bit interactivity which I think pkg_add doesn't provide. Cheers ![]() <DNAeon> |
|
|||
![]()
Hi, again!
As vermaden suggested I sent an email to lists.freebsd.org (freebsd-ports@freebsd.org) about 24+ hours ago, but I didn't get a copy of my email to my mail account and the post isn't listed in the Archive section too. This is my first post sent the mailing lists at FreeBSD, is it normal that after 24+ hours the post is still not processed? |
|
||||
![]()
Sent emails to stable and current MLs.
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
|||
![]()
Thank you for your continuous support vermaden!
I've subscribed in the freebsd-stable and freebsd-current MLs too, and sent emails to these lists too ( freebsd-stable@freebsd.org and freebsd-current@freebsd.org ) and it's been about 4 hours since I sent those mail and I haven't still received a copy of my mails - so they are not already posted in the lists I think. I guess it takes some time till the sent emails get posted, or not? |
|
||||
![]()
No problem mate.
As for the current you should get at least info that you your post need to be aprooved. Strange thing, It worked for, but indeed you have to wait little longer for messages to appear in the [Archive], dunno what else to try here, maybe try to add your source code as an attachement instead of links, maybe some antispam cut your message, generally try message without any links.
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
|||
![]()
The problem was in my mail server - qmail was keeping the messages in its queue for unknown reason - only messages sent to freebsd.org were left in the queue, so I had to flush the queue and now I'll see the results.
@DutchDaemon The option is set to 'YES' by default and I haven't changed it. I'll post back later for the result ![]() |
|
|||
![]()
The program is in the list now
![]() Cheers -- DNAeon Last edited by J65nko; 28th September 2008 at 07:03 AM. Reason: Thread drift prevention, send DNAeon a PM with the deleted qmail question and asked to start a new thread about it |
|
|||
![]()
Hi, again!
![]() I've finished the new version of the program. I decided to name it pkg_add_it - pkg_add Interactive Tool pkg_add_it now supports the following:
The remote/ftp package pattern search is done by searching the INDEX file for a pattern and extracting the needed information from it. The program uses a default values for these environment variables if they have not been set:
It doesn't have any requirements, so it should build and run on any system that has fetch and pkg_add support. Screenshots of various usage of the program can be found here: http://unix-heaven.org/doc/pkg_add_it/gfx/ And the code is here: http://unix-heaven.org/ports-mgmt/pkg_add_it-1.0.tar.gz Well, I hope someone finds it useful ![]() P.S: If someone have any suggestions on how to improve more - let me know ![]() Cheers! --DNAeon Last edited by DNAeon; 5th October 2008 at 05:45 PM. Reason: Program name has changed! |
|
||||
![]() Quote:
|
|
||||
![]()
Is one supposed to define $OSRELEASE? All I have is $OSTYPE (freebsd7.0) and $MACHTYPE (i386-portbld-freebsd7.0). I guess calling 'uname -r' would be sufficient (7.1-PRERELEASE in my case).
Last edited by DutchDaemon; 1st October 2008 at 01:35 PM. |
|
|||
![]() Quote:
If you for example run FreeBSD 6.2 and want to install a package which is included in FreeBSD-8-CURRENT for example you will need to set $OSRELEASE = 8-current (which is the default behaviour), so the program will fetch the package file from 8-current directory of the FTP server. I wanted to keep the code cleaner so that way only env variables will do the job. ==== EDIT: The program is called now `pkg_add_it` - pkg_add interactive interface. There are a few changes made to the code and I've included also a small but useful feature - a pager. Now the program uses a pager defined by $PAGER for browsing through the package list. Also the port has been submitted to the FreeBSD ports tree, so let's hope that it will be added soon to the ports tree ![]() When this happens it will be under ports-mgmt/pkg_add_it All best, DNAeon Last edited by DNAeon; 5th October 2008 at 05:49 PM. Reason: Program name has changed!! |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
pkg_add problems with connecting | Mr-Biscuit | NetBSD Package System (pkgsrc) | 2 | 26th May 2009 11:44 AM |
pkg_add - can't resolve <packagename> | nihonto | OpenBSD Packages and Ports | 11 | 28th January 2009 10:03 PM |
pkg_add g95;g95 x.f95: cannot find g95 | enpey | OpenBSD Packages and Ports | 8 | 27th August 2008 12:48 AM |
pkg_add -r does not use exported packagesite | kasse | FreeBSD Ports and Packages | 16 | 26th August 2008 08:42 PM |
pkg_add error | buba | OpenBSD Packages and Ports | 4 | 13th June 2008 03:29 PM |