apt-cyg has had a long standing circular dependency with wget. This is because
Base Cygwin does not include wget or curl. I have mentioned before workarounds
to this
41e1d91172
However none were ideal. I have since discovered lynx, which can be used in a
pinch to download files
http://unix.stackexchange.com/a/83987
lynx has these features
- pure command line, unlike setup-x86_64
- works with "https://" URLs, unlike /dev/tcp
- comes with Base Cygwin, unlike wget/curl
If wget is not installed, lynx will be used as a fallback with a warning
printed.
when dealing with package dependency woes, such as
http://cygwin.com/ml/cygwin/2014-10/msg00563.html
The current "depends" tree method fails, because it only shows the packages, not
the dependency paths. These paths are necessary to solve the "shortest path
problem"
http://wikipedia.org/wiki/Shortest_path_problem
Now, every possible dependency path will print from the chosen package. Combined
with category search you can run searches such as
apt-cyg category Base |
apt-cyg depends |
awk '/perl$/ {print length,$0}' |
sort -n
Solving the path problem in seconds.
Can now pipe package names to apt-cyg, example
echo bash | apt-cyg show
If --file is provided as well, it will override stdin
echo bash | apt-cyg show --file foo.txt
Note the Linux analog "apt-cache show" does not provide this functionality.
Some packages were being downloaded to wrong location. For example "gcc-core" is
supposed to be found at
release/gcc/gcc-core
However it was being downloaded at
release/gcc-core
Packages will now be downloaded as directed by "setup.ini"
1. create proxy file if not exist
2. create array from proxy file if not exist
3. if array is empty download proxy file
4. shift continue unless country is US
5. shift continue if proxy is slow
6. shift continue if proxy is blocked by Google
7. print successful proxy
8. save remaining proxies to file
I think package names are not allowed to contain spaces anyway, but if they are
it would cause apt-cyg to fail spectacularly. Some unquoted
$pkg
are still lingering but that is an easy fix.
The array method works fine, but sed method uses less characters and is easier
to read. Also it does support indenting, it would just need to be modified to
sed '1d;$d;s/ //'
or similar.
listfiles was only working on packages that were already installed. You should
be able to list a packages files even if it is not installed, especially if it
has already been downloaded.
The function will now download the package if necessary, without installing, in
order to view the package files.
Other small changes
- conditional echo instead of piping to "head" in certain loops
- download function was exiting upon failure, when really it should just skip to
next package
- simplified a grep statement
The MSYS2 programs will not play nice with Cygwin paths. This change will create
a wrapper script in "/usr/local/bin" for each ".exe" that runs the exe with a
path it will recognize.