Add user config and add sources file. #10
1 changed files with 20 additions and 2 deletions
22
aps
22
aps
|
@ -5,7 +5,11 @@
|
|||
# the package manager for Alnux #
|
||||
#################################
|
||||
|
||||
if [ -f "/etc/al/config" ]; then
|
||||
if [ -f "$XDG_CONFIG_HOME/al/config" ]; then
|
||||
|
||||
. $XDG_CONFIG_HOME/al/config
|
||||
elif [ -f "$HOME/.config/al/config"]; then
|
||||
. $HOME/.config/al/config
|
||||
elif [ -f "/etc/al/config" ]; then
|
||||
. /etc/al/config
|
||||
else
|
||||
temp_location="/var/tmp"
|
||||
|
@ -58,6 +62,13 @@ install_local_package() {
|
|||
pkg_config_ver="0"
|
||||
pkg_config_makedepends=""
|
||||
pkg_config_depends=""
|
||||
# Download sources.
|
||||
pkg_config_sources="$(cat sources | sed -n 1)"
|
||||
pkg_config_sources_to="$(cat sources | sed -n 1)"
|
||||
pkg_config_sources_to="$(echo ${pkg_config_sources_to} | sed s|.*/||)"
|
||||
curl -# ${pkg_config_sources} -o ${pkg_config_sources_to}
|
||||
tar -xf ${pkg_config_sources_to} ${pkg_name}
|
||||
cd ${pkg_name}
|
||||
# Install package
|
||||
mkdir -p "${pkg_path}/payload"
|
||||
. "${pkg_path}/package"
|
||||
|
@ -158,7 +169,13 @@ help(){
|
|||
echo "sync - Synchronizes from package repository."
|
||||
echo "install - Installs from local package information file and build file."
|
||||
echo "upgrade - Upgrades from package repository."
|
||||
echo "remove - Removes a package from /var/aps/installed and it's install files (payloadfiles)."
|
||||
echo "remove - Removes a package from /var/aps/installed and it's install files (payloadfiles)."
|
||||
echo "list - Lists currently installed packages."
|
||||
echo "help - Display this message."
|
||||
echo "version - Display the version."
|
||||
}
|
||||
list(){
|
||||
ls ${installed_pkg_database} | sed 's/^README.md//g'
|
||||
}
|
||||
main() {
|
||||
if [ -f "${lock}" ]; then
|
||||
|
@ -180,6 +197,7 @@ main() {
|
|||
upgrade) upgrade "official" ;;
|
||||
help) help ;;
|
||||
version) version ;;
|
||||
list) list ;;
|
||||
*) die "[E] Invalid option ${1}, exiting..." ;;
|
||||
esac
|
||||
rm "${lock}"
|
||||
|
|
Loading…
Reference in a new issue
instead of checking for a bunch of config files, let the user set the path using an enviornment variable. better yet, make the entire script configured by enviornment variables!