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.
This is a file similar to apt-cyg. It will install packages from the MSYS2
project. It will only be practical for packages from the "MINGW" repo, as
packages from the "MSYS2" repo would require the MSYS2 dll.
I have a need for this because Cygwin Tcl/Tk requires X11. MSYS2 Tcl/Tk does not
require X11, so it can run much faster.
User input was not being checked in any way. "mirror" must not have a trailing
slash, while "mirrordir" must have a trailing slash before it is encoded.
This is to match up with "setup-x86_64.exe" installer.
1. print a list of all files and dependencies of those files used by apt-cyg
2. if any are found in the files list of the package to be removed, then fail
Unrelated, added an echo each time a postinstall script is run, the name of the
script
If you tried to use this command
apt-cyg install --mirror <URL> <package>
with a new mirror, it would fail because "apt-cyg install" no longer downloads
setup.ini every time. Fix so that setup.ini will be downloaded if it does not
already exist.
- "--noscripts" was not advertised in the help, and is not really needed now
that updates are done manually
- moved the function inline as it was only being called once
wget is not included with base Cygwin, so I see no reason why it cannot be
removed. Worst case it can be reinstalled using setup-x86_64.exe
Also
- removed some quotes where they were not needed
- replaced a statement piping to Bash with more appropriate xargs statement
This function doesnt really need to exit, because package loops with no
packages will simply exit the loop immediately. Also by removing the "exit" it
allows to do cool stuff like
if checkpackages
Packages supplied to "apt-cyg show" must now match exactly. This is in line
with "apt-cache show".
Also if a package is not found it will now give a message.
Applies to
apt-cyg install
apt-cyg list
apt-cyg show
This is in line with these analogues
apt-get install
dpkg --list
apt-cache show
which do not run an update each time the command is called
The "searchall" command was including the first line of the HTTP response when
looking for package names, example
Found 7 matches for /diff.exe
If the search contained a "/" then the search itself would show up as a result
package. New awk statement filters out first line.
packages were installing to "$cache/$mirrordir" which I believe is a relic of
pre 64-bit Cygwin. Packages now install to "$cache/$mirrordir/$ARCH" which is
inline with the official Cygwin installer.
This is similar to the "apt-file search" command, and almost identical to the
"cygcheck --package-query" command. Instead of only search for a file from
installed packages, it searches all available packages.
I have included it as a separate command because it "wget"s cygwin.com and can
be slow at times.
- use "[" instead of "test"
- remove double quotes where word splitting does not occur
- revise some "sed" statements
- use "((" construct where possible
- use "return" in place of long winded "if" statements
- use "+=" where possible
- use "type" instead of "which"
- use "[[" construct where appropriate
- avoid using escaped double quotes where possible
- use "+=" where possible
- remove "useless use of cat"
- "awk" statement refactoring
- replace 'echo ""' with 'echo'
- utilize "||" as continuation character, remove unneeded "\"
- remove excess empty lines
- replace "shift; shift" with "shift 2"
- move redirects to end of line
- removed several "useless use of cat"
- refactored several "awk" statements
- replace 'echo ""' with 'echo'
Currently apt-cyg has a circular dependency on wget. This can be resolved the
following ways, but each has problems
- setup-x86_64
you can run a command like "setup-x86_64 -qP wget" but this is not desirable
because it just spawns the gui, which was probably what apt-cyg was designed
to prevent in the first place
- using /dev/tcp
this is a good solution but does not work for "https://" URLs
- using telnet
this is a windows component but is disabled by default
- using curl
like wget, this does not come with base Cygwin
- using powershell
this is available for XP and later, but only comes preinstalled with Windows 7
and later
This commit would allow a "wget" Bash function to be used if "wget.exe" is not
found, for example
http://github.com/svnpenn/dotfiles/blob/19b7b76/.bashrc#L54-L67
My function uses powershell, but a function using any of the above methods would
work.