apt-cyg/apt-cyg

584 lines
11 KiB
Plaintext
Raw Normal View History

2013-07-28 09:12:28 -07:00
#!/bin/bash
# apt-cyg: install tool for Cygwin similar to debian apt-get
#
2013-07-28 09:12:28 -07:00
# The MIT License (MIT)
#
2013-07-28 09:12:28 -07:00
# Copyright (c) 2013 Trans-code Design
#
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:
#
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.
#
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
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 '
/last-cache/ {
getline
print $1
}
' /etc/setup/setup.rc | cygpath -f-)
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 '
/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 '
s / %2f g
s : %3a g
' <<< "$mirror")
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"
if [ -e setup.ini ]
then
return 0
else
get-setup
return 1
fi
}
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
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" ]
then
return 0
else
echo No packages found
return 1
fi
2013-07-28 09:12:28 -07:00
}
function info {
printf '\e[36m%s\e[m\n' "$*" >&2
}
function warn {
printf '\e[1;31m%s\e[m\n' "$*" >&2
}
2014-08-04 09:14:43 -07:00
function apt-update {
if find-workspace
then
get-setup
fi
}
function apt-category {
2014-10-31 22:30:30 -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-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 {
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-08-04 09:14:43 -07:00
function apt-list {
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[@]}"
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
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
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
info The following packages are installed:
awk 'NR>1 && $0=$1' /etc/setup/installed.db
}
2014-08-04 09:14:43 -07:00
function apt-listfiles {
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[@]}"
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 ]
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
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
done
}
2014-08-04 09:14:43 -07:00
function apt-show {
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[@]}"
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
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 {
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
}
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
done
}
2014-08-04 09:14:43 -07:00
function apt-depends {
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[@]}"
do
awk '
@include "join"
$1 == "@" {
apg = $2
}
$1 == "requires:" {
for (z=2; z<=NF; z++)
reqs[apg][z-1] = $z
}
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)
}
function smartmatch(small, large, values) {
for (each in large)
values[large[each]]
return small in values
}
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)]
}
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
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
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[@]}"
do
awk '
@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)
}
function smartmatch(small, large, values) {
for (each in large)
values[large[each]]
return small in values
}
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)]
}
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
done
}
2014-08-04 09:14:43 -07:00
function apt-download {
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[@]}"
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
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
# 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 ]
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
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
# 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
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
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-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[@]}"
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
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"
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
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[@]}"
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"
awk '
{
if (NR == 1)
next
if (mc[$1]++)
next
if (/-debuginfo-/)
next
print $1
}
' FS=-[[:digit:]] matches
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 {
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[@]}"
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
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
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
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
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 ~-
# 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]
}
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]
}
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
# 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 ]
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 ||
info some required packages did not install, continuing
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
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
done
}
2014-08-04 09:14:43 -07:00
function apt-remove {
check-packages
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[@]}"
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
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
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 ]
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
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
awk '
NR == FNR {
if ($NF) ess[$NF]
next
}
$NF in ess {
exit 1
}
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
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 ]
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
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[*]}
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
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[*]}
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
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
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
if [ $esn = 1 ]
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
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
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
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
;;
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
;;
*)
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
}
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