public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Listing only manually installed package
@ 2020-06-26 16:34 Yasuhiro KIMURA
  2020-06-26 17:15 ` Andrey Repin
  2020-06-26 17:20 ` Brian Inglis
  0 siblings, 2 replies; 12+ messages in thread
From: Yasuhiro KIMURA @ 2020-06-26 16:34 UTC (permalink / raw)
  To: cygwin

Hello.

When installing one package, it is quite common for several other
packages to be automatically installed as dependencies. And output of
`cygcheck -c` includes both of them. Then is there any way to list
only manually installed package?

Best Regards.

---
Yasuhiro KIMURA

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

* Re: Listing only manually installed package
  2020-06-26 16:34 Listing only manually installed package Yasuhiro KIMURA
@ 2020-06-26 17:15 ` Andrey Repin
  2020-06-26 18:04   ` Yasuhiro KIMURA
  2020-06-26 17:20 ` Brian Inglis
  1 sibling, 1 reply; 12+ messages in thread
From: Andrey Repin @ 2020-06-26 17:15 UTC (permalink / raw)
  To: Yasuhiro KIMURA, cygwin

Greetings, Yasuhiro KIMURA!

> When installing one package, it is quite common for several other
> packages to be automatically installed as dependencies. And output of
> `cygcheck -c` includes both of them. Then is there any way to list
> only manually installed package?

AFAIK, there's no way to tell if a package was manually selected or not.
Cygwin's setup just don't store this information.


-- 
With best regards,
Andrey Repin
Friday, June 26, 2020 20:14:03

Sorry for my terrible english...


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

* Re: Listing only manually installed package
  2020-06-26 16:34 Listing only manually installed package Yasuhiro KIMURA
  2020-06-26 17:15 ` Andrey Repin
@ 2020-06-26 17:20 ` Brian Inglis
  1 sibling, 0 replies; 12+ messages in thread
From: Brian Inglis @ 2020-06-26 17:20 UTC (permalink / raw)
  To: cygwin

On 2020-06-26 10:34, Yasuhiro KIMURA wrote:
> When installing one package, it is quite common for several other
> packages to be automatically installed as dependencies. And output of
> `cygcheck -c` includes both of them. Then is there any way to list
> only manually installed package?

$ grep '\s1$' /etc/setup/installed.db	# manual
$ grep '\s0$' /etc/setup/installed.db	# auto

$ awk '1 == $3' /etc/setup/installed.db	# manual
$ awk '0 == $3' /etc/setup/installed.db	# auto

I can't remember what the pristine state of the Base category packages are,
I've messed around with the setup files so much for so long.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

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

* Re: Listing only manually installed package
  2020-06-26 17:15 ` Andrey Repin
@ 2020-06-26 18:04   ` Yasuhiro KIMURA
  2020-06-26 18:37     ` Brian Inglis
                       ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Yasuhiro KIMURA @ 2020-06-26 18:04 UTC (permalink / raw)
  To: cygwin

From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
Subject: Re: Listing only manually installed package
Date: Fri, 26 Jun 2020 11:20:26 -0600

> $ grep '\s1$' /etc/setup/installed.db	# manual
> $ grep '\s0$' /etc/setup/installed.db	# auto
> 
> $ awk '1 == $3' /etc/setup/installed.db	# manual
> $ awk '0 == $3' /etc/setup/installed.db	# auto
> 
> I can't remember what the pristine state of the Base category packages are,
> I've messed around with the setup files so much for so long.

I checked /etc/setup/installed.db on my 32bit and 64bit console but in
each case all lines end with "0". Therefore,

From: Andrey Repin <anrdaemon@yandex.ru>
Subject: Re: Listing only manually installed package
Date: Fri, 26 Jun 2020 20:15:21 +0300

> AFAIK, there's no way to tell if a package was manually selected or not.
> Cygwin's setup just don't store this information.

As you say, unfortunately there seems to be no way to tell if a
package was installed manually or automatically.

---
Yasuhiro KIMURA

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

* Re: Listing only manually installed package
  2020-06-26 18:04   ` Yasuhiro KIMURA
@ 2020-06-26 18:37     ` Brian Inglis
  2020-06-26 22:20     ` Brian Inglis
  2020-06-27  7:40     ` Csaba Raduly
  2 siblings, 0 replies; 12+ messages in thread
From: Brian Inglis @ 2020-06-26 18:37 UTC (permalink / raw)
  To: cygwin

On 2020-06-26 12:04, Yasuhiro KIMURA wrote:
>> On Fri, 26 Jun 2020 20:15:21 +0300, Andrey Repin wrote:
> On Fri, 26 Jun 2020 11:20:26 -0600 Brian Inglis wrote:
>> $ grep '\s1$' /etc/setup/installed.db	# manual
>> $ grep '\s0$' /etc/setup/installed.db	# auto
>>
>> $ awk '1 == $3' /etc/setup/installed.db	# manual
>> $ awk '0 == $3' /etc/setup/installed.db	# auto
>>
>> I can't remember what the pristine state of the Base category packages are,
>> I've messed around with the setup files so much for so long.

> I checked /etc/setup/installed.db on my 32bit and 64bit console but in
> each case all lines end with "0". Therefore,

>> AFAIK, there's no way to tell if a package was manually selected or not.
>> Cygwin's setup just don't store this information.

> As you say, unfortunately there seems to be no way to tell if a
> package was installed manually or automatically.

I have 1522 packages installed: 421 manually installed packages and 1101
automatically installed.

It appears you have 0 manually installed packages in the Cygwin installation you
are looking at, if you used a Cygwin setup-compatible installer, ran exactly the
commands quoted above, and they gave you consistent answers.

It is possible setup has been changed incompatibly and no longer maintains that
field correctly, but in case not, *NEVER* run setup and tell it to remove
obsolete packages: it will remove all non-Base packages that do not have others
which depend on them!

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

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

* Re: Listing only manually installed package
  2020-06-26 18:04   ` Yasuhiro KIMURA
  2020-06-26 18:37     ` Brian Inglis
@ 2020-06-26 22:20     ` Brian Inglis
  2020-06-27  5:02       ` Cygwin
                         ` (2 more replies)
  2020-06-27  7:40     ` Csaba Raduly
  2 siblings, 3 replies; 12+ messages in thread
From: Brian Inglis @ 2020-06-26 22:20 UTC (permalink / raw)
  To: cygwin

On 2020-06-26 12:04, Yasuhiro KIMURA wrote:
> From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
> Subject: Re: Listing only manually installed package
> Date: Fri, 26 Jun 2020 11:20:26 -0600
> 
>> $ grep '\s1$' /etc/setup/installed.db	# manual
>> $ grep '\s0$' /etc/setup/installed.db	# auto
>>
>> $ awk '1 == $3' /etc/setup/installed.db	# manual
>> $ awk '0 == $3' /etc/setup/installed.db	# auto
>>
>> I can't remember what the pristine state of the Base category packages are,
>> I've messed around with the setup files so much for so long.
> 
> I checked /etc/setup/installed.db on my 32bit and 64bit console but in
> each case all lines end with "0". Therefore,
> 
> From: Andrey Repin <anrdaemon@yandex.ru>
> Subject: Re: Listing only manually installed package
> Date: Fri, 26 Jun 2020 20:15:21 +0300
> 
>> AFAIK, there's no way to tell if a package was manually selected or not.
>> Cygwin's setup just don't store this information.
> 
> As you say, unfortunately there seems to be no way to tell if a
> package was installed manually or automatically.

Just checked the setup sources, so unless there is a bug, you are running a
setup version over 5 years old, or not running Cygwin setup, user_picked is part
of the package metadata that is still read from and written to installed.db.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

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

* Re: Re: Listing only manually installed package
  2020-06-26 22:20     ` Brian Inglis
@ 2020-06-27  5:02       ` Cygwin
  2020-06-27 17:35         ` Brian Inglis
  2020-06-27  8:50       ` Yasuhiro KIMURA
  2020-06-28 14:12       ` Jon Turney
  2 siblings, 1 reply; 12+ messages in thread
From: Cygwin @ 2020-06-27  5:02 UTC (permalink / raw)
  To: cygwin

> Just checked the setup sources, so unless there is a bug, you are running a
> setup version over 5 years old, or not running Cygwin setup, user_picked is part
> of the package metadata that is still read from and written to installed.db.
FYI,  I'm seeing the same thing as Yasuhiro.

I purchased a new personal Windows 10 Home laptop and Windows 10 Pro 
desktop in March, and received a new Windows 10 Enterprise laptop for 
work this week.  On all 3 systems I downloaded setup-x86_64 from 
cygwin.com and first installed cygwin without adding any additional 
packages.  I then ran setup again to install a more packages that I 
needed for personal use or work use (respectively).  On all three 
machines the "manual" commands show nothing and the "auto" commands 
(appear to) show everything.  Its been a couple months so I don't 
remember what I manually installed on the personal machines, but the 
work machine was only 2 days ago, and I remember installing at least bc 
and psmisc (and maybe curl).  FWIW, I'm not sure if its relevant, but 
running setup now and selecting "Picked" from the drop down shows 
"Nothing to install or update".

Is there a log file somewhere where I can see what packages were 
installed/updated in each run of setup?

     - Peter Canning

PS: I would love a way to get this listing, as it would have simplified 
installing cygwin on all 3 systems (replicating the installations on the 
systems they replaced).


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

* Re: Listing only manually installed package
  2020-06-26 18:04   ` Yasuhiro KIMURA
  2020-06-26 18:37     ` Brian Inglis
  2020-06-26 22:20     ` Brian Inglis
@ 2020-06-27  7:40     ` Csaba Raduly
  2 siblings, 0 replies; 12+ messages in thread
From: Csaba Raduly @ 2020-06-27  7:40 UTC (permalink / raw)
  To: Yasuhiro KIMURA; +Cc: cygwin list

On Fri, 26 Jun 2020 at 20:20, Yasuhiro KIMURA  wrote:
>
> From: Brian Inglis
> Subject: Re: Listing only manually installed package
> Date: Fri, 26 Jun 2020 11:20:26 -0600
>
> > $ grep '\s1$' /etc/setup/installed.db # manual
> > $ grep '\s0$' /etc/setup/installed.db # auto
> >
> > $ awk '1 == $3' /etc/setup/installed.db       # manual
> > $ awk '0 == $3' /etc/setup/installed.db       # auto
> >
> > I can't remember what the pristine state of the Base category packages
are,
> > I've messed around with the setup files so much for so long.
>
> I checked /etc/setup/installed.db on my 32bit and 64bit console but in
> each case all lines end with "0". Therefore,
>

Just a data point:
Csaba@AMDAHL ~
$ grep -c '\s1$' /etc/setup/installed.db
49

Csaba@AMDAHL ~
$ grep -c '\s0$' /etc/setup/installed.db
461

Csaba

--
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformant
way
to get the wrong information: this is what you want. - Scott Meyers
(C++TDaWYK)

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

* Re: Listing only manually installed package
  2020-06-26 22:20     ` Brian Inglis
  2020-06-27  5:02       ` Cygwin
@ 2020-06-27  8:50       ` Yasuhiro KIMURA
  2020-06-28 14:12       ` Jon Turney
  2 siblings, 0 replies; 12+ messages in thread
From: Yasuhiro KIMURA @ 2020-06-27  8:50 UTC (permalink / raw)
  To: cygwin

From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
Subject: Re: Listing only manually installed package
Date: Fri, 26 Jun 2020 16:20:06 -0600

> Just checked the setup sources, so unless there is a bug, you are running a
> setup version over 5 years old, or not running Cygwin setup, user_picked is part
> of the package metadata that is still read from and written to installed.db.

I tested this issue with clean installed 64bit Windows 10 1909.

At first I downloaded setup-x86_64.exe from Cygwin Web page and
executed it. According to start message, version is 2.904.

Then I installed only Base packages, exited setup-x86_64.exe, opened
Cygwin console and checked /etc/setup/installed.db. All lines end with
"0".

Next I executed setup-x86_64.exe again, selected 'openssh", installed
it, and checked /etc/setup/installed.db. All lines still end with "0".

After that I installed some other packages. But there is no line
ending with "1" in /etc/setup/installed.db.

Therefore if this isn't expected behavior, there must be bug in latest
(or recent) version of setup.exe.

FYI, I removed all cygwin-related files from my main PC and re-setuped
cygwin environment about a month ago.

---
Yasuhiro KIMURA

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

* Re: Listing only manually installed package
  2020-06-27  5:02       ` Cygwin
@ 2020-06-27 17:35         ` Brian Inglis
  0 siblings, 0 replies; 12+ messages in thread
From: Brian Inglis @ 2020-06-27 17:35 UTC (permalink / raw)
  To: cygwin

On 2020-06-26 23:02, Cygwin wrote:
>> Just checked the setup sources, so unless there is a bug, you are running a
>> setup version over 5 years old, or not running Cygwin setup, user_picked is part
>> of the package metadata that is still read from and written to installed.db.
> FYI,  I'm seeing the same thing as Yasuhiro.
> 
> I purchased a new personal Windows 10 Home laptop and Windows 10 Pro desktop in
> March, and received a new Windows 10 Enterprise laptop for work this week.  On
> all 3 systems I downloaded setup-x86_64 from cygwin.com and first installed
> cygwin without adding any additional packages.  I then ran setup again to
> install a more packages that I needed for personal use or work use
> (respectively).  On all three machines the "manual" commands show nothing and
> the "auto" commands (appear to) show everything.  Its been a couple months so I
> don't remember what I manually installed on the personal machines, but the work
> machine was only 2 days ago, and I remember installing at least bc and psmisc
> (and maybe curl).  FWIW, I'm not sure if its relevant, but running setup now and
> selecting "Picked" from the drop down shows "Nothing to install or update".
> 
> Is there a log file somewhere where I can see what packages were
> installed/updated in each run of setup?

$ less /var/log/setup.log{,.full}
$ fgrep -c 'Extracting from file://' /var/log/setup.log{,.full}

setup.log.full gives the details of the last run on that installation
setup.log is the summary of all runs on that installation

> PS: I would love a way to get this listing, as it would have simplified
> installing cygwin on all 3 systems (replicating the installations on the systems
> they replaced).

There are two sources for a complete package list:

installed packages:
$ awk '3 == NF {print $1}' /etc/setup/installed.db
$ sed '1d;/\s[01]$/s/\s.*$//' /etc/setup/installed.db

package directories:
$ find <local package directory>/*tp*%3a%2f%2f*%2f/*/release/*/ -type d | \
sed 's!/$!!;s!^.*/!!' | sort -u
but this may include some non-packages, as would similar approaches.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

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

* Re: Listing only manually installed package
  2020-06-26 22:20     ` Brian Inglis
  2020-06-27  5:02       ` Cygwin
  2020-06-27  8:50       ` Yasuhiro KIMURA
@ 2020-06-28 14:12       ` Jon Turney
  2020-06-28 18:47         ` Brian Inglis
  2 siblings, 1 reply; 12+ messages in thread
From: Jon Turney @ 2020-06-28 14:12 UTC (permalink / raw)
  To: The Cygwin Mailing List

On 26/06/2020 23:20, Brian Inglis wrote:
> On 2020-06-26 12:04, Yasuhiro KIMURA wrote:
>> From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
>> Subject: Re: Listing only manually installed package
>> Date: Fri, 26 Jun 2020 11:20:26 -0600
>>
>>> $ grep '\s1$' /etc/setup/installed.db	# manual
>>> $ grep '\s0$' /etc/setup/installed.db	# auto
>>>
>>> $ awk '1 == $3' /etc/setup/installed.db	# manual
>>> $ awk '0 == $3' /etc/setup/installed.db	# auto
>>>
>>> I can't remember what the pristine state of the Base category packages are,
>>> I've messed around with the setup files so much for so long.
>>
>> I checked /etc/setup/installed.db on my 32bit and 64bit console but in
>> each case all lines end with "0". Therefore,
>>
>> From: Andrey Repin <anrdaemon@yandex.ru>
>> Subject: Re: Listing only manually installed package
>> Date: Fri, 26 Jun 2020 20:15:21 +0300
>>
>>> AFAIK, there's no way to tell if a package was manually selected or not.
>>> Cygwin's setup just don't store this information.
>>
>> As you say, unfortunately there seems to be no way to tell if a
>> package was installed manually or automatically.
> 
> Just checked the setup sources, so unless there is a bug, you are running a
> setup version over 5 years old, or not running Cygwin setup, user_picked is part
> of the package metadata that is still read from and written to installed.db.

Unfortunately, it seems there is a bug (since 2.895, 18 months ago, 
...), and this information doesn't always get recorded correctly.

Thanks for drawing my attention to this.

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

* Re: Listing only manually installed package
  2020-06-28 14:12       ` Jon Turney
@ 2020-06-28 18:47         ` Brian Inglis
  0 siblings, 0 replies; 12+ messages in thread
From: Brian Inglis @ 2020-06-28 18:47 UTC (permalink / raw)
  To: cygwin

On 2020-06-28 08:12, Jon Turney wrote:
> On 26/06/2020 23:20, Brian Inglis wrote:
>> On 2020-06-26 12:04, Yasuhiro KIMURA wrote:
>>> From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
>>> Subject: Re: Listing only manually installed package
>>> Date: Fri, 26 Jun 2020 11:20:26 -0600
>>>
>>>> $ grep '\s1$' /etc/setup/installed.db    # manual
>>>> $ grep '\s0$' /etc/setup/installed.db    # auto
>>>>
>>>> $ awk '1 == $3' /etc/setup/installed.db    # manual
>>>> $ awk '0 == $3' /etc/setup/installed.db    # auto
>>>>
>>>> I can't remember what the pristine state of the Base category packages are,
>>>> I've messed around with the setup files so much for so long.
>>>
>>> I checked /etc/setup/installed.db on my 32bit and 64bit console but in
>>> each case all lines end with "0". Therefore,
>>>
>>> From: Andrey Repin <anrdaemon@yandex.ru>
>>> Subject: Re: Listing only manually installed package
>>> Date: Fri, 26 Jun 2020 20:15:21 +0300
>>>
>>>> AFAIK, there's no way to tell if a package was manually selected or not.
>>>> Cygwin's setup just don't store this information.
>>>
>>> As you say, unfortunately there seems to be no way to tell if a
>>> package was installed manually or automatically.
>>
>> Just checked the setup sources, so unless there is a bug, you are running a
>> setup version over 5 years old, or not running Cygwin setup, user_picked is part
>> of the package metadata that is still read from and written to installed.db.
> 
> Unfortunately, it seems there is a bug (since 2.895, 18 months ago, ...), and
> this information doesn't always get recorded correctly.
> 
> Thanks for drawing my attention to this.

Thanks for spotting the bug - I missed the user_picked parameter being defaulted.

Is there any way to run setup with suitable parameters and have it set the
user_picked field in installed.db?

Or is it down to finding packages in installed.db that are roots, with no
installed packages dependent on them, according to the setup.ini
depends2/requires lists, and producing an updated installed.db?

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in IEC units and prefixes, physical quantities in SI.]

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

end of thread, other threads:[~2020-06-28 18:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-26 16:34 Listing only manually installed package Yasuhiro KIMURA
2020-06-26 17:15 ` Andrey Repin
2020-06-26 18:04   ` Yasuhiro KIMURA
2020-06-26 18:37     ` Brian Inglis
2020-06-26 22:20     ` Brian Inglis
2020-06-27  5:02       ` Cygwin
2020-06-27 17:35         ` Brian Inglis
2020-06-27  8:50       ` Yasuhiro KIMURA
2020-06-28 14:12       ` Jon Turney
2020-06-28 18:47         ` Brian Inglis
2020-06-27  7:40     ` Csaba Raduly
2020-06-26 17:20 ` Brian Inglis

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).