2013-07-28 09:12:28 -07:00
|
|
|
#!/bin/bash
|
2014-05-25 22:04:00 -07:00
|
|
|
# apt-cyg: install tool for Cygwin similar to debian apt-get
|
|
|
|
#
|
2013-07-28 09:12:28 -07:00
|
|
|
# The MIT License (MIT)
|
2014-05-25 22:04:00 -07:00
|
|
|
#
|
2013-07-28 09:12:28 -07:00
|
|
|
# Copyright (c) 2013 Trans-code Design
|
2014-05-25 22:04:00 -07:00
|
|
|
#
|
2013-07-28 09:12:28 -07:00
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
2014-05-25 22:04:00 -07:00
|
|
|
#
|
2013-07-28 09:12:28 -07:00
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
# all copies or substantial portions of the Software.
|
2014-05-25 22:04:00 -07:00
|
|
|
#
|
2013-07-28 09:12:28 -07:00
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
# THE SOFTWARE.
|
|
|
|
|
2014-12-25 11:41:35 -08:00
|
|
|
mapfile usage <<+
|
|
|
|
usage: apt-cyg [command] [options] [packages]
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
install Install packages
|
|
|
|
remove Remove packages
|
|
|
|
update Update setup.ini
|
|
|
|
download Download only - do NOT install or unpack archives
|
|
|
|
show Displays the package records for the named packages
|
|
|
|
depends Performs recursive dependency listings
|
|
|
|
rdepends Display packages which require X to be installed,
|
|
|
|
AKA show reverse dependencies
|
|
|
|
list List packages matching given pattern. If no pattern is given,
|
|
|
|
list all installed packages.
|
|
|
|
category List packages matching given category
|
|
|
|
listfiles List files owned by packages
|
|
|
|
search Search for a filename from installed packages
|
|
|
|
searchall Search for a filename from all available packages
|
|
|
|
|
|
|
|
Options:
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
--cache <dir> set cache
|
|
|
|
--mirror <url> set mirror
|
2014-12-25 11:41:35 -08:00
|
|
|
--version
|
|
|
|
+
|
|
|
|
|
|
|
|
mapfile version <<+
|
|
|
|
apt-cyg version 0.59
|
|
|
|
|
|
|
|
The MIT License (MIT)
|
|
|
|
|
|
|
|
Copyright (c) 2005-9 Stephen Jungels
|
|
|
|
+
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
readonly usage version
|
2013-07-28 09:12:28 -07:00
|
|
|
|
2014-12-20 00:42:40 -08:00
|
|
|
function wget {
|
|
|
|
if command wget -h &>/dev/null
|
|
|
|
then
|
|
|
|
command wget "$@"
|
|
|
|
else
|
|
|
|
warn wget is not installed, using lynx as fallback
|
|
|
|
set "${*: -1}"
|
|
|
|
lynx -source "$1" > "${1##*/}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function find-workspace {
|
2013-07-28 09:12:28 -07:00
|
|
|
# default working directory and mirror
|
|
|
|
|
|
|
|
# work wherever setup worked last, if possible
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
readonly cache=$(awk '
|
2014-06-17 23:34:05 -07:00
|
|
|
/last-cache/ {
|
|
|
|
getline
|
|
|
|
print $1
|
|
|
|
}
|
|
|
|
' /etc/setup/setup.rc | cygpath -f-)
|
2014-03-08 21:09:09 -08:00
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
readonly mirror=$(awk '
|
2014-06-17 23:34:05 -07:00
|
|
|
/last-mirror/ {
|
|
|
|
getline
|
|
|
|
print $1
|
|
|
|
}
|
|
|
|
' /etc/setup/setup.rc)
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
readonly mirrordir=$(sed '
|
2014-03-08 21:09:09 -08:00
|
|
|
s / %2f g
|
|
|
|
s : %3a g
|
2014-05-25 22:04:00 -07:00
|
|
|
' <<< "$mirror")
|
2014-03-08 21:09:09 -08:00
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
mkdir -p "$cache/$mirrordir/$arch"
|
|
|
|
cd "$cache/$mirrordir/$arch"
|
2014-06-15 22:31:43 -07:00
|
|
|
if [ -e setup.ini ]
|
|
|
|
then
|
|
|
|
return 0
|
|
|
|
else
|
|
|
|
get-setup
|
|
|
|
return 1
|
|
|
|
fi
|
2014-05-13 22:53:12 -07:00
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function get-setup {
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
if wget -N $mirror/$arch/setup.bz2
|
2014-05-13 22:53:12 -07:00
|
|
|
then
|
|
|
|
bunzip2 setup.bz2
|
|
|
|
mv setup setup.ini
|
|
|
|
echo Updated setup.ini
|
|
|
|
fi
|
2013-07-28 09:12:28 -07:00
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function check-packages {
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
if [ "$pks" ]
|
2014-05-04 23:22:54 -07:00
|
|
|
then
|
2014-05-04 23:46:58 -07:00
|
|
|
return 0
|
|
|
|
else
|
2014-06-15 16:53:29 -07:00
|
|
|
echo No packages found
|
2014-05-04 23:46:58 -07:00
|
|
|
return 1
|
2014-05-04 23:22:54 -07:00
|
|
|
fi
|
2013-07-28 09:12:28 -07:00
|
|
|
}
|
|
|
|
|
2014-12-20 00:42:40 -08:00
|
|
|
function info {
|
2014-10-26 18:30:30 -07:00
|
|
|
printf '\e[36m%s\e[m\n' "$*" >&2
|
|
|
|
}
|
|
|
|
|
2014-12-20 00:42:40 -08:00
|
|
|
function warn {
|
|
|
|
printf '\e[1;31m%s\e[m\n' "$*" >&2
|
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function apt-update {
|
2014-06-15 22:31:43 -07:00
|
|
|
if find-workspace
|
|
|
|
then
|
|
|
|
get-setup
|
|
|
|
fi
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
|
|
|
|
2014-10-30 22:06:52 -07:00
|
|
|
function apt-category {
|
2014-10-31 22:30:30 -07:00
|
|
|
check-packages
|
2014-10-30 22:06:52 -07:00
|
|
|
find-workspace
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for vas in "${pks[@]}"
|
2014-10-31 22:30:30 -07:00
|
|
|
do
|
|
|
|
awk '
|
|
|
|
$1 == "@" {
|
|
|
|
pck = $2
|
|
|
|
}
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
$1 == "category:" && $0 ~ vas {
|
2014-11-11 01:15:24 -08:00
|
|
|
print pck
|
2014-10-31 22:30:30 -07:00
|
|
|
}
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
' vas="$vas" setup.ini
|
2014-10-31 22:30:30 -07:00
|
|
|
done
|
2014-10-30 22:06:52 -07:00
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function apt-list {
|
2014-10-26 18:30:30 -07:00
|
|
|
find-workspace
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for vas in "${pks[@]}"
|
2014-10-26 18:30:30 -07:00
|
|
|
do
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
let sbq++ && echo
|
|
|
|
info Searching for installed packages matching "$vas":
|
|
|
|
awk 'NR>1 && $1~vas && $0=$1' vas="$vas" /etc/setup/installed.db
|
2014-10-26 18:30:30 -07:00
|
|
|
echo
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
info Searching for installable packages matching "$vas":
|
|
|
|
awk '$1~vas && $0=$1' RS='\n\n@ ' FS='\n' vas="$vas" setup.ini
|
2014-10-26 18:30:30 -07:00
|
|
|
done
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
let sbq && return
|
2014-12-20 00:42:40 -08:00
|
|
|
info The following packages are installed:
|
2014-10-26 18:30:30 -07:00
|
|
|
awk 'NR>1 && $0=$1' /etc/setup/installed.db
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function apt-listfiles {
|
2014-06-15 22:31:43 -07:00
|
|
|
check-packages
|
|
|
|
find-workspace
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for vas in "${pks[@]}"
|
2014-05-24 18:35:41 -07:00
|
|
|
do
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
let sbq++ && echo
|
|
|
|
if [ ! -e /etc/setup/"$vas".lst.gz ]
|
2014-05-24 18:35:41 -07:00
|
|
|
then
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
download || return
|
2014-05-24 18:35:41 -07:00
|
|
|
fi
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
gzip -cd /etc/setup/"$vas".lst.gz
|
2014-05-27 21:18:48 -07:00
|
|
|
done
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function apt-show {
|
2014-06-15 22:31:43 -07:00
|
|
|
find-workspace
|
|
|
|
check-packages
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for vas in "${pks[@]}"
|
2014-05-24 18:35:41 -07:00
|
|
|
do
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
let sbq++ && echo
|
2014-05-24 18:35:41 -07:00
|
|
|
awk '
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
$1 == vas {
|
2014-05-24 18:35:41 -07:00
|
|
|
print
|
|
|
|
fd++
|
|
|
|
}
|
|
|
|
END {
|
|
|
|
if (! fd)
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
print "Unable to locate package", vas
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
' RS='\n\n@ ' FS='\n' vas="$vas" setup.ini
|
2014-05-27 21:18:48 -07:00
|
|
|
done
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function apt-depends {
|
2014-06-15 22:31:43 -07:00
|
|
|
find-workspace
|
|
|
|
check-packages
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for vas in "${pks[@]}"
|
2014-05-24 18:35:41 -07:00
|
|
|
do
|
|
|
|
awk '
|
2014-11-11 01:15:24 -08:00
|
|
|
@include "join"
|
2014-05-24 18:35:41 -07:00
|
|
|
$1 == "@" {
|
2014-11-11 01:15:24 -08:00
|
|
|
apg = $2
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
|
|
|
$1 == "requires:" {
|
2014-11-11 01:15:24 -08:00
|
|
|
for (z=2; z<=NF; z++)
|
|
|
|
reqs[apg][z-1] = $z
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
|
|
|
END {
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
prpg(vas)
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
2014-11-11 01:15:24 -08:00
|
|
|
function smartmatch(small, large, values) {
|
|
|
|
for (each in large)
|
|
|
|
values[large[each]]
|
|
|
|
return small in values
|
2014-05-28 21:26:51 -07:00
|
|
|
}
|
2014-11-11 01:15:24 -08:00
|
|
|
function prpg(fpg) {
|
|
|
|
if (smartmatch(fpg, spath)) return
|
|
|
|
spath[length(spath)+1] = fpg
|
2014-12-15 22:34:42 -08:00
|
|
|
print join(spath, 1, length(spath), " > ")
|
2014-11-11 01:15:24 -08:00
|
|
|
if (isarray(reqs[fpg]))
|
|
|
|
for (each in reqs[fpg])
|
|
|
|
prpg(reqs[fpg][each])
|
|
|
|
delete spath[length(spath)]
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
' vas="$vas" setup.ini
|
2014-05-24 18:35:41 -07:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function apt-rdepends {
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
check-packages
|
2014-06-15 22:31:43 -07:00
|
|
|
find-workspace
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for vas in "${pks[@]}"
|
2014-05-24 18:35:41 -07:00
|
|
|
do
|
|
|
|
awk '
|
2014-12-15 22:34:42 -08:00
|
|
|
@include "join"
|
|
|
|
$1 == "@" {
|
|
|
|
apg = $2
|
|
|
|
}
|
|
|
|
$1 == "requires:" {
|
|
|
|
for (z=2; z<=NF; z++)
|
|
|
|
reqs[$z][length(reqs[$z])+1] = apg
|
|
|
|
}
|
|
|
|
END {
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
prpg(vas)
|
2014-12-15 22:34:42 -08:00
|
|
|
}
|
|
|
|
function smartmatch(small, large, values) {
|
|
|
|
for (each in large)
|
|
|
|
values[large[each]]
|
|
|
|
return small in values
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
2014-12-15 22:34:42 -08:00
|
|
|
function prpg(fpg) {
|
|
|
|
if (smartmatch(fpg, spath)) return
|
|
|
|
spath[length(spath)+1] = fpg
|
|
|
|
print join(spath, 1, length(spath), " < ")
|
|
|
|
if (isarray(reqs[fpg]))
|
|
|
|
for (each in reqs[fpg])
|
|
|
|
prpg(reqs[fpg][each])
|
|
|
|
delete spath[length(spath)]
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
' vas="$vas" setup.ini
|
2014-05-24 18:35:41 -07:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function apt-download {
|
2014-06-15 22:31:43 -07:00
|
|
|
check-packages
|
|
|
|
find-workspace
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for vas in "${pks[@]}"
|
2014-06-15 16:53:29 -07:00
|
|
|
do
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
let sbq++ && echo
|
|
|
|
download
|
2014-06-15 16:53:29 -07:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function download {
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
# look for package and save md5 file
|
2014-05-25 22:04:00 -07:00
|
|
|
|
|
|
|
# download and unpack the bz2 or xz file
|
|
|
|
|
|
|
|
# pick the latest version, which comes first
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
awk '
|
|
|
|
$1 == "@" {
|
|
|
|
c = $2
|
|
|
|
}
|
|
|
|
$1 == "install:" && c == vas {
|
|
|
|
print $4, $2
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
' vas="$vas" setup.ini > md5.sum
|
|
|
|
if [ ! -s md5.sum ]
|
2014-05-25 22:04:00 -07:00
|
|
|
then
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
warn Unable to locate package $vas
|
|
|
|
return 1
|
2014-05-25 22:04:00 -07:00
|
|
|
fi
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
read _ acv < md5.sum
|
2014-05-25 22:04:00 -07:00
|
|
|
|
|
|
|
# check the md5
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
mv md5.sum ..
|
|
|
|
cd ..
|
|
|
|
if ! test -e $acv || ! md5sum -c md5.sum
|
2014-05-25 22:04:00 -07:00
|
|
|
then
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
wget -rnH $mirror/$acv
|
|
|
|
md5sum -c md5.sum || return
|
2014-05-25 22:04:00 -07:00
|
|
|
fi
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
tar tf $acv | gzip > /etc/setup/"$vas".lst.gz
|
2014-05-25 22:04:00 -07:00
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function apt-search {
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
check-packages || return
|
2014-06-03 21:51:18 -07:00
|
|
|
echo Searching downloaded packages...
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for vas in "${pks[@]}"
|
2014-05-24 18:35:41 -07:00
|
|
|
do
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for mft in /etc/setup/*.lst.gz
|
2014-05-24 18:35:41 -07:00
|
|
|
do
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
if gzip -cd $mft | grep -q "$vas"
|
2014-05-24 18:35:41 -07:00
|
|
|
then
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
awk '$0=$4' FS='[./]' <<< $mft
|
2014-05-24 18:35:41 -07:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function apt-searchall {
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
check-packages
|
|
|
|
cd /etc/setup
|
|
|
|
for vas in "${pks[@]}"
|
2014-05-24 18:35:41 -07:00
|
|
|
do
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
printf -v qry 'text=1&arch=%s&grep=%s' $arch "$vas"
|
|
|
|
wget -O matches cygwin.com/cgi-bin2/package-grep.cgi?"$qry"
|
2014-06-15 12:10:19 -07:00
|
|
|
awk '
|
2014-11-12 13:18:38 -08:00
|
|
|
{
|
|
|
|
if (NR == 1)
|
|
|
|
next
|
|
|
|
if (mc[$1]++)
|
|
|
|
next
|
|
|
|
if (/-debuginfo-/)
|
|
|
|
next
|
|
|
|
print $1
|
|
|
|
}
|
|
|
|
' FS=-[[:digit:]] matches
|
2014-05-24 18:35:41 -07:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
function set-cache {
|
|
|
|
if [ "$1" ]
|
|
|
|
then
|
|
|
|
vas=$(cygpath -aw "$1")
|
|
|
|
awk -i inplace '
|
|
|
|
1
|
|
|
|
/last-cache/ {
|
|
|
|
getline
|
|
|
|
print "\t" vas
|
|
|
|
}
|
|
|
|
' vas="${vas//\\/\\\\}" /etc/setup/setup.rc
|
|
|
|
echo Cache set to "$vas"
|
|
|
|
else
|
|
|
|
warn No path provided, exiting
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function set-mirror {
|
|
|
|
if [ "$1" ]
|
|
|
|
then
|
|
|
|
awk -i inplace '
|
|
|
|
1
|
|
|
|
/last-mirror/ {
|
|
|
|
getline
|
|
|
|
print "\t" vas
|
|
|
|
}
|
|
|
|
' vas="$1" /etc/setup/setup.rc
|
|
|
|
echo Mirror set to "$1"
|
|
|
|
else
|
|
|
|
warn No URL provided, exiting
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function apt-install {
|
2014-06-15 22:31:43 -07:00
|
|
|
check-packages
|
|
|
|
find-workspace
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for vas in "${pks[@]}"
|
2014-05-24 18:35:41 -07:00
|
|
|
do
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
if grep -q "^$vas " /etc/setup/installed.db
|
2014-05-24 18:35:41 -07:00
|
|
|
then
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
echo Package $vas is already installed, skipping
|
2014-05-24 18:35:41 -07:00
|
|
|
continue
|
|
|
|
fi
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
let sbq++ && echo
|
|
|
|
echo Installing $vas
|
2014-05-24 18:35:41 -07:00
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
download || return
|
2014-05-24 18:35:41 -07:00
|
|
|
echo Unpacking...
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
tar -x -C / -f $acv
|
|
|
|
cd ~-
|
2014-05-24 18:35:41 -07:00
|
|
|
# update the package database
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
awk -e '
|
|
|
|
{
|
|
|
|
foo[$0]
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
ENDFILE {
|
|
|
|
$1 = vas
|
|
|
|
$2 = acv
|
|
|
|
$3 = 0
|
|
|
|
foo[$0]
|
|
|
|
asorti(foo)
|
|
|
|
for (bar in foo)
|
|
|
|
print foo[bar]
|
2014-05-24 18:35:41 -07:00
|
|
|
}
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
' -i inplace vas="$vas" acv=$acv /etc/setup/installed.db
|
2014-05-24 18:35:41 -07:00
|
|
|
|
|
|
|
# recursively install required packages
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
awk '
|
|
|
|
$1 == "@" {
|
|
|
|
c = $2
|
|
|
|
}
|
|
|
|
$1 == "requires:" && c == vas {
|
|
|
|
print
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
' vas="$vas" setup.ini > deps.ini
|
|
|
|
if [ -s deps.ini ]
|
2014-05-24 18:35:41 -07:00
|
|
|
then
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
read _ rqs < deps.ini
|
|
|
|
echo Package $vas requires the following packages, installing:
|
|
|
|
echo $rqs
|
|
|
|
apt-cyg install --deps $rqs ||
|
2014-12-20 00:42:40 -08:00
|
|
|
info some required packages did not install, continuing
|
2014-05-24 18:35:41 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
# run all postinstall scripts
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
let dps && continue
|
2014-05-24 18:35:41 -07:00
|
|
|
find /etc/postinstall -name '*.sh' | while read script
|
|
|
|
do
|
|
|
|
echo Running $script
|
|
|
|
$script
|
|
|
|
mv $script $script.done
|
|
|
|
done
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
echo Package $vas installed
|
2014-05-24 18:35:41 -07:00
|
|
|
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2014-08-04 09:14:43 -07:00
|
|
|
function apt-remove {
|
2014-06-15 22:31:43 -07:00
|
|
|
check-packages
|
2014-12-27 20:00:18 -08:00
|
|
|
cd /etc
|
|
|
|
cygcheck awk bash bunzip2 grep gzip mv sed tar xz > setup/essential.lst
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for vas in "${pks[@]}"
|
2014-05-24 18:35:41 -07:00
|
|
|
do
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
if ! grep -q "^$vas " setup/installed.db
|
2014-05-24 18:35:41 -07:00
|
|
|
then
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
echo Package $vas is not installed, skipping
|
2014-05-24 18:35:41 -07:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
if [ ! -e setup/"$vas".lst.gz ]
|
2014-05-24 18:35:41 -07:00
|
|
|
then
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
warn Package manifest missing, cannot remove $vas. Exiting
|
|
|
|
return 1
|
2014-05-24 18:35:41 -07:00
|
|
|
fi
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
gzip -dk setup/"$vas".lst.gz
|
2014-12-27 20:00:18 -08:00
|
|
|
awk '
|
|
|
|
NR == FNR {
|
|
|
|
if ($NF) ess[$NF]
|
|
|
|
next
|
|
|
|
}
|
|
|
|
$NF in ess {
|
2014-05-24 18:35:41 -07:00
|
|
|
exit 1
|
2014-12-27 20:00:18 -08:00
|
|
|
}
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
' FS='[/\\\\]' setup/{essential,$vas}.lst
|
2014-12-27 20:00:18 -08:00
|
|
|
esn=$?
|
|
|
|
if [ $esn = 0 ]
|
|
|
|
then
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
echo Removing $vas
|
|
|
|
if [ -e preremove/"$vas".sh ]
|
2014-12-27 20:00:18 -08:00
|
|
|
then
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
preremove/"$vas".sh
|
|
|
|
rm preremove/"$vas".sh
|
2014-12-27 20:00:18 -08:00
|
|
|
fi
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
mapfile mft < setup/"$vas".lst
|
|
|
|
for emt in ${mft[*]}
|
2014-12-27 20:00:18 -08:00
|
|
|
do
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
[ -f /$emt ] && rm /$emt
|
2014-12-27 20:00:18 -08:00
|
|
|
done
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
for emt in ${mft[*]}
|
2014-12-27 20:00:18 -08:00
|
|
|
do
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
[ -d /$emt ] && rmdir --i /$emt
|
2014-12-27 20:00:18 -08:00
|
|
|
done
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
rm -f setup/"$vas".lst.gz postinstall/"$vas".sh.done
|
|
|
|
awk -i inplace '$1 != vas' vas="$vas" setup/installed.db
|
|
|
|
echo Package $vas removed
|
2014-05-24 18:35:41 -07:00
|
|
|
fi
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
rm setup/"$vas".lst
|
2014-12-27 20:00:18 -08:00
|
|
|
if [ $esn = 1 ]
|
2014-05-24 18:35:41 -07:00
|
|
|
then
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
warn apt-cyg cannot remove package $vas, exiting
|
|
|
|
return 1
|
2014-05-24 18:35:41 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
function begin {
|
|
|
|
local acv dps emt esn mft pks qry rqs sbq tsk vas arch cache mirror mirrordir
|
|
|
|
if [ -p /dev/stdin ]
|
|
|
|
then
|
|
|
|
mapfile -t pks
|
|
|
|
fi
|
2014-10-31 09:38:13 -07:00
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
# process options
|
|
|
|
while let $#
|
|
|
|
do
|
2013-07-28 09:12:28 -07:00
|
|
|
case "$1" in
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
--mirror)
|
|
|
|
set-mirror "$2"
|
|
|
|
return
|
2013-07-28 09:12:28 -07:00
|
|
|
;;
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
--cache)
|
|
|
|
set-cache "$2"
|
|
|
|
return
|
2013-07-28 09:12:28 -07:00
|
|
|
;;
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
--deps)
|
|
|
|
dps=1
|
2014-05-21 21:44:30 -07:00
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
2013-07-28 09:12:28 -07:00
|
|
|
--version)
|
2014-12-25 11:41:35 -08:00
|
|
|
printf %s "${version[@]}"
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
return
|
2014-05-04 23:22:54 -07:00
|
|
|
;;
|
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
list | remove | update | install | download | listfiles |\
|
|
|
|
show | search | depends | category | rdepends | searchall )
|
|
|
|
tsk=$1
|
2013-07-28 09:12:28 -07:00
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2014-10-26 18:30:30 -07:00
|
|
|
pks+=("$1")
|
2013-07-28 09:12:28 -07:00
|
|
|
shift
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
done
|
|
|
|
if type -t apt-$tsk | grep -q function
|
|
|
|
then
|
|
|
|
readonly arch=${HOSTTYPE/i6/x}
|
|
|
|
apt-$tsk
|
|
|
|
else
|
|
|
|
printf %s "${usage[@]}"
|
|
|
|
fi
|
|
|
|
}
|
2013-07-28 09:12:28 -07:00
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
function charlie {
|
|
|
|
cd /etc/setup
|
|
|
|
compgen -v > $1.lst
|
|
|
|
if [ $1 = fin ]
|
|
|
|
then
|
|
|
|
comm -3 {start,fin}.lst
|
|
|
|
fi
|
|
|
|
}
|
2014-11-11 01:15:24 -08:00
|
|
|
|
functions: download set-cache set-mirror apt-install apt-remove begin charlie
Here are the changes, by line number:
- remove "-c", keep long version
- remove "-f" and "--file". I have never used this, and apt-get does does have
it
- remove "-m", keep long version
- remove "--help", you can get help by just "apt-cyg"
- lowercase ARCH variable, typically uppercase is for exported variables
- use readonly variables where applicable
- remove setup.ini-save, I see no point in this, and setup.exe does not use it
- go back to using "[" over "[[", more portable
- declare all variables local in "begin" function, this will prevent creation of
global variables. Child functions still have access to local variables, but
the only fix to that is running every function in a subshell, which is also
not ideal
- use "let" over "(("
- stop using awk ENVIRON array. This became a problem because the array is only
populated with exported variables. We do not want variables being passed to
child "apt-cyg" processes just to play nice with awk
- use "return" in functions instead of "exit", this will allow proper running of
"charlie" function
- add "check-packages" to some functions
- stop creating "desc" files, you can parse this information out of setup.ini
easy enough, and setup.exe does not create them either
- generate md5 file from setup.ini, this way you can use it with md5sum instead
of stdin
- utilize "wget -rnH" to create directories
- stop running "type -P" when searching for a file with "apt-cyg search".
apt-get does not do this and it could be confusing
- break "--cache" and "--mirror" out of the case statement and into their own
functions. this will make the case statement less unwieldy
- write directly to "installed.db" using "awk -i inplace"
- function "charlie": this check for any leaked global variables and prints them
to stdout just before the script finishes. this should help with debugging
2014-12-29 14:36:17 -08:00
|
|
|
charlie start
|
|
|
|
begin "$@"
|
|
|
|
charlie fin
|