Commit Graph

48 Commits

Author SHA1 Message Date
Steven Penny a6d4d8f709 Minor edit "usage" 2014-06-01 18:35:21 -05:00
Steven Penny 1272ac41bc Use sed to print blocks of text
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.
2014-06-01 18:30:11 -05:00
Steven Penny 200ce9069d Search "devel" packages unless looking for ".exe"
apt-cyg searchall will now only exclude "devel" packages if you are searching
for ".exe" or similar.
2014-05-31 11:25:12 -05:00
Steven Penny c8fb2604da Improve "depends" function
- function will now print the packages at proper depths
- added newline between each result if called with multiple packages
2014-05-28 23:26:51 -05:00
Steven Penny 390024541d listfiles download if necessary
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
2014-05-27 23:18:48 -05:00
Steven Penny 13a9f583b4 Download function
Package download functionality has been moved into its own private function, to
support future updates.
2014-05-26 00:04:00 -05:00
Steven Penny fbf531e638 Remove case statement
by using functions instead of case statement

- remove level of indentation
- allow use of local variables via "local" keyword
2014-05-24 20:35:41 -05:00
Steven Penny ec36e46faf Change default cache location
apt-get uses /var/cache to store downloaded files

http://askubuntu.com/q/178806/where-do-packages-installed-with-apt-get-stored

This makes sense with Cygwin as well because Cygwin already has a /var/cache
which is almost empty to start, compared to /setup which does not exist outside
of apt-cyg.
2014-05-24 15:00:44 -05:00
Steven Penny 6a62641d94 Revise some awk statements 2014-05-24 14:56:57 -05:00
Steven Penny 73512e40cb Restore noscripts option
This is needed as per @kou1okada comment on 44e89c6
2014-05-21 23:44:30 -05:00
Steven Penny e0f31ae249 Improve "depends" awk statement, part deux 2014-05-21 21:23:28 -05:00
Steven Penny d124c46078 Improve "depends" awk statement
We can save a set of braces by using "continue". Also removed a spurious
variable assignment.
2014-05-20 22:51:36 -05:00
Steven Penny a1cf729b51 depends command
This is similar to the "apt-cache depends" command.
2014-05-20 00:51:37 -05:00
Steven Penny 4818a59e5a Normalize mirror directory
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.
2014-05-19 02:45:10 -05:00
Steven Penny b09f55c46d Improve remove logic
Thanks @kou1okada

http://github.com/transcode-open/apt-cyg/commit/1b3c49d#commitcomment-6329645
2014-05-15 00:11:54 -05:00
Steven Penny a9f9fea4e6 Minor edit
This will allow some relief from that long line, especially if more commands are
added.
2014-05-14 23:51:07 -05:00
Steven Penny c38e0303cd Minor cleanup
- test commands directly instead of using temporary variable
- test command directly instead of exit variable
2014-05-14 21:20:39 -05:00
Steven Penny f4d57c9f25 Minor fix GitHub highlighting
GitHub is freaking about '\' even though it is valid syntax. Using double
backslash still works with "awk", and doesnt break the highlighting.
2014-05-14 18:31:22 -05:00
Steven Penny 1b3c49da14 Revise remove command
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
2014-05-14 18:13:39 -05:00
Steven Penny 3ecc4eef4a Update setup.ini when necessary
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.
2014-05-14 00:53:12 -05:00
Steven Penny 44e89c64d4 Remove noscripts option
- "--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
2014-05-14 00:16:44 -05:00
Steven Penny c585c8e893 Allow remove wget
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
2014-05-13 23:10:36 -05:00
Steven Penny 2e6305c262 Add more filters for "searchall" 2014-05-11 19:29:07 -05:00
Steven Penny a2ca937646 Update checkpackages function
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
2014-05-05 01:46:58 -05:00
Steven Penny 1cfa858ac0 listfiles command
This is similar to the "dpkg --listfiles" command.
2014-05-05 01:22:54 -05:00
Steven Penny 97ae776f82 Stop regexing "apt-cyg show"
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.
2014-05-04 23:25:31 -05:00
Steven Penny 9f1fb5689a Stop updating setup.ini
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
2014-05-04 22:41:32 -05:00
Steven Penny 74da8e7d63 searchall, skip first line
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.
2014-05-04 17:15:07 -05:00
Steven Penny 3d0f4a0c84 Fix install directory
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.
2014-04-18 18:23:52 -05:00
Steven Penny 7fedcba256 rdepends command
This is similar to the "apt-cache rdepends" command.
2014-04-18 15:20:39 -05:00
Steven Penny 223654f0fa searchall command
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.
2014-03-16 23:59:24 -05:00
Steven Penny 841924fa7c Change "apt-cyg packageof" to "apt-cyg search"
This puts apt-cyg more in line with "dpkg --search"
2014-03-16 06:59:17 -05:00
Steven Penny 29014aa1d1 Merge "find" and "list" commands
"list" will now list all installed packages, or packages matching pattern if one
is given. This puts it more in line with "dpkg --list"
2014-03-16 06:59:17 -05:00
Steven Penny ecef939c7c Change "apt-cyg describe" to "apt-cyg show"
This puts apt-cyg more in line with "apt-cache show".
2014-03-16 06:59:17 -05:00
Steven Penny 8229393168 Change "apt-cyg show" to "apt-cyg list"
This puts apt-cyg more in line with "dpkg --list".

The plan is to merge "apt-cyg show" and "apt-cyg find" into "apt-cyg list".
2014-03-16 06:59:16 -05:00
Steven Penny ca292c5de8 Minor cleanup
- remove quote where possible
- remove temporary variables where it makes sense
- use single quote over double quote where possible
2014-03-16 06:59:16 -05:00
Steven Penny 663a6d55ae Code clean up part 4
- 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
2014-03-16 06:59:16 -05:00
Steven Penny b42a6cb813 Update dependency and arch checking
Use more concise methods for both.
2014-03-16 06:59:16 -05:00
Steven Penny 041bc88276 Code clean up part 3
- avoid double quotes where possible
- replace 'echo ""' with 'echo'
- remove "useless use of cat"
- "awk" statement refactoring
2014-03-16 06:59:16 -05:00
Steven Penny 54d23fc0dc Code clean up part 2
- avoid using escaped double quotes where possible
- use "+=" where possible
- remove "useless use of cat"
- "awk" statement refactoring
- replace 'echo ""' with 'echo'
2014-03-16 06:59:16 -05:00
Steven Penny 135b3abda5 Code clean up
- 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'
2014-03-16 06:59:16 -05:00
Steven Penny 01244a6998 change mode apt-cyg 2014-03-16 06:59:16 -05:00
Steven Penny 41e1d91172 bootstrap wget
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.
2014-03-16 06:59:16 -05:00
info@skl.me c093abfb33 Fix svn merge conflicts
git-svn-id: https://apt-cyg.googlecode.com/svn/trunk@33 f2a461e8-04e4-11de-bcc6-d9108be23e13
2014-03-16 06:59:16 -05:00
Stephen Lang 60a31c5097 Change default mirror to mirrors.kernel.org 2014-03-16 06:59:16 -05:00
ernierasta c437fa0e3c Add multiarch support. 2013-10-23 13:13:17 +02:00
ernierasta 9058643302 Add xz archive support. 2013-10-23 12:59:49 +02:00
Stephen Jungels 2af0c86cb8 Create apt-cyg 2013-07-28 12:12:28 -04:00