delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/19/18:03:35

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <017301c48638$5a0d05f0$78d96f83@robinson.cam.ac.uk>
From: "Max Bowsher" <maxb AT ukf DOT net>
To: <cygwin AT cygwin DOT com>, "Christopher Cobb" <ccobb AT email DOT com>
References: <loom DOT 20040819T173137-946 AT post DOT gmane DOT org> <00c801c4860a$adcd62d0$78d96f83 AT robinson DOT cam DOT ac DOT uk> <loom DOT 20040819T224628-719 AT post DOT gmane DOT org>
Subject: Re: installing packages using setup.exe from the command line (e.g., remotely)
Date: Thu, 19 Aug 2004 22:58:36 +0100
MIME-Version: 1.0
X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/
X-Cam-AntiVirus: No virus found
X-Cam-SpamDetails: Not scanned
X-IsSubscribed: yes
Note-from-DJ: This may be spam

Christopher Cobb wrote:
> Max Bowsher <maxb <at> ukf.net> writes:
>
>>
>> setup isn't really designed for use from the command line. It doesn't 
>> take
>> package names as arguments, for example. You could, I suppose, munge
>> /etc/setup/installed.db to fool setup into thinking that a really old 
>> (e.g.
>> version 0) version of a package is installed, so that it would updated -
>> it's a messy way to do it, but there is no better way.
>>
>> Max.
>
> Thanks Max for the idea.  Here is a quick hack/shell script which worked 
> on
> the (small handful) of packages that I tried with it.

>    pkgFileName=`
> awk < $SETUP_INI '
> /@ / {
>    pkgName=$2
> }
> /version: / && pkg == pkgName {
>    pkgVer=$2
> }
> /install: / && pkg == pkgName {
>    num=split($2,arrFile,"/")
>    pkgFile=arrFile[num]
>    hyphenOffset=index(pkgFile,"-")
>    if (hyphenOffset != 0)
>    {
>        pkgPrefix=substr(pkgFile, 0, hyphenOffset)
>        verLength=index(pkgFile,".tar.bz2") - hyphenOffset
>        ver=substr(pkgFile, hyphenOffset+1, verLength - 1)
>        pkgSuffix=substr(pkgFile, hyphenOffset + verLength)
>        pkgFile=pkgPrefix "" gensub(/[0-9]/,"0","g",ver) "" pkgSuffix
>        print pkgFile
>        pkgPrinted="true"
>        exit
>    }
> }
> END{
>    if (pkgPrinted != "true") print pkgFile
> }
> ' pkg=$pkgName
> `

Actually, this should suffice:

pkgFileName="$pkgName-0.tar.bz2"

Much shorter! :-)

Max.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019