Compare commits

..

No commits in common. "e45205cb2fbe17b07f9f24932065cc886669bd5d" and "9623569a7dec7f43f949f9d89b5a9062ead2552b" have entirely different histories.

4 changed files with 4 additions and 42 deletions

36
aps
View file

@ -1,10 +1,4 @@
#!/bin/sh
#################################
# Alnux Packaging System, #
# the package manager for Alnux #
#################################
if [ -f "/etc/al/config" ]; then
. /etc/al/config
else
@ -14,25 +8,12 @@ else
locpkg_database="${install_root}/var/aps/repos"
lock="${install_root}/var/aps/lock"
official="https://git.hippoz.xyz/alnux/repo"
debug=off
fi
if [ ${debug} = on ]; then
set -x
fi
die() {
echo "aps: fatal: ${1}"
rm "${lock}"
exit 2
}
confirm(){
echo -ne "Are you sure? [Y/n] "
read prompt
if [[ ${prompt} = [nN] ]]; then
die "User said no. Exiting..."
elif [[ ${prompt} != [yY] ]]; then
die "User gave invalid input. Exiting..."
fi
}
run_package_script() {
{
if [ -x "${2}/${1}" ]; then
@ -45,7 +26,6 @@ run_package_script() {
install_local_package() {
[ ! -e "${1}" ] && die "[E] File ${1} does not exist. Exiting..."
# Extract the package
confirm
echo ":: Installing package ${1}"
cp -prv "${1}" "${temp_location}"
pkg_name="${1%/}"
@ -93,7 +73,6 @@ install_local_package() {
echo "[*] Install complete for package ${pkg_name}"
}
sync_deps(){
confirm
echo ":: Syncing dependencies for ${1}"
install_package_from_repo "${pkg_makedepends}"
install_package_from_repo "${pkg_deps}"
@ -101,7 +80,6 @@ sync_deps(){
}
remove_local_package() {
confirm
echo ":: Removing target ${1}..."
pkg_path="${installed_pkg_database}/${1}"
[ ! -d "${pkg_path}" ] && die "Package could not be found in local installed package database. Exiting..."
@ -128,7 +106,6 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${
install_local_package "${locpkg_database}/${1}/${2}"
}
upgrade() {
confirm
echo ":: Upgrading installed packages"
cd "${installed_pkg_database}" || die "Could not enter local installed package database directory. Exiting..."
for pkg in */; do
@ -149,17 +126,6 @@ upgrade() {
unset pkg_config_depends
done
}
version(){
echo "Alnux APS v0.0.8"
}
help(){
echo "Alnux APS, the packaging system for Alnux."
echo ""
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)."
}
main() {
if [ -f "${lock}" ]; then
echo "[E] A lock file already exists (another instance of the package manager could be running). If you're sure no package manager is running, remove the file ${lock}."
@ -178,8 +144,6 @@ main() {
[ -z "${2}" ] && exit 0
install_package_from_repo "official" "${2}" ;;
upgrade) upgrade "official" ;;
help) help ;;
version) version ;;
*) die "[E] Invalid option ${1}, exiting..." ;;
esac
rm "${lock}"

View file

@ -4,9 +4,8 @@
# Alnux Packaging System #
##########################
temp_location="/var/tmp"
install_root="/"
install_root="/var/tmp/alroot"
installed_pkg_database="${install_root}/var/aps/installed"
locpkg_database="${install_root}/var/aps/repos"
lock="${install_root}/var/aps/lock"
official="https://git.hippoz.xyz/alnux/repo"
debug=off

View file

@ -13,10 +13,9 @@ if [ ${prefix} == / ]; then
kill 2
fi
else
./aps sync alnux
install -v aps ${prefix}/usr/bin/ &&
install -v altools/sel ${prefix}/usr/bin/ &&
install -v altools/repo ${prefix}/usr/bin/ &&
install -v config/config ${prefix}/etc/al &&
install -v -Dm644 man/aps.8.gz ${prefix}/usr/share/man/man8/
${prefix}/usr/bin/aps sync alnux &&
install -v config/config /etc/al
fi

Binary file not shown.