public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* search and install packages via bash?
@ 2021-07-08  8:45 Ulli Horlacher
  2021-07-08 12:13 ` Jon Turney
  2021-07-08 18:28 ` Thomas Wolff
  0 siblings, 2 replies; 13+ messages in thread
From: Ulli Horlacher @ 2021-07-08  8:45 UTC (permalink / raw)
  To: cygwin

Is it possible from an interactive bash to search for cygwin packages (by
substring match) and install them?

I tried "/setup-x86_64.exe -h" but cannot see any options for it.

In the past I used apt-cyg for this task, but it is depreciated and it
does not work any more.


-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<20210708084556.GA7359@tik.uni-stuttgart.de>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
  2021-07-08  8:45 search and install packages via bash? Ulli Horlacher
@ 2021-07-08 12:13 ` Jon Turney
  2021-07-08 13:53   ` Ulli Horlacher
  2021-07-08 14:19   ` Ulli Horlacher
  2021-07-08 18:28 ` Thomas Wolff
  1 sibling, 2 replies; 13+ messages in thread
From: Jon Turney @ 2021-07-08 12:13 UTC (permalink / raw)
  To: Ulli Horlacher, The Cygwin Mailing List

On 08/07/2021 09:45, Ulli Horlacher wrote:
> Is it possible from an interactive bash to search for cygwin packages (by
> substring match) and install them?
> 
> I tried "/setup-x86_64.exe -h" but cannot see any options for it.

This feature doesn't exist (yet).

You could possibly build something equivalent using 'cygcheck -p' and 
then processing it's output, but patches to setup to add this feature 
would be welcome.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
  2021-07-08 12:13 ` Jon Turney
@ 2021-07-08 13:53   ` Ulli Horlacher
  2021-07-08 14:46     ` Marco Atzeri
  2021-07-08 14:19   ` Ulli Horlacher
  1 sibling, 1 reply; 13+ messages in thread
From: Ulli Horlacher @ 2021-07-08 13:53 UTC (permalink / raw)
  To: The Cygwin Mailing List

On Thu 2021-07-08 (13:13), Jon Turney wrote:
> On 08/07/2021 09:45, Ulli Horlacher wrote:
> 
> > Is it possible from an interactive bash to search for cygwin packages (by
> > substring match) and install them?
> > 
> > I tried "/setup-x86_64.exe -h" but cannot see any options for it.
> 
> This feature doesn't exist (yet).
> 
> You could possibly build something equivalent using 'cygcheck -p' and 
> then processing it's output

This is the easy part, but how do I install a package via bash?
I tried it this way:


W10dev:/usr/local: /setup-x86_64.exe  -M -B -R "$CYGWIN_ROOT" -l "$CYGWIN_ROOT/.pkg-cache" -s https://ftp.fau.de/cygwin -P mksh
Starting cygwin install, version 2.908
User has NO backup/restore rights
io_stream_cygfile: fopen(/etc/setup/setup.rc) failed 2 No such file or directory
Current Directory: C:\Users\admin\cygwin/.pkg-cache
root: C:\Users\admin\cygwin user
Selected local directory: C:\Users\admin\cygwin/.pkg-cache
net: Preconfig
site: https://ftp.fau.de/cygwin/


But got "Nothing to install or update"

https://fex.flupp.org/fop/nbVoB9kQ/X-20210708155136.png


The fopen() error is mysterious for me, too:

W10dev:/usr/local: ll /etc/setup/setup.rc
-rw-r--r-- admin None 11,850 2021-07-08 15:36:54 /etc/setup/setup.rc

W10dev:/usr/local: id
uid=1001(admin) gid=197121(None) groups=197121(None),545(Users),4(INTERACTIVE),66049(CONSOLE LOGON),11(Authenticated Users),15(This Organization),113(Local account),4095(CurrentSession),66048(LOCAL),262154(NTLM Authentication),401408(Medium Mandatory Level)

W10dev:/usr/local: head -2 /etc/setup/setup.rc
last-cache
        C:\Users\admin\cygwin/.pkg-cache


-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<bf14fb2b-ddf5-8618-0da3-9ea5531c5877@dronecode.org.uk>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
  2021-07-08 12:13 ` Jon Turney
  2021-07-08 13:53   ` Ulli Horlacher
@ 2021-07-08 14:19   ` Ulli Horlacher
  2021-07-08 21:11     ` Richard Beels
                       ` (4 more replies)
  1 sibling, 5 replies; 13+ messages in thread
From: Ulli Horlacher @ 2021-07-08 14:19 UTC (permalink / raw)
  To: The Cygwin Mailing List

On Thu 2021-07-08 (13:13), Jon Turney wrote:

> You could possibly build something equivalent using 'cygcheck -p' and 
> then processing it's output

This part was easy:


W10dev:/usr/local/bin: cygsearch ksh
Found 449 matches for ksh
kshisen-debuginfo-17.04.3-1 - kshisen-debuginfo: Debug info for kshisen
kshisen-debuginfo-17.08.3-1 - kshisen-debuginfo: Debug info for kshisen
kshisen-debuginfo-17.12.3-1 - kshisen-debuginfo: Debug info for kshisen
kshisen-17.04.3-1-src - kshisen-src: KDE Shisensho game (source)
kshisen-17.08.3-1-src - kshisen-src: KDE Shisensho game (source)
kshisen-17.12.3-1-src - kshisen-src: KDE Shisensho game (source)
kshisen-17.04.3-1 - kshisen: KDE Shisensho game
kshisen-17.08.3-1 - kshisen: KDE Shisensho game
kshisen-17.12.3-1 - kshisen: KDE Shisensho game
mksh-debuginfo-53a-1 - mksh-debuginfo: Debug info for mksh (installed binaries and support files)
mksh-debuginfo-54-1 - mksh-debuginfo: Debug info for mksh (installed binaries and support files)
mksh-debuginfo-56c-1 - mksh-debuginfo: Debug info for mksh
mksh-53a-1-src - mksh-src: MirBSD Korn Shell (source)
mksh-54-1-src - mksh-src: MirBSD Korn Shell (source)
mksh-56c-1-src - mksh-src: MirBSD Korn Shell (source)
mksh-53a-1 - mksh: MirBSD Korn Shell (installed binaries and support files)
mksh-54-1 - mksh: MirBSD Korn Shell (installed binaries and support files)
mksh-56c-1 - mksh: MirBSD Korn Shell


W10dev:/usr/local/bin: cat cygsearch
#!/bin/bash

prg=$(basename $)

if [ -z "$1" -o "$1" = "-h" ]; then
  echo "usage: $prg [-a] EXPRESSION"
  echo "example: $prg zsh"
  echo "see also: cygcheck, cyginstall"
  exit
fi

if [ "$1" = "-a" ]; then
  cygcheck -p "$2"
else
  cygcheck -p "$1" | grep "$1"
fi


-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<bf14fb2b-ddf5-8618-0da3-9ea5531c5877@dronecode.org.uk>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
  2021-07-08 13:53   ` Ulli Horlacher
@ 2021-07-08 14:46     ` Marco Atzeri
  2021-07-08 15:02       ` Ulli Horlacher
  0 siblings, 1 reply; 13+ messages in thread
From: Marco Atzeri @ 2021-07-08 14:46 UTC (permalink / raw)
  To: cygwin

On 08.07.2021 15:53, Ulli Horlacher wrote:
> On Thu 2021-07-08 (13:13), Jon Turney wrote:
>> On 08/07/2021 09:45, Ulli Horlacher wrote:
>>
>>> Is it possible from an interactive bash to search for cygwin packages (by
>>> substring match) and install them?
>>>
>>> I tried "/setup-x86_64.exe -h" but cannot see any options for it.
>>
>> This feature doesn't exist (yet).
>>
>> You could possibly build something equivalent using 'cygcheck -p' and
>> then processing it's output
> 
> This is the easy part, but how do I install a package via bash?
> I tried it this way:
> 
> 
> W10dev:/usr/local: /setup-x86_64.exe  -M -B -R "$CYGWIN_ROOT" -l "$CYGWIN_ROOT/.pkg-cache" -s https://ftp.fau.de/cygwin -P mksh

try without the
    -l "$CYGWIN_ROOT/.pkg-cache"


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
  2021-07-08 14:46     ` Marco Atzeri
@ 2021-07-08 15:02       ` Ulli Horlacher
  0 siblings, 0 replies; 13+ messages in thread
From: Ulli Horlacher @ 2021-07-08 15:02 UTC (permalink / raw)
  To: cygwin

On Thu 2021-07-08 (16:46), Marco Atzeri via Cygwin wrote:
> On 08.07.2021 15:53, Ulli Horlacher wrote:
> 
> > On Thu 2021-07-08 (13:13), Jon Turney wrote:
> >> On 08/07/2021 09:45, Ulli Horlacher wrote:
> >>
> >>> Is it possible from an interactive bash to search for cygwin packages (by
> >>> substring match) and install them?
> >>>
> >>> I tried "/setup-x86_64.exe -h" but cannot see any options for it.
> >>
> >> This feature doesn't exist (yet).
> >>
> >> You could possibly build something equivalent using 'cygcheck -p' and
> >> then processing it's output
> > 
> > This is the easy part, but how do I install a package via bash?
> > I tried it this way:
> > 
> > 
> > W10dev:/usr/local: /setup-x86_64.exe  -M -B -R "$CYGWIN_ROOT" -l "$CYGWIN_ROOT/.pkg-cache" -s https://ftp.fau.de/cygwin -P mksh
> 
> try without the
>     -l "$CYGWIN_ROOT/.pkg-cache"

Same result: nothing is displayed selected for installation.

But when I click "Next" the package will be installed! HUH?!

Augmented Transaction List:
   0 install mksh 56c-1
Extracting from file://C:\Users\admin\cygwin/.pkg-cache/https%3a%2f%2fftp.fau.de%2fcygwin%2f/x86_64/release/mksh/mksh-56c-1.tar.xz
running: C:\Users\admin\cygwin\bin\dash.exe "/etc/postinstall/0p_000_autorebase.dash"
running: C:\Users\admin\cygwin\bin\dash.exe "/etc/postinstall/0p_update-info-dir.dash"
running: C:\Users\admin\cygwin\bin\bash.exe --norc --noprofile "/etc/postinstall/mksh.sh"
running: C:\Users\admin\cygwin\bin\dash.exe "/etc/postinstall/zp_man-db-update-index.dash"
Ending cygwin install

W10dev:/usr/local/bin: type ksh
ksh is /usr/bin/ksh

W10dev:/usr/local/bin: cygcheck -f /usr/bin/ksh
mksh-56c-1


-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<ee7dae60-6b16-8576-5777-537a4b7c8697@gmail.com>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
  2021-07-08  8:45 search and install packages via bash? Ulli Horlacher
  2021-07-08 12:13 ` Jon Turney
@ 2021-07-08 18:28 ` Thomas Wolff
  1 sibling, 0 replies; 13+ messages in thread
From: Thomas Wolff @ 2021-07-08 18:28 UTC (permalink / raw)
  To: cygwin


Am 08.07.2021 um 10:45 schrieb Ulli Horlacher:
> Is it possible from an interactive bash to search for cygwin packages (by
> substring match) and install them?
>
> I tried "/setup-x86_64.exe -h" but cannot see any options for it.
>
> In the past I used apt-cyg for this task, but it is depreciated and it
> does not work any more.
There's also apt-cyg: https://github.com/transcode-open/apt-cyg/

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
  2021-07-08 14:19   ` Ulli Horlacher
  2021-07-08 21:11     ` Richard Beels
  2021-07-08 21:11     ` Richard Beels
@ 2021-07-08 21:11     ` Richard Beels
       [not found]     ` <20210708211451.0007A3888821@sourceware.org>
       [not found]     ` <20210708211539.705673AA9C30@sourceware.org>
  4 siblings, 0 replies; 13+ messages in thread
From: Richard Beels @ 2021-07-08 21:11 UTC (permalink / raw)
  To: cygwin


At 07/08/2021 at 10:19, Shakespearean monkeys danced on Ulli 
Horlacher's keyboard and said:
>This part was easy:
>
>W10dev:/usr/local/bin: cygsearch ksh
>Found 449 matches for ksh
>kshisen-debuginfo-17.04.3-1 - kshisen-debuginfo: Debug info for kshisen
><snipped>
>mksh-56c-1 - mksh: MirBSD Korn Shell

1.maybe you saw nothing selected for install because the main 
window's view chooser was to "pending" and not "full"?

2, use fzf.  i don't use it (yet?) but it should be something like:

cyginst() { # a little function to install a package from the cli
_pkg=$(cygsearch "$1" | fzf | cut -f1 -d'-' )
/setup-x86_64.exe  ... -P "$_pkg"
}

the cut is to strip off all the versioning choices.  i think fzf can 
even allow you to edit the choice you make to eliminate that.  or you 
you change the cut to a sed and only strip off '-[0-9]*' for apps 
that use a dash in their real name (can't think of one ottomh, but...).

fzf is packaged for cygwin and the github page has more help than I 
cared to read when I found it. :)




Cheers!


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
  2021-07-08 14:19   ` Ulli Horlacher
  2021-07-08 21:11     ` Richard Beels
@ 2021-07-08 21:11     ` Richard Beels
  2021-07-08 21:11     ` Richard Beels
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Richard Beels @ 2021-07-08 21:11 UTC (permalink / raw)
  To: cygwin


At 07/08/2021 at 10:19, Shakespearean monkeys danced on Ulli 
Horlacher's keyboard and said:
>This part was easy:
>
>W10dev:/usr/local/bin: cygsearch ksh
>Found 449 matches for ksh
>kshisen-debuginfo-17.04.3-1 - kshisen-debuginfo: Debug info for kshisen
><snipped>
>mksh-56c-1 - mksh: MirBSD Korn Shell

1.maybe you saw nothing selected for install because the main 
window's view chooser was to "pending" and not "full"?

2, use fzf.  i don't use it (yet?) but it should be something like:

cyginst() { # a little function to install a package from the cli
_pkg=$(cygsearch "$1" | fzf | cut -f1 -d'-' )
/setup-x86_64.exe  ... -P "$_pkg"
}

the cut is to strip off all the versioning choices.  i think fzf can 
even allow you to edit the choice you make to eliminate that.  or you 
you change the cut to a sed and only strip off '-[0-9]*' for apps 
that use a dash in their real name (can't think of one ottomh, but...).

fzf is packaged for cygwin and the github page has more help than I 
cared to read when I found it. :)




Cheers!


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
  2021-07-08 14:19   ` Ulli Horlacher
@ 2021-07-08 21:11     ` Richard Beels
  2021-07-08 21:11     ` Richard Beels
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Richard Beels @ 2021-07-08 21:11 UTC (permalink / raw)
  To: cygwin


At 07/08/2021 at 10:19, Shakespearean monkeys danced on Ulli 
Horlacher's keyboard and said:
>This part was easy:
>
>W10dev:/usr/local/bin: cygsearch ksh
>Found 449 matches for ksh
>kshisen-debuginfo-17.04.3-1 - kshisen-debuginfo: Debug info for kshisen
><snipped>
>mksh-56c-1 - mksh: MirBSD Korn Shell

1.maybe you saw nothing selected for install because the main 
window's view chooser was to "pending" and not "full"?

2, use fzf.  i don't use it (yet?) but it should be something like:

cyginst() { # a little function to install a package from the cli
_pkg=$(cygsearch "$1" | fzf | cut -f1 -d'-' )
/setup-x86_64.exe  ... -P "$_pkg"
}

the cut is to strip off all the versioning choices.  i think fzf can 
even allow you to edit the choice you make to eliminate that.  or you 
you change the cut to a sed and only strip off '-[0-9]*' for apps 
that use a dash in their real name (can't think of one ottomh, but...).

fzf is packaged for cygwin and the github page has more help than I 
cared to read when I found it. :)




Cheers!


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
       [not found]     ` <20210708211451.0007A3888821@sourceware.org>
@ 2021-07-10  4:14       ` Richard Beels
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Beels @ 2021-07-10  4:14 UTC (permalink / raw)
  To: cygwin

At 07/08/2021 at 17:11, Shakespearean monkeys danced on Richard Beels 
via Cygwin's keyboard and said:

><snipped>
>2, use fzf.  i don't use it (yet?) but it should be something like:


I decided to download fzf and play with this since the itch grabbed 
me...  It took all of 5 seconds for me to remember a bunch of 
packages with a "-" in the name, so came up with this instead:

cyginst() { # install cygwin package(s) from the commandline, can't do *-src
_pkg=$(cygcheck -p "$1"       \
     | grep "$1"               \
     | fzf --multi --reverse   \
     | sed -E 's_-[0-9]+.*$__' \
     | tr '\n' ','             \
     | sed 's_,$__')
/setup-x86_64.exe --packages "$_pkg"
}

Since this would whack -src, I tried to figure out how to install 
just a source package from the commandline to see if this would 
matter but couldn't figure it out, so I guess the -I option is there 
for a reason.

But I came across a weirdity with setup (2.908).  While you can 
change the mode into download (-D) only or local-install (-L) via 
commandline, I couldn't figure out how to change it back to "install 
from the internet" from the commandline.  I think there should be a 
parameter for this, but heck if I I have any idea about C++ (I can 
barely spell it).

At a minimum, it seems that the code currently is in contradiction to 
the --help output: once you choose -L or -D, that becomes the default 
mode for subsequent runs.  Until explicitly changed back by running 
setup and clicking the appropriate button on the second dialog.  It 
looks like the "last-action" setting in /etc/setup/setup.rc controls 
what is used as the default: "Download", "Install" (local install) 
and "Download, Install" (internet install).  The expected behavior 
would be as the --help output describes.




Cheers!


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
       [not found]     ` <20210708211539.705673AA9C30@sourceware.org>
@ 2021-07-10 14:13       ` Adam Dinwoodie
  2021-07-10 14:20         ` Eliot Moss
  0 siblings, 1 reply; 13+ messages in thread
From: Adam Dinwoodie @ 2021-07-10 14:13 UTC (permalink / raw)
  To: Cygwin (cygwin@cygwin.com)

On Thu, 8 Jul 2021 at 22:15, Richard Beels via Cygwin wrote:
> 2, use fzf.  i don't use it (yet?) but it should be something like:
>
> cyginst() { # a little function to install a package from the cli
> _pkg=$(cygsearch "$1" | fzf | cut -f1 -d'-' )
> /setup-x86_64.exe  ... -P "$_pkg"
> }
>
> the cut is to strip off all the versioning choices.  i think fzf can
> even allow you to edit the choice you make to eliminate that.  or you
> you change the cut to a sed and only strip off '-[0-9]*' for apps
> that use a dash in their real name (can't think of one ottomh, but...).
>
> fzf is packaged for cygwin and the github page has more help than I
> cared to read when I found it. :)

Just as a warning: the fzf package available on Cygwin is an old and
unsupported version. The upstream fzf project switched to Go, which
doesn't have a Cygwin compiler, so bringing it up-to-date is not an
easy project.

In particular, while I expect the core fzf function is absolutely
fine, it's not safe to assume that anything in particular in the
upstream documentation matches the behaviour of the fzf version
available through Cygwin.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: search and install packages via bash?
  2021-07-10 14:13       ` Adam Dinwoodie
@ 2021-07-10 14:20         ` Eliot Moss
  0 siblings, 0 replies; 13+ messages in thread
From: Eliot Moss @ 2021-07-10 14:20 UTC (permalink / raw)
  To: Cygwin (cygwin@cygwin.com)

On 7/10/2021 10:13 AM, Adam Dinwoodie wrote:
 > On Thu, 8 Jul 2021 at 22:15, Richard Beels via Cygwin wrote:
 >> 2, use fzf.  i don't use it (yet?) but it should be something like:

 > Just as a warning: the fzf package available on Cygwin is an old and
 > unsupported version. The upstream fzf project switched to Go, which doesn't
 > have a Cygwin compiler, so bringing it up-to-date is not an easy project.

I've noticed that gcc supports go (gccgo).  I gather that gccgo has not been
ported to cygwin, and that there is some problem doing so?  I did notice
remarks about using small stacks for goroutines requires the Gold linker.

It's more a point of curiosity, but perhaps someone could expand a bit on the
details :-) ...

Regards - Eliot Moss

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-07-10 14:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-08  8:45 search and install packages via bash? Ulli Horlacher
2021-07-08 12:13 ` Jon Turney
2021-07-08 13:53   ` Ulli Horlacher
2021-07-08 14:46     ` Marco Atzeri
2021-07-08 15:02       ` Ulli Horlacher
2021-07-08 14:19   ` Ulli Horlacher
2021-07-08 21:11     ` Richard Beels
2021-07-08 21:11     ` Richard Beels
2021-07-08 21:11     ` Richard Beels
     [not found]     ` <20210708211451.0007A3888821@sourceware.org>
2021-07-10  4:14       ` Richard Beels
     [not found]     ` <20210708211539.705673AA9C30@sourceware.org>
2021-07-10 14:13       ` Adam Dinwoodie
2021-07-10 14:20         ` Eliot Moss
2021-07-08 18:28 ` Thomas Wolff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).