Re: A list of installed packages (no dependencies) -- this may help

2015-01-08 Thread Corinna Vinschen
On Jan  3 10:58, Angelo Graziosi wrote:
 Houder wrote:
 I replied to your entry in an earlier attempt, but my reply got stuck in the 
 machinery
 at sourceware.or
 
 Oh, I am afraid of this..
 
 Below (I hope) you will find a script, that may be of help to you
 
 Thanks for the scripts, I hope hope these and similar features are soon
 included in Cygwin.
 
 Maybe, I have already wrote this, Cygwin needs a true packages manager (I
 have in mind pacman, port (MacPorts, OSX), apt...), or setup/cygport should
 be transformed in that way...

Nobody keeps you from contributing to this project and make setup the
best package manager in the world.  We're only a very limited set of
people with analogue limited time for hacking so we're certainly glad
for any developer interested to invest time into this project.

This is not meant derogatory, but desperate:

  http://cygwin.com/acronyms/#SHTDI
  http://cygwin.com/acronyms/#PGA


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat


pgpoRYf6eHPe3.pgp
Description: PGP signature


Re: A list of installed packages (no dependencies) -- this may help

2015-01-03 Thread Houder
  Is there in Cygwin a command to recover a list of installed packages 
  chosen by
  the user without the dependencies?

 I replied to your entry in an earlier attempt, but my reply got stuck in the 
 machinery
 at sourceware.org (my message had a shell script and a .bat file attached).

 Below (I hope) you will find a script, that may be of help to you ...

 It computes the top vertices of the forest (i.e. the dependency graph), 
 i.e. the pkgs
 that no other pkg depends on (within the context of a specific installation 
 of Cygwin).

 The cygcheck-dep package contains a script which can find the leaves
 of the dependency graph, along with several other operations.

 Doug Henderson, Calgary, Alberta, Canada

Yup, he is right :-)

cygcheck-dep -l shows the same output as my script ...

It is all there, folks!

Henri


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



Re: A list of installed packages (no dependencies) -- this may help

2015-01-03 Thread Houder
 On Fri, Jan 2, 2015 at 7:56 PM, Houder wrote:
 It computes the top vertices of the forest (i.e. the dependency graph), 
 i.e.
 the pkgs that no other pkg depends on (within the context of a specific
 installation of Cygwin).

 In the context of a command such as apt-get autoremove, this is irrelavant.

 A command such as this would need to distinguish between packages manually
 installed and those automatically installed, regardless of where they fall on
 the dependency tree.

Oh dear ... yes, I know all that.

However, I am interested in recognizing the orphans in the top vertices, i.e.
the packages that have been installed, but are no longer of interest to me.

Perhaps the same requirement Angelo has ...

That is the reason behind my reply to A. - not to prevent you from implementing
anything you like.

Henri


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



Re: A list of installed packages (no dependencies) -- this may help

2015-01-03 Thread Doug Henderson
On 2 January 2015 at 18:56, Houder  wrote:

  Is there in Cygwin a command to recover a list of installed packages chosen 
  by
  the user without the dependencies?

 I replied to your entry in an earlier attempt, but my reply got stuck in the 
 machinery
 at sourceware.org (my message had a shell script and a .bat file attached).

 Below (I hope) you will find a script, that may be of help to you ...

 It computes the top vertices of the forest (i.e. the dependency graph), 
 i.e. the pkgs
 that no other pkg depends on (within the context of a specific installation 
 of Cygwin).


The cygcheck-dep package contains a script which can find the leaves
of the dependency graph, along with several other operations.

Doug
-- 
Doug Henderson, Calgary, Alberta, Canada

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



Re: A list of installed packages (no dependencies) -- this may help

2015-01-03 Thread Angelo Graziosi

Houder wrote:

I replied to your entry in an earlier attempt, but my reply got stuck in the 
machinery
at sourceware.or


Oh, I am afraid of this..


Below (I hope) you will find a script, that may be of help to you


Thanks for the scripts, I hope hope these and similar features are soon 
included in Cygwin.


Maybe, I have already wrote this, Cygwin needs a true packages manager 
(I have in mind pacman, port (MacPorts, OSX), apt...), or setup/cygport 
should be transformed in that way...


Ciao,
 Angelo.

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



Re: A list of installed packages (no dependencies) -- this may help

2015-01-02 Thread Steven Penny
On Fri, Jan 2, 2015 at 7:56 PM, Houder wrote:
 It computes the top vertices of the forest (i.e. the dependency graph), i.e.
 the pkgs that no other pkg depends on (within the context of a specific
 installation of Cygwin).

In the context of a command such as apt-get autoremove, this is irrelavant.

A command such as this would need to distinguish between packages manually
installed and those automatically installed, regardless of where they fall on
the dependency tree.

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



Re: A list of installed packages (no dependencies) -- this may help

2015-01-02 Thread Steven Penny
On Fri, Jan 2, 2015 at 9:59 PM, Steven Penny wrote:
 A command such as this would need to distinguish between packages manually
 installed and those automatically installed, regardless of where they fall on
 the dependency tree.

To elaborate, this is accomplished on Linux with the file

/var/lib/apt/extended_states

http://askubuntu.com/a/181544

The analog to this on Cygwin is

/etc/setup/installed.db

However this currently only tracks

- package name
- package version

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



Re: A list of installed packages (no dependencies) -- this may help

2015-01-02 Thread Houder
 Is there in Cygwin a command to recover a list of installed packages chosen by
 the user without the dependencies?

 For example, the archlinux package manager with

 pacman -Qqe  pkglist

 can save the list of package chosen by the user only and this is useful in 
 case
 one wants/needs to reinstall all the packages.

Hi Angelo,

I replied to your entry in an earlier attempt, but my reply got stuck in the 
machinery
at sourceware.org (my message had a shell script and a .bat file attached).

Below (I hope) you will find a script, that may be of help to you ...

It computes the top vertices of the forest (i.e. the dependency graph), i.e. 
the pkgs
that no other pkg depends on (within the context of a specific installation of 
Cygwin).

In my case, it reduced a list of 161 pkgs to one of only (about) 15 pkgs.

(using a .bat file - quiet-install.bat - which I will attempt to include as 
well, I
 installed Cygwin afresh and verified the result)

Of course your situation may be different from mine ... then somebody else may 
find good
use of the script.

Henri

top-sters-sh:

#!/bin/bash

# compute the top vertices of the forest (the dependency graph), i.e. the 
packages that no other package depends on.

case $(uname -s) in
*WOW64)
setup_ini='/drv/e/_cygwin_repository/http%3a%2f%2fftp.snt.utwente.nl%2fpub%2fsoftware%2fcygwin%2f/x86/setup.ini'
 ;;
*) 
setup_ini='/drv/e/_cygwin64_repository/http%3a%2f%2fftp.snt.utwente.nl%2fpub%2fsoftware%2fcygwin%2f/x86_64/setup.ini'
;;
esac

( awk '
NR == 1 { next }
{
  if ($1 ~ /-debuginfo/) next # skip -debuginfo packages
  printf %s\n, $1
}' /etc/setup/installed.db
# each 'requires: line' WILL be preceeded by a corresponding '@ package' line
awk '
/^@ /   { left = $2; next }
/^requires: / \
{
  if (left ~ /-debuginfo$/) next # skip the -debuginfo pkgs (irrelevant 
pkgs for regular users)
  printf %s, left
  for (i = 2; i = NF; ++i) {
if ($i ~ /-debuginfo$/) continue # skip any -debuginfo pkg (never 
reached)
printf  %s, $i

  }
  printf \n
} ' $setup_ini ) | sort | \
awk '
# pkg1  must be printed (even in case the following line is missing)
# pkg1 pkg2 ...
BEGIN   { pkg =  }
NF == 1 {
  if (pkg != ) { # pkg wo dependencies
printf %s\n, pkg
  }
  pkg = $1
  next
}
NF  1  {
  if (pkg == ) next
  if ($1 == pkg) {
printf %s\n, $0
  } else { # pkg wo dependencies
printf %s\n, pkg
  }
  pkg = 
} ' | \
awk '
# pkg1 [ pkg2 ... ]
{
  for (j = 1; j = NF; j++) {
# keep count of number of pkgs that depend on a pkg (for each pkg)
if ($j in ary) {
  ary[$j]++
} else {
  ary[$j] = 0
}
  }
}
END {
  for (elm in ary) {
   if (ary[elm] == 0) {
printf %s\n, elm
   }
  }
} ' | sort # sort, as arrays are indexed by string values in awk

exit #  !

# each 'requires: line' WILL be preceeded by a corresponding '@ package' line
awk '
/^@ /   { left = $2; next }
/^requires: / \
{
  if (left ~ /-debuginfo$/) next # skip the -debuginfo pkgs (irrelevant 
pkgs for regular users)
  if ($0 ~ /-debuginfo/) { # test: none of the regular packages should 
depend on a -debuginfo pkg
printf %s %s\n, left, $0
  }
} ' $setup_ini

#=

quiet-install.bat:

@echo off

e:/_cygwin64_repository/setup-x86_64 -q -L -n -N -d -M -A -a x86_64 -R 
e:/Cygwin64 -l e:/_cygwin64_repository -P ^
base-files,^
pkg,^
...
last-pkg

::=


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