|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
makeAre there any multi-platform experts here who would be willing to write a little bash script that autodetects the flavor of unix and runs: su -c "sudo make aptget" or: su -c "make emerge" or: sudo make port as appropriate? |
|
|
Re: make--- In iolanguage@..., Steve Dekorte <steve@...> wrote:
> > > Are there any multi-platform experts here who would be willing to > write a little bash script that autodetects the flavor of unix and runs: > > su -c "sudo make aptget" > or: > su -c "make emerge" > or: > sudo make port > > as appropriate? > I started with uname -s That only gives the type of OS. I. e. Linux for my fedora and debian and other *ixes as well. Other options wont help either. But that might help to branch Linux and BSD OS at first. (BTW option -o is illegal in FreeBSD/IRIX/Solaris - concerning to the manual - I have not tried myself). I tried then cat /etc/issue | awk{'print}' and cat /etc/issue | awk{'print $1}' I found that the "syntax" of the naming of the particular distro is very specific and that makes a problem with parsing. ($1 or $2 or another one?) But rethinking that not the version is under question but only the kind of package manager of the distribution in use, a better starting point might be if [ -f /etc/redhat-release ] ; then PKMGR=`which yum` elif [ -f /etc/debian_version ] ; then PKMGR=`which apt-get` fi ...etc. The problem there is to find the name a particular distro uses, I only know the name of fedora and debian (and that is the one for Knoppix-Versions as well, that I have tried), its debian_version. One has to find the expressions for all other main-distros, may be the Io user community will help? Otherwise be shure that ther will come plenty of feedback of the users not able to compile. I am quite shure, that a real Linux-geek (I am not) does know where the package manager is named, that would be the place easyly to ask for without any if-fi constructs. Another point in this field: I think the sudo thingy in "make" (or in the Makefile) is not a perfect path, because I myself am not a sudoer on my machine. (I know, its easy to prepare and I know how to.) I prefer to change to root with doing system administration. So I usually laborious change to su and run "make install". I therefore also prefer the seaparation of make and make install. Another point is: Is it not better to make a configure run first and a make install then after as root or sudoer? That will give the user the information about missing packages and he may decide to install or cancel without to place him under disability. I prefer to keep system things firmly in hand. Otherwise I could use Windows and agree the confiscation of my machine by the EULA. Regards BB |
|
|
Re: Re: makeOn Tue, Aug 4, 2009 at 9:24 AM, bblochl2<bblochl2@...> wrote:
> I found that the "syntax" of the naming of the particular distro is very specific and that makes a problem with parsing. ($1 or $2 or another one?) This is why this kind of problem should be solved in a language more sophisticated than shell script. What you want is to use a regular expression to check a line of text against a battery of patterns. The one that actually works is the most likely platform you're on. It's heuristic, but it should work the overwhelming majority of the time. > The problem there is to find the name a particular distro uses, I only know the name of fedora and debian (and that is the one for Knoppix-Versions as well, that I have tried), its debian_version. One has to find the expressions for all other main-distros, may be the Io user community will help? Otherwise be shure that ther will come plenty of feedback of the users not able to compile. Don't forget that some folks will have 'alien' installed, so you'll likely find that at least some users will have both apt-get AND rpm, etc. > I think the sudo thingy in "make" (or in the Makefile) is not a perfect path, because I myself am not a sudoer on my machine. (I know, its easy to prepare and I know how to.) I prefer to change to root with doing system administration. So I usually laborious change to su and run "make install". I therefore also prefer the seaparation of make and make install. I, too, prefer to "make install" as root. Alternatively, allow Io to make install as a normal user using $HOME/.io as its top-level directory. -- Samuel A. Falvo II |
|
|
Re: make--- In iolanguage@..., "Samuel A. Falvo II" <sam.falvo@...> wrote:
... > This is why this kind of problem should be solved in a language more > sophisticated than shell script. What you want is to use a regular > expression to check a line of text against a battery of patterns.The > one that actually works is the most likely platform you're on. It's > heuristic, but it should work the overwhelming majority of the time. > I am not convinced with any "backdor package update" as a side effect of software installation. But the problem simply intrigued me. So I am not fighting for but just for clarification some more details. Actually I did a fast internet check of package managers under use and found that there are not so many. The reason is, that there are only a handful of basic distros with thousands of issues. The main package managers: Debian and all Debian based uses apt-get/aptutude/dpkg Slackware and all Slackware based uses slapt-get Redhat/Fedora based, including CentOS uses rpm/yum, Fedora apt/yum Gentoo uses emerge Arc uses pacman SuSe uses yast/rpm/zypper Mandriva uses a wrapper to the rpm called urpmi Solaris uses the wrapper pkgadd BSD compares more to Gentoo with ports If a distro uses more than one that should not be any problem, quite contrary there is always one fitting out of the choice provided. > Don't forget that some folks will have 'alien' installed, so you'll > likely find that at least some users will have both apt-get AND rpm, > etc. > Because of that repeated use of the mainstream distros for remastering, I do not believe that there are so many exotic or "alien" versions build from scratch. Think of ubuntu as one derivate of many of Debian and the hundreds of remastered derivates from ubuntu. Another important point, not discussed actually is the danger of easy exploiting by so called replay attacks. So I will keep away from software that eventually impacts my packages and i. e. unexpectedly installs old packages just for compatibility with new software. Regards BB |
|
|
Re: Re: makeOn Tue, Aug 4, 2009 at 12:37 PM, bblochl2<bblochl2@...> wrote:
> Slackware and all Slackware based uses slapt-get Clarification -- the Slackware user must install slapt-get using Slackware's default package management tools (pkginstall) before slapt-get is available. But, at least it IS available. :) > Redhat/Fedora based, including CentOS uses rpm/yum, Fedora apt/yum Fedora uses RPM/yum as well; apt is Debian and derivatives only. Also MacOS X uses both BSD-style ports and a variant of apt as well (through "fink"). Talk about a Medusa-style package management system. Yikes! -- Samuel A. Falvo II |
|
|
Re: Re: makeCorrection, Mac OS X has no package management system. MacPorts and
Fink are addons that not very many users actually use. On 4-Aug-09, at 3:43 PM, Samuel A. Falvo II wrote: > On Tue, Aug 4, 2009 at 12:37 PM, bblochl2<bblochl2@...> wrote: >> Slackware and all Slackware based uses slapt-get > > Clarification -- the Slackware user must install slapt-get using > Slackware's default package management tools (pkginstall) before > slapt-get is available. But, at least it IS available. :) > >> Redhat/Fedora based, including CentOS uses rpm/yum, Fedora apt/yum > > Fedora uses RPM/yum as well; apt is Debian and derivatives only. > > Also MacOS X uses both BSD-style ports and a variant of apt as well > (through "fink"). Talk about a Medusa-style package management > system. Yikes! > > -- > Samuel A. Falvo II > > > ------------------------------------ > > Yahoo! Groups Links > > > Regards, Jeremy Tregunna jeremy.tregunna@... |
| Free embeddable forum powered by Nabble | Forum Help |