Compare commits

...

7 commits

Author SHA1 Message Date
bfe974b185 Merge pull request 'Add user config and add sources file.' (#10) from Ohio2/aps:master into master
Reviewed-on: #10
2021-08-29 08:26:42 +01:00
Ohio2
3014cb3241 fix functions 2021-08-28 14:37:37 +02:00
Ohio2
4375e666ee did i not push something 2021-08-28 13:49:30 +02:00
Ohio2
d0cc9bd951 implement sources 2021-08-28 07:17:21 +02:00
Ohio2
2200e5bac6 APS update 2021-08-28 05:24:55 +02:00
Ohio2
c2d0c0a7a4 add list 2021-08-27 16:58:57 +02:00
Ohio2
cb46751b92 user config will now be read 2021-08-27 13:34:35 +02:00

22
aps
View file

@ -5,7 +5,11 @@
# the package manager for Alnux # # 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 . /etc/al/config
else else
temp_location="/var/tmp" temp_location="/var/tmp"
@ -58,6 +62,13 @@ install_local_package() {
pkg_config_ver="0" pkg_config_ver="0"
pkg_config_makedepends="" pkg_config_makedepends=""
pkg_config_depends="" 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 # Install package
mkdir -p "${pkg_path}/payload" mkdir -p "${pkg_path}/payload"
. "${pkg_path}/package" . "${pkg_path}/package"
@ -158,7 +169,13 @@ help(){
echo "sync - Synchronizes from package repository." echo "sync - Synchronizes from package repository."
echo "install - Installs from local package information file and build file." echo "install - Installs from local package information file and build file."
echo "upgrade - Upgrades from package repository." 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() { main() {
if [ -f "${lock}" ]; then if [ -f "${lock}" ]; then
@ -180,6 +197,7 @@ main() {
upgrade) upgrade "official" ;; upgrade) upgrade "official" ;;
help) help ;; help) help ;;
version) version ;; version) version ;;
list) list ;;
*) die "[E] Invalid option ${1}, exiting..." ;; *) die "[E] Invalid option ${1}, exiting..." ;;
esac esac
rm "${lock}" rm "${lock}"