Giter Site home page Giter Site logo

apt-cyg's People

Contributors

a-ueda-lab avatar aguynamedryan avatar boothj5 avatar cslycord avatar e3v3a avatar elebeaup avatar flipb avatar hashimaziz1 avatar hoshsadiq avatar jameswebb68 avatar juanpabloaj avatar koedoyoshida avatar kou1okada avatar laris avatar lucasvc avatar murazaki avatar rasa avatar resistancelion avatar sebthom avatar sieste31 avatar sukucorp avatar thexxturboxx avatar transcode-open avatar univerio avatar yak1ex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

apt-cyg's Issues

calls cmd.exe directly without checking that it is in PATH

If /cygdrive/c/Windows/System32 is not in PATH, the dist-upgrade functionality doesn't fully work.

In the get_codepage function, the script directly calls cmd.exe without making sure that its directory is in PATH So the multiple calls to checking for codepage don't work.

After that, it's able to still run the setup.exe since but it hangs at the "ending cygwin install" part that is run inside a cmd DOS window.

Add some badges to README

I suggest to add the following to the top of the README.
(Did not send you a new PR yet, until you merge what I already sent.)

## apt-cyg

[![GitHub last commit](https://img.shields.io/github/last-commit/kou1okada/apt-cyg.svg)](https://github.com/kou1okada/apt-cyg)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/kou1okada/apt-cyg/graphs/commit-activity)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/kou1okada/apt-cyg.svg)](http://isitmaintained.com//project/kou1okada/apt-cyg "Average time to resolve an issue")


**`apt-cyg`** is your friendly [Cygwin](http://cygwin.com/) package manager. The syntax is similar to *apt-get* and is a feature improved wrapper to the native Cygwin `setup.exe`.


| STATUS: | Version | Date | Maintained? |
|:------- |:------- |:---- |:----------- |
| Working | `1.0.58` | 2018-11-22 | YES |

---


Then add the following to the bottom of your README:

#### Forks on the github

See [other_forks.md](other_forks.md)

#### Todo

- [ ] Support multi mirrors: Cygwin setup can use multi mirrors. They are recorded at last-mirror section in '/etc/setup/setup.rc'. It's useful for using [Cygwinports](http://cygwinports.org/).
- [ ] Support upgrade: But maybe, busy resources can not be upgraded, and rebase problem will happen. Cygwin setup resolves by replacing them at next reboot.
- [ ] Support dependency check for remove subcommand.

#### Known Problems

For older known problems see: [**`known problems`**](known_problems.md)

---

#### Credits

Most grateful thanks to:
* [---](https://github.com/---/) - for clarifying and fixing XXXX

---

#### License

[![GitHub license](https://img.shields.io/github/license/kou1okada/apt-cyg.svg)](https://github.com/kou1okada/apt-cyg/blob/master/LICENSE) 
A license to :sparkling_heart:!

Bad signature error when updating setup files

$ apt-cyg install nano
Cache directory is /setup
Mirror is http://cygwin.mirror.constant.com
/tmp/tmp.NVpSEndUWV           100%[================================================>]   1.29K  --.-KB/s    in 0s
2017-09-29 12:37:15 URL:https://cygwin.com/key/pubring.asc [1324/1324] -> "/tmp/tmp.NVpSEndUWV" [1]
TRUSTEDKEY_CYGWIN: OK
/tmp/tmp.NVpSEndUWV           100%[================================================>]   1.66K  --.-KB/s    in 0s
2017-09-29 12:37:16 URL:http://cygwinports.org/ports.gpg [1702/1702] -> "/tmp/tmp.NVpSEndUWV" [1]
TRUSTEDKEY_CYGWINPORTS: OK
Updating setup.ini
setup.bz2                     100%[================================================>]   2.64M   384KB/s    in 7.0s
2017-09-29 12:37:23 URL:http://cygwin.mirror.constant.com/x86_64/setup.bz2 [2767026/2767026] -> "setup.bz2" [1]
setup.bz2.sig                 100%[================================================>]      72  --.-KB/s    in 0s
2017-09-29 12:37:24 URL:http://cygwin.mirror.constant.com/x86_64/setup.bz2.sig [72/72] -> setup.bz2.sig" [1]
Error: BAD signature: setup.bz2.sig
setup.ini                     100%[================================================>]  10.25M  1.07MB/s    in 8.7s
2017-09-29 12:37:33 URL:http://cygwin.mirror.constant.com/x86_64/setup.ini [10752852/10752852] -> "setup.ini" [1]
setup.ini.sig                 100%[================================================>]      72  --.-KB/s    in 0s
2017-09-29 12:37:33 URL:http://cygwin.mirror.constant.com/x86_64/setup.ini.sig [72/72] -> "setup.ini.sig" [1]
Error: BAD signature: setup.ini.sig
Error: updating setup.ini, reverting.

It used to work in the beginning and then it stopped after few usages.

Was the category subcommand removed?

I just downloaded the latest version of apt-cyg, and I noticed that category is listed as a subcategory:

category <category>      : List all packages in given <category>.

but trying to use it results in the following error:

$ apt-cyg category games
cat: '': No such file or directory

I then looked at README.md, and sure enough it seems that the category subcommand is not in there. Was this feature removed from the program, and if so, why?

I was hoping to be able to use it to remove all installed packages of a given category, maybe with something like:

apt-cyg category games | apt-cyg remove

Feature request: autoremove

When marking packages as "automatically installed", through apt-cyg mark-auto, I can't figure out a way run an equivalent of apt autoremove to get rid of the packages that are not required by any "manually installed" package.

Is there some equivalent of apt remove --autoremove <pkg> (or apt-mark auto <pkg> && apt autoremove) with apt-cyg?

Removing orphaned auto-packages

Hi. I was wondering if apt-cyg has a way to assist with removing unneeded packages -- packages installed automatically for which all dependent packages installed manually have been removed. I saw the item on the todo list that says "Support dependency check for remove subcommand." but I wasn't sure if that was referring to this or to disallowing removal of a package which is still needed. Is there at least a way to tell apt-cyg to list the unneeded packages which could be fed to apt-cyg remove? Thanks

Please clarify the function of the following commands

@kou1okada

There are a number of commands which is not at all clear what they are doing or what their purpose is.
They are:

completion-install # to install completion (of what??)
packages-total-size [PATTERN_OF_SECTION]
show-packages-busyness PACKAGE_NAMES
get-proxy

I have no idea what you mean here: Busyness of what??

problem with double cygwin install to different directory

when i install double cygwin to different directory, with different root-dir and different local-package-dir for test, then i found a problem, the output of apt-cyg dist-upgrade show that local-package-dir point to the same dir

then i modified line 1485 as :

local setup=( ".\${SETUP_EXE}" -R "$(cygpath -wa /)" -B -q -n -g -l "$(cygpath -wa "$(apt-cyg-pathof cache)")" )

could resolve this problem, but why ?

sorry for my pool english.

homepage: command not found

can't use backquotes in the here document

          web [<package names> ...] :
                                     Synonym for `homepage`.
apt-cyg: line 171: homepage: command not found
...
web [<package names> ...] :
                             Synonym for .

Avoid domain user lookups

I remember my tar invokations took inordinate amount of time because Cygwin's user lookup would go on and search for the user name by the ID in the Active Directory for each entry of a tar ball. Perhaps using tar --numeric-owner could speed things up.

Consider making pip and native setup package for easy install

Perhaps totally overkill, but it would be cools to have this script wrapped up into a package to increase visibility and popularity.

We could warp it up in 2 different places.

  1. As a native Cygwin setup package (seem a bit ugly though)
  2. As a Python pip package! 👍 (Yes, you'd need python already installed, but I think most already has this.)

How to read output of depends

I'm trying to find out what dependencies I need to compile in order to get a particular package working, but I'm not sure how how exactly the command works or how to read its output:

$ apt-cyg depends mingw64-x86_64-libass
PKGNAME                                  AVAIL  SHALLOW DEEP
libgcc1                                  1      6       12
cygwin                                   1      4       12
tzdata                                   1      6       11
terminfo                                 1      11      11
libstdc++6                               1      11      11
libintl8                                 1      4       11
bash                                     1      4       11
tzcode                                   1      10      10
libncursesw10                            1      10      10
libiconv2                                1      4       10
libgmp10                                 1      4       10
libattr1                                 1      10      10
libreadline7                             1      8       9
libpkgconf3                              1      9       9
coreutils                                1      9       9
zlib0                                    1      4       8
pkgconf                                  1      8       8
liblzma5                                 1      8       8
libglib2.0_0                             1      5       8
pkg-config                               1      5       7
libxml2                                  1      7       7
gamin                                    1      7       7
shared-mime-info                         1      6       6
mingw64-x86_64-winpthreads               1      4       6
mingw64-x86_64-pkg-config                1      2       6
mingw64-x86_64-gcc-core                  1      3       6
libpcre1                                 1      6       6
libmpfr6                                 1      4       6
libmpfr4                                 1      4       6
libmpc3                                  1      4       6
libisl15                                 1      4       6
libisl13                                 1      4       6
libffi6                                  1      6       6
libfam0                                  1      6       6
gsettings-desktop-schemas                1      6       6
desktop-file-utils                       1      6       6
mingw64-x86_64-zlib                      1      4       5
mingw64-x86_64-win-iconv                 1      2       5
mingw64-x86_64-headers                   1      5       5
mingw64-x86_64-gcc-g++                   1      5       5
mingw64-x86_64-windows-default-manifest  1      4       4
mingw64-x86_64-runtime                   1      4       4
mingw64-x86_64-pcre                      1      4       4
mingw64-x86_64-libpng                    1      4       4
mingw64-x86_64-libffi                    1      4       4
mingw64-x86_64-gettext                   1      4       4
mingw64-x86_64-bzip2                     1      4       4
mingw64-x86_64-binutils                  1      4       4
mingw64-x86_64-glib2.0                   1      3       3
mingw64-x86_64-freetype2                 1      2       3
mingw64-x86_64-expat                     1      3       3
mingw64-x86_64-harfbuzz                  1      2       2
mingw64-x86_64-fribidi                   1      2       2
mingw64-x86_64-fontconfig                1      2       2
mingw64-x86_64-libass                    1      1       1

What do the AVAIL, SHALLOW AND DEEP columns mean, and what's the significance of the numbers in them?

get_codepage returns invalid codepage

I used the --use-setuprc option which calls cp2utf8 (why?) -> get_codepage. The current version of get_codepage on my Windwos XP SP3 system returns "CP850." (note the closing period) because chcp outputs "Aktive Codepage: 1252." I corrected the comman within get_codepage to ...
cmd.exe /c chcp | sed 's/^.: ([^.]).*$/\1/'
... and hope you can fix it the issue this way or another.

Regards, Martin

Use original Cygwin setup preferences and repo folder

I started using this fork of apt-cyg that gives me everything I needed and more. However, I noticed that it downloads a new installer and uses a different hardcoded /setup folder instead of the one followed by the cygwin original installer. Is there a specific reason why it was decided to "hardcode" the setup directory instead of following the cygwin convention? If not, take it as a suggestion for a future improvement.

Thanks for your work on this tool. :)

Could not download publickey

I just installed apt-cyg on a fresh installation of cygwin but now it cannot download the publickey.
But I can go to that url in my browser and it resolves
Log:

Cache directory is /setup
Mirror is http://ftp.jaist.ac.jp/pub/cygwin
/tmp/tmp.3qu9rodpCA: No such file or directory
TRUSTEDKEY_CYGWIN: FAILED: Could not download https://cygwin.com/key/pubring.asc.
Error: Could not download TRUSTEDKEY_CYGWIN.

Question: apt-cyg install (previous version)

Just a question.

When i do apt-cyg find openssh I only get the option to install the current version of 8.0 but i would really like to install 7.9

Is it possible to install a previous version of some app like in the setup.exe does?

I cannot seem to figure out how to do this or if it is possible.

apt-cyg showinfo <package names>

Attaching a patch from the original apt-cyg that will show package description for the given packages.

--- /usr/local/bin/apt-cyg	2019-06-05 10:09:57.519749400 +0530
+++ apt-cyg	2019-06-05 17:56:32.650265400 +0530
@@ -188,6 +188,8 @@
 	  key-list                 : to list keys
 	  key-finger               : to list fingerprints
 	  upgrade-self             : to upgrade apt-cyg
+	  showinfo <package names> ... :
+	                             to show description for packages
 	  depends <package names> ... :
 	                             to show forward dependency information
 	                             for packages with depth.
@@ -1233,7 +1235,7 @@
   subcmd="$( "${getsubcmd[@]}" )"
   
   case "$subcmd" in
-    install|depends|rdepends|describe|find)
+    install|depends|rdepends|describe|find|showinfo)
       COMPREPLY=( $(awk '/^@ /{print $2}' "$(apt-cyg pathof setup.ini)") )
       ;;
     remove)
@@ -2192,6 +2194,28 @@
   done
 }
 
+function apt-cyg-showinfo ()
+{
+  local pkg
+  
+  checkpackages "$@"
+  findworkspace
+  getsetup
+  for pkg do
+    (( notfirst++ )) && echo
+    awk '
+    $1 == query {
+      print
+      fd++
+    }
+    END {
+      if (! fd)
+      print "Unable to locate package " query
+    }
+    ' RS='\n\n@ ' FS='\n' query="$pkg" setup.ini
+  done
+}
+
 function apt-cyg-packageof ()
 {
   if [ -z "$OPT_AG" ]; then

Can't create '\\\\?\\C:\\usr\\bin\\free.exe'

I tried to remedy the famous NULL SID with

sed -i -e 's/user/user,noacl,exec/g' /etc/fstab

Now all installations seemingly point to the wrong path. The cygwin prefix is missing. My root is c:/cygwin

wget https://raw.githubusercontent.com/kou1okada/apt-cyg/master/apt-cyg
install apt-cyg /bin

apt-cyg install procps-ng
...
ash_check: sha512sum: procps-ng-4.0.3-1.tar.zst: OK
Unpacking...
x usr/bin/free.exe: Can't create '\\\\?\\C:\\usr\\bin\\free.exe'
x usr/bin/pgrep.exe: Can't create '\\\\?\\C:\\usr\\bin\\pgrep.exe'                                     
x usr/bin/pidof.exe: Can't create '\\\\?\\C:\\usr\\bin\\pidof.exe'
x usr/bin/pkill.exe: Can't create '\\\\?\\C:\\usr\\bin\\pkill.exe'
x usr/bin/pmap.exe: Can't create '\\\\?\\C:\\usr\\bin\\pmap.exe'
...
...
x usr/share/man/uk/man8/vmstat.8.gz: Can't create '\\\\?\\C:\\usr\\share\\man\\uk\\man8\\vmstat.8.gz'     
tar.exe: Error exit delayed from previous errors.    
Package procps-ng requires the following packages, installing:
...

This is no problems

touch /usr/bin/test

dev@win ~
$ ls /cygdrive/c/cygwin/bin/test
/cygdrive/c/cygwin/bin/test

mount
C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)

I tried

apt-cyg repair-acl

I believe fstab is restored after this failure maybe it's still wrong??

cat /etc/fstab
# This is default anyway:
none /cygdrive cygdrive binary,posix=0,user 0 0

How do I restore my cygwin prefix to c:/cygwin so it doesn't try to unpack everything in c:/

It already is correct in the registry

C:\Users\dev>reg query HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup /v rootdir

HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
    rootdir    REG_SZ    c:\cygwin

Now a different error don't know why

apt-cyg install tree
hash_check: sha512sum: tree-1.7.0-1.tar.xz: OK
Unpacking...

It just hangs at unpacking. Stalls endlessly. Is it the install command that doe something? Should I manually mv chmod?

Bug in category subcommand

"apt-cyg Category Base" also lists the following packages which are not in Category: Base.

perl-MIME-Base32
perl-POD2-Base
perl-Test-Base
perl-XML-SAX-Base

Error when install a package

I install nano with command
$ apt-cyg install nano
And i had a error
gpgv: can't hash datafile: file open error
Error: BAD signature: setup.bz2.sig
Pls, help me. Thanks a lot.

apt-cyg should check if required executables are provided by cygwin itself

I have GnuPG installed in C:\Program Files which is picked up by apt-cyg if gnupg is not available from within cygwin. This causes apt-cyg to fail, since the external gpg.exe is not aware of cygwin's System V folder structure.

apt-cyg should check during the initial check whether the tools required are provided by cygwin itself.

Installing specific version of the

I am trying to install gcc:

$ cygcheck -p bin/gcc
Found 10 matches for bin/gcc
gcc-core-10.2.0-1 - gcc-core: GNU Compiler Collection (C, OpenMP)
gcc-core-11.2.0-0 - gcc-core: GNU Compiler Collection (C, OpenMP)
gcc-core-11.2.0-1 - gcc-core: GNU Compiler Collection (C, OpenMP)
gcc-core-7.4.0-1 - gcc-core: GNU Compiler Collection (C, OpenMP)
gcc-core-9.3.0-2 - gcc-core: GNU Compiler Collection (C, OpenMP)
gcc-debuginfo-10.2.0-1 - gcc-debuginfo: Debug info for gcc
gcc-debuginfo-7.4.0-1 - gcc-debuginfo: Debug info for gcc
gcc-debuginfo-9.3.0-2 - gcc-debuginfo: Debug info for gcc
gccmakedep-1.0.2-1 - gccmakedep: X Makefile dependency tool for GCC (installed binaries and support files)
gccmakedep-1.0.3-1 - gccmakedep: X Makefile dependency tool for GCC (installed binaries and support files)

So I try to put the whole name into command line:

$ apt-cyg install gcc-core-10.2.0-1 2>&1 | tail
gpg: Signature made Fri Dec 24 15:52:56 2021 EET using RSA key ID E2E56300
gpg: Good signature from "Cygwin <[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 5640 5CF6 FCC8 1574 682A  5D56 1A69 8DE9 E2E5 6300
signature verified: setup.ini.sig
Updated setup.ini

Installing gcc-core-10.2.0-1
Package gcc-core-10.2.0-1 not found or ambiguous name, exiting

As the format seems to be wrong, I try another format -- now using = before the version:

$ apt-cyg install gcc-core=10.2.0-1 2>&1 | tail
gpg: Signature made Fri Dec 24 15:52:56 2021 EET using RSA key ID E2E56300
gpg: Good signature from "Cygwin <[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 5640 5CF6 FCC8 1574 682A  5D56 1A69 8DE9 E2E5 6300
signature verified: setup.ini.sig
Updated setup.ini

Installing gcc-core=10.2.0-1
Package gcc-core=10.2.0-1 not found or ambiguous name, exiting

But it also fails.
Can this be fixed, please?


Now if I try pointing the latter format to the Cygwin installer:

$ Downloads/setup-x86_64.exe -P gcc-core=9.3.0-2
note: Hand installation over to elevated child process.

... it parses this fine and goes forward:
image

Improved mirrors-list

Incredibly enough, after over 5 years of Win10 existence, I still end up installing and using Cygwin on every Win10 installation. Not great, nor ideal, but certainly easier and more reliable than WSL.

So I suggest to improve the apt-cyg mirrors-list to use the column built-in.

cd /etc/setup/
cat setup.rc | sed -z 's/.*mirrors-lst//; s/chooser_window_settings.*//' |column -t -s ";"
# OR using grep
cat setup.rc | grep -zoP '(?<=mirrors-lst)(?s).*(?=chooser_window_settings)' |column -t -s ";"

        http://cygwin.mirror.constant.com/                                      cygwin.mirror.constant.com     United States  New Jersey
        http://cygwin.mirrors.hoobly.com/                                       cygwin.mirrors.hoobly.com      United States  Pennsylvania
        http://mirrors.koehn.com/cygwin/cygwin-ftp/                             mirrors.koehn.com              United States  Missouri
        http://mirrors.metapeer.com/cygwin/                                     mirrors.metapeer.com           United States  Washington
        http://mirror.team-cymru.com/cygwin/                                    mirror.team-cymru.com          United States  Illinois
        ftp://mirrors.xmission.com/cygwin/                                      mirrors.xmission.com           United States  Utah
        http://mirrors.xmission.com/cygwin/                                     mirrors.xmission.com           United States  Utah
        http://mirror.clarkson.edu/cygwin/                                      mirror.clarkson.edu            United States  New York
        http://mirror.cs.vt.edu/pub/cygwin/cygwin/                              mirror.cs.vt.edu               United States  Virginia
        http://mirror.koddos.net/cygwin/                                        mirror.koddos.net              Europe         Netherlands
        http://mirror-hk.koddos.net/cygwin/                                     mirror-hk.koddos.net           Asia           Hong Kong
        ftp://mirrors.netix.net/cygwin/                                         mirrors.netix.net              Europe         Bulgaria
        http://mirrors.netix.net/cygwin/                                        mirrors.netix.net              Europe         Bulgaria
...

Because people want to see which repo is closer to them.

Question: Any reason to use non-standard placeholder formatting?

@kou1okada
I really like the new formatting for the "help" options, but I am wondering why you prefer to use the non-standard way for showing place holders?

The standard for most help or usage is to use <blahblah> for placeholders and [<options>] for optional options. But you want to use SOMETHING which is commonly used for designating constants, in most languages including BASH.

install PACKAGE_NAMES` |  to install packages 

Why?

apt-cyg install issues - Cygwin 3.1.2

I am seeing this whenever attempting to install a program.

$ apt-cyg install lftp
iconv: conversion from CP20127 unsupported
iconv: try 'iconv -l' to get the list of supported encodings
iconv: conversion from CP20127 unsupported
iconv: try 'iconv -l' to get the list of supported encodings
cygpath: can't convert empty path
Cache directory is
Mirror is
iconv: conversion from CP20127 unsupported
iconv: try 'iconv -l' to get the list of supported encodings
Updating setup.ini
/x86_64/setup.bz2: Scheme missing.
/x86_64/setup.ini: Scheme missing.
Error: updating setup.ini failed, reverting.
at : /usr/local/bin/apt-cyg: setupini_download: 546

Installing lftp
awk: cmd. line:1: fatal: cannot open file `setup.ini' for reading (No such file or directory)
Found package lftp
Could not find "install" in package description: obsolete package?

apt-cyg hangs

Hi,

I recently did a dist-upgrade and ever since apt-cyg hangs and I can't seem to understand why. Almost all comands hang without output.

What I did:

  • update all cygwin packages using setup
  • update apt-cyg using git reset --hard, git pull

Debug (I ran using bash -x)

+ TRUSTEDKEYS=(CYGWIN CYGWINPORTS)
+ TRUSTEDKEY_CYGWIN_SUM=e6630b94e6bf1afcc1b1054afa9994a423764d795b2a3a5e831fc658962905dcadf63c3a29155136f3138d6375176c9384de68d12a6dd4dde35b55c9b225cd7f
+ TRUSTEDKEY_CYGWIN_FPR=1169DF9F22734F743AA59232A9A262FF676041BA
+ TRUSTEDKEY_CYGWIN_URL_LATEST=https://cygwin.com/key/pubring.asc
+ TRUSTEDKEY_CYGWINPORTS_SUM=ccf174d1e6ec20e50ff954e3d4a0c3de478032a100d26789c0190587ae80128e842ff5404ed3b48f8693c8803c88a3acbf8dca339edfdaab0f3c247fb6091e42
+ TRUSTEDKEY_CYGWINPORTS_FPR=45600BB98CA878AA97A70119FF20AF9A66EE1F94
+ TRUSTEDKEY_CYGWINPORTS_URL_LATEST=http://cygwinports.org/ports.gpg
+ ((  5 <= 0  ))
++ which wget
+ WGET=/usr/bin/wget
++ which tar
+ TAR=/usr/bin/tar
++ which awk
+ GAWK=/usr/bin/awk
++ which gpgv
+ GPGV=/usr/bin/gpgv
++ which gpg
+ GPG=/usr/bin/gpg
+ '[' -z /usr/bin/wget -o -z /usr/bin/tar -o -z /usr/bin/awk ']'
+ PACKAGE_DB=/etc/setup/installed.db
+ PACKAGEOF_CACHE=/tmp/.apt-cyg-packageof.cache.gz
+ PROGRESS_CHAR=("=" "-" "/" "|" "\\")
+ LESSER_PARALLEL_MAX_JOBS=8
+ noscripts=0
+ OPT_USER_PICKED=1
+ noupdate=0
+ OPT_FILES=()
+ SUBCOMMAND=
+ ignore_case=
+ force_remove=
+ force_fetch_trustedkeys=
+ no_verify=
+ OPT_PROXY=auto
+ OPT_PROXY_REFRESH_INTERVAL=86400
+ OPTS4INHERIT=()
++ current_cygarch
++ arch
++ sed -e 's/^i686$/x86/g'
+ SETUP_EXE=setup-x86_64.exe
+ YES_TO_ALL=false
+ INITIAL_ARGS=("$@")
+ ARGS=()
+ parse_args update
+ local unknown_option END_OPTS
+ '[' 1 -gt 0 ']'
+ case "$1" in
+ '[' -z '' ']'
+ SUBCOMMAND=update
+ shift
+ '[' 0 -gt 0 ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' -n '' ']'
+ '[' 0 -gt 0 ']'
+ : 1
+ '[' -n '' ']'
+ '[' 0 -gt 0 ']'
+ '[' 0 -gt 0 ']'
+ '[' -z /usr/bin/gpgv -a -z '' ']'
+ wget --help
+ grep -- --show-progress
+ HAVE_SHOW_PROGRESS=--show-progress
+ wget --help
+ grep -- --no-verbose
+ HAVE_NO_VERBOSE=--no-verbose
+ ((  1 < 0  ))
+ ((  1 < 1  ))
+ ((  1 < 2  ))
+ WGET+=($HAVE_NO_VERBOSE $HAVE_SHOW_PROGRESS)
++ verbosefor 0
++ ((  1 < 0  ))
++ echo /dev/stderr
+ verbosefor0=/dev/stderr
++ verbosefor 1
++ ((  1 < 1  ))
++ echo /dev/stderr
+ verbosefor1=/dev/stderr
++ verbosefor 2
++ ((  1 < 2  ))
++ echo /dev/null
+ verbosefor2=/dev/null
++ verbosefor 3
++ ((  1 < 3  ))
++ echo /dev/null
+ verbosefor3=/dev/null
++ verbosefor 4
++ ((  1 < 4  ))
++ echo /dev/null
+ verbosefor4=/dev/null
++ verbosefor 5
++ ((  1 < 5  ))
++ echo /dev/null
+ verbosefor5=/dev/null
+ '[' -n '' ']'
++ which apt-cyg
+ SCRIPT_PATH=/usr/local/bin/apt-cyg
+ SCRIPT_FILE=apt-cyg
+ SCRIPT_NAME=apt-cyg
+ SCRIPT_DIR=/usr/local/bin
+++ which apt-cyg
++ realpath /usr/local/bin/apt-cyg
+ SCRIPT_REALPATH=/usr/local/src/apt-cyg/apt-cyg
+ SCRIPT_REALFILE=apt-cyg
+ SCRIPT_REALNAME=apt-cyg
+ SCRIPT_REALDIR=/usr/local/src/apt-cyg
+ proxy_setup
+ case "$OPT_PROXY" in
+ proxy_auto
++ ipconfig
++ md5sum -b
++ awk '{print $1}'
+ local hash=431f8323bb58d73ca1aa5f51dedfacf0
+ local cache=/tmp/apt-cyg.proxy.431f8323bb58d73ca1aa5f51dedfacf0
++ stat -c %Y /tmp/apt-cyg.proxy.431f8323bb58d73ca1aa5f51dedfacf0
+ local last=
++ date +%s
+ local now=1496129676
+ local proxy
+ '[' -n '' ']'
+ ((  (now - 0) < OPT_PROXY_REFRESH_INTERVAL  ))
++ /usr/bin/wget --no-verbose --show-progress --no-proxy -q -O - wpad/wpad.dat
++ grep PROXY
++ sed -e 's/^.*PROXY\s*\([^"]*\).*$/http:\/\/\1/g'

The dependencies cannot be solved.

@jarnosz reported this problem at issue #88 comment 1287576006.

This is because the requires: field is gone from the setup.ini.
It seems that is replaced by depends2: field.
The setup.ini specifications may have changed.

$ cat "$(apt-cyg pathof setup.ini)" | grep -Ei "^(requires|depend.*):" | awk '$0=$1' | sort | uniq -c
  23687 depends2:

updating setup.ini failed

Hi

On a new cygwin installation i get this error when trying to use apt-cyg:

> apt-cyg update
/usr/local/bin/apt-cyg: line 424: C:/Windows/system32/cmd.exe: Bad address
iconv: conversion from -t unsupported
iconv: try 'iconv -l' to get the list of supported encodings
cygpath: can't convert empty path
/usr/local/bin/apt-cyg: line 545: declare: last_cache: not found
/usr/local/bin/apt-cyg: line 545: declare: last_mirror: not found
Cache directory is
Mirror is
Updating setup.ini
/x86_64/setup.zst: Scheme missing.
/x86_64/setup.zst.sig: Scheme missing.
/x86_64/setup.xz: Scheme missing.
/x86_64/setup.xz.sig: Scheme missing.
/x86_64/setup.bz2: Scheme missing.
/x86_64/setup.bz2.sig: Scheme missing.
/x86_64/setup.ini: Scheme missing.
/x86_64/setup.ini.sig: Scheme missing.
Error: updating setup.ini failed, reverting.
at : /usr/local/bin/apt-cyg: setupini_download: 636

It seems to me that apt-cyg can't find the cache and mirror directories and that causes the setup.ini creation to fail.

Any idea?

No warning given if mirror is unofficial

Currently, apt-cyg is set up on my computer to use ftp://ftp.kr.freebsd.org/pub/cygwin.com/cygwin for its mirror.

Upon running dist-upgrade, the installer warned me that the above mirror is not an official one. It used to be an official one, but recently has been removed from the list and looks like its setup files haven't been updated for several days (where the official mirrors have stuff updated yesterday).

IMO, it would be a good idea to check if the mirror is a current official one and give a warning otherwise.

Thanks.

Output capping [enhancement]

When the output is too long to display, most of the linux systems promt to read further instead of outputting all at once, but this logic is not implemented in cygwin, which leads to output capping

Example of executing apt-cyg find perl:
image
image

Set default installation path to /usr/bin or /usr/local/bin path

Hi @kou1okada . Thank you so much for continuing to support this great tool.

I wrote ScoopInstaller/Main#1331 because I was having issues with my path installation of packages. I've been using Cygwin using scoop and your tool and noticed that my packages were not installing to /usr/bin and instead were installing to /cygdrive/c/Users/user/scoop/persist/cygwin/root/usr/bin/.

Is there a way to set a default install path for apt-cyg ? Could there be a misconfiguration in the ScoopInstaller/Main's cygwin.json that is causing packages to be installed in that directory vs /usr/bin ?

Thanks

Set timeout limit for mirror benchmark?

I'm trying to write a little script to automatically choose the fastest mirror, but the benchmark subcommand takes forever to complete because there are so many mirrors in so many far away places. It would be extremely helpful if I could set a timeout limit for the benchmark-parallel-mirrors-list subcommand in order to quickly determine the best available mirror. Does this functionality already exist? (I don't see any info on it). If it doesn't exist, I would like to request that it be added

Bad GPG signature warnings again

Hi,

Had to grab Cygwin for development purposes on Windows and noticed that this was among the most up-to-date forks of apt-cyg. However, the GPG signatures are broken, once again (this seems to have been the problem years ago already, i.e. #25 ) :

gpg: assuming signed data in `setup.bz2'
gpg: Signature made Mon Jul  5 21:04:09 2021 IDT using RSA key ID E2E56300
gpg: Good signature from "Cygwin <[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 5640 5CF6 FCC8 1574 682A  5D56 1A69 8DE9 E2E5 6300

I found only one reference to the RSA key ID and it too seemed to have originated from the odditudes of Cygwin itself. [ Link ]

All help/advice appreciated. Thanks.

How to update a package?

I come here from transcode-open#22 where they said this support package upgrade, but they did not said how it can upgrade a package.

Look at help, I can only find a option to upgrade all packages:

  dist-upgrade             : to upgrade all packages that is installed.
                             This subcommand uses setup.exe

Currently I have gcc 7.3 instead, but I just saw there is gcc 8 available: https://cygwin.com/packages/summary/gcc-g++.html

What is the command to update gcc from 7.3 to 8?

I already tried just running apt-cyg install gcc-g++, but the gcc version still the same:

Professional@PROFESSIONAL-PC$ apt-cyg install gcc-g++

Cache directory is /.pkg-cache
Mirror is http://cygwin.mirror.constant.com
Updating setup.ini
--2019-12-26 23:17:28--  http://cygwin.mirror.constant.com/x86_64/setup.bz2
Resolving cygwin.mirror.constant.com (cygwin.mirror.constant.com)... 108.61.5.83
Connecting to cygwin.mirror.constant.com (cygwin.mirror.constant.com)|108.61.5.83|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘setup.bz2’ not modified on server. Omitting download.

--2019-12-26 23:17:28--  http://cygwin.mirror.constant.com/x86_64/setup.bz2.sig
Resolving cygwin.mirror.constant.com (cygwin.mirror.constant.com)... 108.61.5.83
Connecting to cygwin.mirror.constant.com (cygwin.mirror.constant.com)|108.61.5.83|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘setup.bz2.sig’ not modified on server. Omitting download.

gpg: assuming signed data in `setup.bz2'
gpg: Signature made Thu, Dec 26, 2019 19:15:06 ESAST using DSA key ID 676041BA
gpg: Good signature from "Cygwin <[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 1169 DF9F 2273 4F74 3AA5  9232 A9A2 62FF 6760 41BA
signature verified: setup.bz2.sig
--2019-12-26 23:17:30--  http://cygwin.mirror.constant.com/x86_64/setup.ini
Resolving cygwin.mirror.constant.com (cygwin.mirror.constant.com)... 108.61.5.83
Connecting to cygwin.mirror.constant.com (cygwin.mirror.constant.com)|108.61.5.83|:80... connected.
HTTP request sent, awaiting response... 200 OK
Server ignored If-Modified-Since header for file ‘setup.ini’.
You might want to add --no-if-modified-since option.

--2019-12-26 23:17:30--  http://cygwin.mirror.constant.com/x86_64/setup.ini.sig
Resolving cygwin.mirror.constant.com (cygwin.mirror.constant.com)... 108.61.5.83
Connecting to cygwin.mirror.constant.com (cygwin.mirror.constant.com)|108.61.5.83|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘setup.ini.sig’ not modified on server. Omitting download.

gpg: assuming signed data in `setup.ini'
gpg: Signature made Thu, Dec 26, 2019 19:15:01 ESAST using DSA key ID 676041BA
gpg: Good signature from "Cygwin <[email protected]>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 1169 DF9F 2273 4F74 3AA5  9232 A9A2 62FF 6760 41BA
signature verified: setup.ini.sig
Updated setup.ini
Package gcc-g++ is already installed, skipping
Professional@PROFESSIONAL-PC$

/usr/bin/apt-cyg: line 324: /dev/fd/62: Not a directory

user@pc ~
$ apt-cyg dist-upgrade
Kill all cygwin process and start dist-upgrade.
/usr/bin/apt-cyg: line 324: /dev/fd/62: Not a directory
Are you sure ? [y/N] y
Are you sure ? [y/N] y
Are you sure ? [y/N] y
Are you sure ? [y/N] y
Are you sure ? [y/N] y
Are you sure ? [y/N] y
Are you sure ? [y/N] N
Are you sure ? [y/N]

I have to control c, doesn't work

user@pc ~
$ uname -a
CYGWIN_NT-10.0 twl-pc 2.7.0(0.306/5/3) 2017-02-12 13:18 x86_64 Cygwin
user@pc ~
$ apt-cyg --version
apt-cyg version 0.57
Written by Stephen Jungels

Copyright (c) 2005-9 Stephen Jungels.  Released under the GPL.
user@pc ~
$ vim /usr/bin/apt-cyg

 315
 316 # Usage: ask_user [MESSAGE [OPTIONS]]
 317 function ask_user ()
 318 {
 319   local answer retcode option
 320   local MESSAGE="$1"
 321   local OPTIONS="${2:-y/N}"
 322   local DEFAULT="$(echo "$OPTIONS" | awk -v FS=/ '{for(i=1;i<=NF;i++)if(match(substr($i,1,1),/[A-Z]/)){print $i; exit}}')"
 323   local SPLIT_OPTIONS
 324   readarray -t SPLIT_OPTIONS < <(echo "$OPTIONS" | sed -e 's:/:\n:g')
 325   while true; do
 326     echo -n "${MESSAGE}${MESSAGE:+ }[${OPTIONS}] "
 327     read answer
 328     retcode=0
 329     for option in "${SPLIT_OPTIONS[@]}"; do
 330       if [ "$option" = "${answer:-$DEFAULT}" ]; then
 331         return $retcode
 332       fi
 333       retcode=$(( retcode + 1 ))
 334     done
 335   done
 336 }
 337

New command - findall

Hello,

I have added a new command findall which lists all packages available in setup.ini. Patch is as follows:

--- apt-cyg	2019-01-11 17:59:14.765675100 +0530
+++ apt-cyg-mod	2019-01-16 10:28:18.448664400 +0530
@@ -77,6 +77,7 @@
 	  update                   : to update setup.ini
 	  show                     : to show installed packages
 	  find <patterns> ...      : to find packages matching patterns
+	  findall                  : to find all packages
 	  describe <patterns> ...  : to describe packages matching patterns
 	  packageof <command or file names> ... :
 	                             to locate parent packages
@@ -924,7 +925,7 @@
   subcmd="\$( "\${getsubcmd[@]}" )"
   
   case "\$subcmd" in
-    install|depends|rdepends|describe|find)
+    install|depends|rdepends|describe|find|findall)
       COMPREPLY=( \$(awk '/^@ /{print \$2}' "$(apt-cyg pathof setup.ini)") )
       ;;
     remove)
@@ -1842,6 +1843,17 @@
 }
 
 
+function apt-cyg-findall ()
+{
+  findworkspace
+  getsetup
+  
+  echo ""
+  echo "Searching for all available packages:"
+  sed '1,/^setup-version:/d' setup.ini | awk 'BEGIN{RS="\n@ "; FS="\n"; ORS="\n"} {{print $1}}'
+}
+
+
 function apt-cyg-describe ()
 {
   local pkg

How to install apt-cyg to /usr/local/bin

I realised that when installing apt-cyg, I had installed it to my home directory without realising, simply creating a symbolic link to it in /usr/local/bin by following the instructions. However, in keeping with the philosophy of all software I install without a package manager, I'm trying to install apt-cyg directly to /usr/local/bin.

However, when I do:

cd /usr/local/bin &&
git clone https://github.com/kou1okada/apt-cyg.git &&
ln -s "$(realpath apt-cyg)" /usr/local/bin/

...I get the error:

ln: failed to create symbolic link '/usr/local/bin/apt-cyg': File exists

However, even without doing ln, I'm still unable to run apt-cyg. Any idea what's going on here?

update version strings

Hi!
Can you please update the version strings to reflect your fork?
There is no point in putting the copyright here, and would be more useful to say this is your version.

I'm using 3 different versions of apt-cyg to ensure stuff works, yours is one of them I really like,
but I'm always confused which one is which, without having to rename them specifically.

function version()
{
  echo "apt-cyg version 0.57"
  echo "Written by Stephen Jungels"
  echo ""
  echo "Copyright (c) 2005-9 Stephen Jungels.  Released under the GPL."
}

spelling and typos

  • scriptinfo : to show script infomations. --> "information"

  • Also, try to be consistent: For example, use either subcommands or sub-commands, but not both, and certainly not sub commands.

Suggest to install libiconv too.

Fresh Cygwin installation without wget:

bash# apt-cyg --help
You must install wget, tar and gawk to use apt-cyg.

I am adding a missing dependency and then attempt to install bash-completion:

bash# apt-cyg completion-install
Error: Required command [iconv] not found.
at : /home/user/.local/bin/apt-cyg: assert_command_exists: 84

Seems modern Cygwin comes only with libiconv2, which misses iconv utility...

In the README.md you already mention:

apt-cyg requires the Cygwin default environment and the additional Cygwin packages:
wget, ca-certificates, gnupg, libiconv

Please update the message of apt-cyg --help to include libiconv (& gnupg ??) if you require them anyway...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.