From 531c9a3fadfb4ae043cdbd43da8ff628c311c9f4 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 7 Jul 2021 06:57:09 +0200 Subject: [PATCH 01/10] clean up the code --- aps | 26 ++++++++++++++++---- patch | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 5 deletions(-) create mode 100644 patch diff --git a/aps b/aps index d7a4466..42918d3 100644 --- a/aps +++ b/aps @@ -12,6 +12,7 @@ die() { exit 2 } run_package_script() { # --- $2 is the package path, and $1 is the script to run + # --- RPS installs to root { if [ -x "${2}/${1}" ]; then echo ":: Running ${1}" @@ -20,7 +21,7 @@ run_package_script() { # --- $2 is the package path, and $1 is the script to run fi } } -install_local_package() { +install_local_package() { # --- Install-Local-Package install package LOCALLY! [ ! -e "${1}" ] && die "[E] File ${1} does not exist. Exiting..." # Extract the package echo "[*] Copying package ${1} into temporary location ${temp_location}..." @@ -69,7 +70,7 @@ install_local_package() { unset pkg_config_makedepends unset pkg_config_depends } -remove_local_package() { +remove_local_package() { # --- Removes local packges pkg_path="${installed_pkg_database}/${1}" [ ! -d "${pkg_path}" ] && die "Package could not be found in local installed package database. Exiting..." payloadfiles_path="${pkg_path}/payloadfiles" @@ -79,7 +80,7 @@ remove_local_package() { rm -rv "${pkg_path}" echo "[*] Removal complete for target ${pkg_name}" } -sync_local_repo_database() { +sync_local_repo_database() { # --- syncs to local repo databese echo ":: Syncing local database for repo ${1}..." if [ ! -d "${locpkg_database}/${1}" ]; then echo ":: Local database for repo ${1} does not exist, cloning..." @@ -95,7 +96,7 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${ [ ! -d "${locpkg_database}/${1}/${2}" ] && die "[E] Target not found." install_local_package "${locpkg_database}/${1}/${2}" } -upgrade() { +upgrade() { # --- upgrades echo ":: Upgrading installed packages..." unset_config_values cd "${installed_pkg_database}" || die "Could not enter installed package database. Exiting..." @@ -117,7 +118,21 @@ upgrade() { unset pkg_config_depends done } -main() { +help(){ + echo 'To install locally, do:' + echo 'aps install' + echo + echo 'To install from repo (synchronize), do:' + echo 'aps sync' + echo + echo 'To remove local packages, do:' + echo 'aps remove' + echo + echo 'To upgrade repos, do:' + echo 'aps upgrade' + echo +} +main() { # --- does soem stuff if [ -f "${lock}" ]; then echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}." exit 1 @@ -131,6 +146,7 @@ main() { [ -z "${2}" ] && die "[*] No targets specified." install_package_from_repo "official" "${2}" ;; upgrade) upgrade "official" ;; + help) help *) die "[E] Invalid option ${1}, exiting..." ;; esac rm "${lock}" diff --git a/patch b/patch new file mode 100644 index 0000000..890bc1b --- /dev/null +++ b/patch @@ -0,0 +1,79 @@ +diff --git a/aps b/aps +index d7a4466..42918d3 100644 +--- a/aps ++++ b/aps +@@ -12,6 +12,7 @@ die() { + exit 2 + } + run_package_script() { # --- $2 is the package path, and $1 is the script to run ++ # --- RPS installs to root + { + if [ -x "${2}/${1}" ]; then + echo ":: Running ${1}" +@@ -20,7 +21,7 @@ run_package_script() { # --- $2 is the package path, and $1 is the script to run + fi + } + } +-install_local_package() { ++install_local_package() { # --- Install-Local-Package install package LOCALLY! + [ ! -e "${1}" ] && die "[E] File ${1} does not exist. Exiting..." + # Extract the package + echo "[*] Copying package ${1} into temporary location ${temp_location}..." +@@ -69,7 +70,7 @@ install_local_package() { + unset pkg_config_makedepends + unset pkg_config_depends + } +-remove_local_package() { ++remove_local_package() { # --- Removes local packges + pkg_path="${installed_pkg_database}/${1}" + [ ! -d "${pkg_path}" ] && die "Package could not be found in local installed package database. Exiting..." + payloadfiles_path="${pkg_path}/payloadfiles" +@@ -79,7 +80,7 @@ remove_local_package() { + rm -rv "${pkg_path}" + echo "[*] Removal complete for target ${pkg_name}" + } +-sync_local_repo_database() { ++sync_local_repo_database() { # --- syncs to local repo databese + echo ":: Syncing local database for repo ${1}..." + if [ ! -d "${locpkg_database}/${1}" ]; then + echo ":: Local database for repo ${1} does not exist, cloning..." +@@ -95,7 +96,7 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${ + [ ! -d "${locpkg_database}/${1}/${2}" ] && die "[E] Target not found." + install_local_package "${locpkg_database}/${1}/${2}" + } +-upgrade() { ++upgrade() { # --- upgrades + echo ":: Upgrading installed packages..." + unset_config_values + cd "${installed_pkg_database}" || die "Could not enter installed package database. Exiting..." +@@ -117,7 +118,21 @@ upgrade() { + unset pkg_config_depends + done + } +-main() { ++help(){ ++ echo 'To install locally, do:' ++ echo 'aps install' ++ echo ++ echo 'To install from repo (synchronize), do:' ++ echo 'aps sync' ++ echo ++ echo 'To remove local packages, do:' ++ echo 'aps remove' ++ echo ++ echo 'To upgrade repos, do:' ++ echo 'aps upgrade' ++ echo ++} ++main() { # --- does soem stuff + if [ -f "${lock}" ]; then + echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}." + exit 1 +@@ -131,6 +146,7 @@ main() { + [ -z "${2}" ] && die "[*] No targets specified." + install_package_from_repo "official" "${2}" ;; + upgrade) upgrade "official" ;; ++ help) help + *) die "[E] Invalid option ${1}, exiting..." ;; + esac + rm "${lock}" -- 2.30.2 From 8b5c1d1d95362dd2b5d721bc9897322655ecaf45 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 7 Jul 2021 12:56:24 +0300 Subject: [PATCH 02/10] Zaktualizuj 'aps' --- aps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aps b/aps index 8bc1ca3..ceac685 100644 --- a/aps +++ b/aps @@ -146,7 +146,7 @@ main() { # --- does soem stuff [ -z "${2}" ] && die "[*] No targets specified." install_package_from_repo "official" "${2}" ;; upgrade) upgrade "official" ;; - help) help + help) help ;; *) die "[E] Invalid option ${1}, exiting..." ;; esac rm "${lock}" -- 2.30.2 From 093f1e980e3be4da649120cfca20c497fc5405e6 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 7 Jul 2021 12:11:14 +0200 Subject: [PATCH 03/10] added list option --- aps | 8 ++- patch | 166 ++++++++++++++++++++++++++++++++++++---------------------- 2 files changed, 108 insertions(+), 66 deletions(-) diff --git a/aps b/aps index 8bc1ca3..3eefa4e 100644 --- a/aps +++ b/aps @@ -118,7 +118,7 @@ upgrade() { # --- upgrades unset pkg_config_depends done } -help(){ +help(){ # --- displays help echo 'To install locally, do:' echo 'aps install' echo @@ -132,6 +132,9 @@ help(){ echo 'aps upgrade' echo } +local_installed_list(){ # --- local installed list + ls ${installed_pkg_database} +} main() { # --- does soem stuff if [ -f "${lock}" ]; then echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}." @@ -146,7 +149,8 @@ main() { # --- does soem stuff [ -z "${2}" ] && die "[*] No targets specified." install_package_from_repo "official" "${2}" ;; upgrade) upgrade "official" ;; - help) help + help) help ;; + list) local_installed_list ;; *) die "[E] Invalid option ${1}, exiting..." ;; esac rm "${lock}" diff --git a/patch b/patch index 890bc1b..402f281 100644 --- a/patch +++ b/patch @@ -1,79 +1,117 @@ diff --git a/aps b/aps -index d7a4466..42918d3 100644 +index 8bc1ca3..3eefa4e 100644 --- a/aps +++ b/aps -@@ -12,6 +12,7 @@ die() { - exit 2 - } - run_package_script() { # --- $2 is the package path, and $1 is the script to run -+ # --- RPS installs to root - { - if [ -x "${2}/${1}" ]; then - echo ":: Running ${1}" -@@ -20,7 +21,7 @@ run_package_script() { # --- $2 is the package path, and $1 is the script to run - fi - } - } --install_local_package() { -+install_local_package() { # --- Install-Local-Package install package LOCALLY! - [ ! -e "${1}" ] && die "[E] File ${1} does not exist. Exiting..." - # Extract the package - echo "[*] Copying package ${1} into temporary location ${temp_location}..." -@@ -69,7 +70,7 @@ install_local_package() { - unset pkg_config_makedepends - unset pkg_config_depends - } --remove_local_package() { -+remove_local_package() { # --- Removes local packges - pkg_path="${installed_pkg_database}/${1}" - [ ! -d "${pkg_path}" ] && die "Package could not be found in local installed package database. Exiting..." - payloadfiles_path="${pkg_path}/payloadfiles" -@@ -79,7 +80,7 @@ remove_local_package() { - rm -rv "${pkg_path}" - echo "[*] Removal complete for target ${pkg_name}" - } --sync_local_repo_database() { -+sync_local_repo_database() { # --- syncs to local repo databese - echo ":: Syncing local database for repo ${1}..." - if [ ! -d "${locpkg_database}/${1}" ]; then - echo ":: Local database for repo ${1} does not exist, cloning..." -@@ -95,7 +96,7 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${ - [ ! -d "${locpkg_database}/${1}/${2}" ] && die "[E] Target not found." - install_local_package "${locpkg_database}/${1}/${2}" - } --upgrade() { -+upgrade() { # --- upgrades - echo ":: Upgrading installed packages..." - unset_config_values - cd "${installed_pkg_database}" || die "Could not enter installed package database. Exiting..." -@@ -117,7 +118,21 @@ upgrade() { +@@ -118,7 +118,7 @@ upgrade() { # --- upgrades unset pkg_config_depends done } --main() { -+help(){ -+ echo 'To install locally, do:' -+ echo 'aps install' -+ echo -+ echo 'To install from repo (synchronize), do:' -+ echo 'aps sync' -+ echo -+ echo 'To remove local packages, do:' -+ echo 'aps remove' -+ echo -+ echo 'To upgrade repos, do:' -+ echo 'aps upgrade' -+ echo +-help(){ ++help(){ # --- displays help + echo 'To install locally, do:' + echo 'aps install' + echo +@@ -132,6 +132,9 @@ help(){ + echo 'aps upgrade' + echo + } ++local_installed_list(){ # --- local installed list ++ ls ${installed_pkg_database} +} -+main() { # --- does soem stuff + main() { # --- does soem stuff if [ -f "${lock}" ]; then echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}." - exit 1 -@@ -131,6 +146,7 @@ main() { +@@ -146,7 +149,8 @@ main() { # --- does soem stuff [ -z "${2}" ] && die "[*] No targets specified." install_package_from_repo "official" "${2}" ;; upgrade) upgrade "official" ;; -+ help) help +- help) help ++ help) help ;; ++ list) local_installed_list ;; *) die "[E] Invalid option ${1}, exiting..." ;; esac rm "${lock}" +diff --git a/patch b/patch +index 890bc1b..e69de29 100644 +--- a/patch ++++ b/patch +@@ -1,79 +0,0 @@ +-diff --git a/aps b/aps +-index d7a4466..42918d3 100644 +---- a/aps +-+++ b/aps +-@@ -12,6 +12,7 @@ die() { +- exit 2 +- } +- run_package_script() { # --- $2 is the package path, and $1 is the script to run +-+ # --- RPS installs to root +- { +- if [ -x "${2}/${1}" ]; then +- echo ":: Running ${1}" +-@@ -20,7 +21,7 @@ run_package_script() { # --- $2 is the package path, and $1 is the script to run +- fi +- } +- } +--install_local_package() { +-+install_local_package() { # --- Install-Local-Package install package LOCALLY! +- [ ! -e "${1}" ] && die "[E] File ${1} does not exist. Exiting..." +- # Extract the package +- echo "[*] Copying package ${1} into temporary location ${temp_location}..." +-@@ -69,7 +70,7 @@ install_local_package() { +- unset pkg_config_makedepends +- unset pkg_config_depends +- } +--remove_local_package() { +-+remove_local_package() { # --- Removes local packges +- pkg_path="${installed_pkg_database}/${1}" +- [ ! -d "${pkg_path}" ] && die "Package could not be found in local installed package database. Exiting..." +- payloadfiles_path="${pkg_path}/payloadfiles" +-@@ -79,7 +80,7 @@ remove_local_package() { +- rm -rv "${pkg_path}" +- echo "[*] Removal complete for target ${pkg_name}" +- } +--sync_local_repo_database() { +-+sync_local_repo_database() { # --- syncs to local repo databese +- echo ":: Syncing local database for repo ${1}..." +- if [ ! -d "${locpkg_database}/${1}" ]; then +- echo ":: Local database for repo ${1} does not exist, cloning..." +-@@ -95,7 +96,7 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${ +- [ ! -d "${locpkg_database}/${1}/${2}" ] && die "[E] Target not found." +- install_local_package "${locpkg_database}/${1}/${2}" +- } +--upgrade() { +-+upgrade() { # --- upgrades +- echo ":: Upgrading installed packages..." +- unset_config_values +- cd "${installed_pkg_database}" || die "Could not enter installed package database. Exiting..." +-@@ -117,7 +118,21 @@ upgrade() { +- unset pkg_config_depends +- done +- } +--main() { +-+help(){ +-+ echo 'To install locally, do:' +-+ echo 'aps install' +-+ echo +-+ echo 'To install from repo (synchronize), do:' +-+ echo 'aps sync' +-+ echo +-+ echo 'To remove local packages, do:' +-+ echo 'aps remove' +-+ echo +-+ echo 'To upgrade repos, do:' +-+ echo 'aps upgrade' +-+ echo +-+} +-+main() { # --- does soem stuff +- if [ -f "${lock}" ]; then +- echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}." +- exit 1 +-@@ -131,6 +146,7 @@ main() { +- [ -z "${2}" ] && die "[*] No targets specified." +- install_package_from_repo "official" "${2}" ;; +- upgrade) upgrade "official" ;; +-+ help) help +- *) die "[E] Invalid option ${1}, exiting..." ;; +- esac +- rm "${lock}" -- 2.30.2 From c67293003715c44f5868a8b8b3444b5ca4b50c38 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 7 Jul 2021 12:18:20 +0200 Subject: [PATCH 04/10] added list option --- aps | 1 + 1 file changed, 1 insertion(+) diff --git a/aps b/aps index ceac685..ad07571 100644 --- a/aps +++ b/aps @@ -147,6 +147,7 @@ main() { # --- does soem stuff install_package_from_repo "official" "${2}" ;; upgrade) upgrade "official" ;; help) help ;; + list) local_installed_list ;; *) die "[E] Invalid option ${1}, exiting..." ;; esac rm "${lock}" -- 2.30.2 From 148dec47207246437d6c925e9def98fee2d83a72 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 7 Jul 2021 12:18:26 +0200 Subject: [PATCH 05/10] added list option --- patch | 203 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 104 insertions(+), 99 deletions(-) diff --git a/patch b/patch index 402f281..bce5ca3 100644 --- a/patch +++ b/patch @@ -1,117 +1,122 @@ -diff --git a/aps b/aps -index 8bc1ca3..3eefa4e 100644 ---- a/aps -+++ b/aps -@@ -118,7 +118,7 @@ upgrade() { # --- upgrades - unset pkg_config_depends - done - } --help(){ -+help(){ # --- displays help - echo 'To install locally, do:' - echo 'aps install' - echo -@@ -132,6 +132,9 @@ help(){ - echo 'aps upgrade' - echo - } -+local_installed_list(){ # --- local installed list -+ ls ${installed_pkg_database} -+} - main() { # --- does soem stuff - if [ -f "${lock}" ]; then - echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}." -@@ -146,7 +149,8 @@ main() { # --- does soem stuff - [ -z "${2}" ] && die "[*] No targets specified." - install_package_from_repo "official" "${2}" ;; - upgrade) upgrade "official" ;; -- help) help -+ help) help ;; -+ list) local_installed_list ;; - *) die "[E] Invalid option ${1}, exiting..." ;; - esac - rm "${lock}" diff --git a/patch b/patch -index 890bc1b..e69de29 100644 +index 402f281..e69de29 100644 --- a/patch +++ b/patch -@@ -1,79 +0,0 @@ +@@ -1,117 +0,0 @@ -diff --git a/aps b/aps --index d7a4466..42918d3 100644 +-index 8bc1ca3..3eefa4e 100644 ---- a/aps -+++ b/aps --@@ -12,6 +12,7 @@ die() { -- exit 2 -- } -- run_package_script() { # --- $2 is the package path, and $1 is the script to run --+ # --- RPS installs to root -- { -- if [ -x "${2}/${1}" ]; then -- echo ":: Running ${1}" --@@ -20,7 +21,7 @@ run_package_script() { # --- $2 is the package path, and $1 is the script to run -- fi -- } -- } ---install_local_package() { --+install_local_package() { # --- Install-Local-Package install package LOCALLY! -- [ ! -e "${1}" ] && die "[E] File ${1} does not exist. Exiting..." -- # Extract the package -- echo "[*] Copying package ${1} into temporary location ${temp_location}..." --@@ -69,7 +70,7 @@ install_local_package() { -- unset pkg_config_makedepends -- unset pkg_config_depends -- } ---remove_local_package() { --+remove_local_package() { # --- Removes local packges -- pkg_path="${installed_pkg_database}/${1}" -- [ ! -d "${pkg_path}" ] && die "Package could not be found in local installed package database. Exiting..." -- payloadfiles_path="${pkg_path}/payloadfiles" --@@ -79,7 +80,7 @@ remove_local_package() { -- rm -rv "${pkg_path}" -- echo "[*] Removal complete for target ${pkg_name}" -- } ---sync_local_repo_database() { --+sync_local_repo_database() { # --- syncs to local repo databese -- echo ":: Syncing local database for repo ${1}..." -- if [ ! -d "${locpkg_database}/${1}" ]; then -- echo ":: Local database for repo ${1} does not exist, cloning..." --@@ -95,7 +96,7 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${ -- [ ! -d "${locpkg_database}/${1}/${2}" ] && die "[E] Target not found." -- install_local_package "${locpkg_database}/${1}/${2}" -- } ---upgrade() { --+upgrade() { # --- upgrades -- echo ":: Upgrading installed packages..." -- unset_config_values -- cd "${installed_pkg_database}" || die "Could not enter installed package database. Exiting..." --@@ -117,7 +118,21 @@ upgrade() { +-@@ -118,7 +118,7 @@ upgrade() { # --- upgrades - unset pkg_config_depends - done - } ---main() { --+help(){ --+ echo 'To install locally, do:' --+ echo 'aps install' --+ echo --+ echo 'To install from repo (synchronize), do:' --+ echo 'aps sync' --+ echo --+ echo 'To remove local packages, do:' --+ echo 'aps remove' --+ echo --+ echo 'To upgrade repos, do:' --+ echo 'aps upgrade' --+ echo +--help(){ +-+help(){ # --- displays help +- echo 'To install locally, do:' +- echo 'aps install' +- echo +-@@ -132,6 +132,9 @@ help(){ +- echo 'aps upgrade' +- echo +- } +-+local_installed_list(){ # --- local installed list +-+ ls ${installed_pkg_database} -+} --+main() { # --- does soem stuff +- main() { # --- does soem stuff - if [ -f "${lock}" ]; then - echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}." -- exit 1 --@@ -131,6 +146,7 @@ main() { +-@@ -146,7 +149,8 @@ main() { # --- does soem stuff - [ -z "${2}" ] && die "[*] No targets specified." - install_package_from_repo "official" "${2}" ;; - upgrade) upgrade "official" ;; --+ help) help +-- help) help +-+ help) help ;; +-+ list) local_installed_list ;; - *) die "[E] Invalid option ${1}, exiting..." ;; - esac - rm "${lock}" +-diff --git a/patch b/patch +-index 890bc1b..e69de29 100644 +---- a/patch +-+++ b/patch +-@@ -1,79 +0,0 @@ +--diff --git a/aps b/aps +--index d7a4466..42918d3 100644 +----- a/aps +--+++ b/aps +--@@ -12,6 +12,7 @@ die() { +-- exit 2 +-- } +-- run_package_script() { # --- $2 is the package path, and $1 is the script to run +--+ # --- RPS installs to root +-- { +-- if [ -x "${2}/${1}" ]; then +-- echo ":: Running ${1}" +--@@ -20,7 +21,7 @@ run_package_script() { # --- $2 is the package path, and $1 is the script to run +-- fi +-- } +-- } +---install_local_package() { +--+install_local_package() { # --- Install-Local-Package install package LOCALLY! +-- [ ! -e "${1}" ] && die "[E] File ${1} does not exist. Exiting..." +-- # Extract the package +-- echo "[*] Copying package ${1} into temporary location ${temp_location}..." +--@@ -69,7 +70,7 @@ install_local_package() { +-- unset pkg_config_makedepends +-- unset pkg_config_depends +-- } +---remove_local_package() { +--+remove_local_package() { # --- Removes local packges +-- pkg_path="${installed_pkg_database}/${1}" +-- [ ! -d "${pkg_path}" ] && die "Package could not be found in local installed package database. Exiting..." +-- payloadfiles_path="${pkg_path}/payloadfiles" +--@@ -79,7 +80,7 @@ remove_local_package() { +-- rm -rv "${pkg_path}" +-- echo "[*] Removal complete for target ${pkg_name}" +-- } +---sync_local_repo_database() { +--+sync_local_repo_database() { # --- syncs to local repo databese +-- echo ":: Syncing local database for repo ${1}..." +-- if [ ! -d "${locpkg_database}/${1}" ]; then +-- echo ":: Local database for repo ${1} does not exist, cloning..." +--@@ -95,7 +96,7 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${ +-- [ ! -d "${locpkg_database}/${1}/${2}" ] && die "[E] Target not found." +-- install_local_package "${locpkg_database}/${1}/${2}" +-- } +---upgrade() { +--+upgrade() { # --- upgrades +-- echo ":: Upgrading installed packages..." +-- unset_config_values +-- cd "${installed_pkg_database}" || die "Could not enter installed package database. Exiting..." +--@@ -117,7 +118,21 @@ upgrade() { +-- unset pkg_config_depends +-- done +-- } +---main() { +--+help(){ +--+ echo 'To install locally, do:' +--+ echo 'aps install' +--+ echo +--+ echo 'To install from repo (synchronize), do:' +--+ echo 'aps sync' +--+ echo +--+ echo 'To remove local packages, do:' +--+ echo 'aps remove' +--+ echo +--+ echo 'To upgrade repos, do:' +--+ echo 'aps upgrade' +--+ echo +--+} +--+main() { # --- does soem stuff +-- if [ -f "${lock}" ]; then +-- echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}." +-- exit 1 +--@@ -131,6 +146,7 @@ main() { +-- [ -z "${2}" ] && die "[*] No targets specified." +-- install_package_from_repo "official" "${2}" ;; +-- upgrade) upgrade "official" ;; +--+ help) help +-- *) die "[E] Invalid option ${1}, exiting..." ;; +-- esac +-- rm "${lock}" -- 2.30.2 From 67824e636c9729e9a05cfb95896966a0f787938a Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Wed, 7 Jul 2021 12:49:36 +0200 Subject: [PATCH 06/10] aps patch --- patch | 122 ---------------------------------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 patch diff --git a/patch b/patch deleted file mode 100644 index bce5ca3..0000000 --- a/patch +++ /dev/null @@ -1,122 +0,0 @@ -diff --git a/patch b/patch -index 402f281..e69de29 100644 ---- a/patch -+++ b/patch -@@ -1,117 +0,0 @@ --diff --git a/aps b/aps --index 8bc1ca3..3eefa4e 100644 ----- a/aps --+++ b/aps --@@ -118,7 +118,7 @@ upgrade() { # --- upgrades -- unset pkg_config_depends -- done -- } ---help(){ --+help(){ # --- displays help -- echo 'To install locally, do:' -- echo 'aps install' -- echo --@@ -132,6 +132,9 @@ help(){ -- echo 'aps upgrade' -- echo -- } --+local_installed_list(){ # --- local installed list --+ ls ${installed_pkg_database} --+} -- main() { # --- does soem stuff -- if [ -f "${lock}" ]; then -- echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}." --@@ -146,7 +149,8 @@ main() { # --- does soem stuff -- [ -z "${2}" ] && die "[*] No targets specified." -- install_package_from_repo "official" "${2}" ;; -- upgrade) upgrade "official" ;; --- help) help --+ help) help ;; --+ list) local_installed_list ;; -- *) die "[E] Invalid option ${1}, exiting..." ;; -- esac -- rm "${lock}" --diff --git a/patch b/patch --index 890bc1b..e69de29 100644 ----- a/patch --+++ b/patch --@@ -1,79 +0,0 @@ ---diff --git a/aps b/aps ---index d7a4466..42918d3 100644 ------ a/aps ---+++ b/aps ---@@ -12,6 +12,7 @@ die() { --- exit 2 --- } --- run_package_script() { # --- $2 is the package path, and $1 is the script to run ---+ # --- RPS installs to root --- { --- if [ -x "${2}/${1}" ]; then --- echo ":: Running ${1}" ---@@ -20,7 +21,7 @@ run_package_script() { # --- $2 is the package path, and $1 is the script to run --- fi --- } --- } ----install_local_package() { ---+install_local_package() { # --- Install-Local-Package install package LOCALLY! --- [ ! -e "${1}" ] && die "[E] File ${1} does not exist. Exiting..." --- # Extract the package --- echo "[*] Copying package ${1} into temporary location ${temp_location}..." ---@@ -69,7 +70,7 @@ install_local_package() { --- unset pkg_config_makedepends --- unset pkg_config_depends --- } ----remove_local_package() { ---+remove_local_package() { # --- Removes local packges --- pkg_path="${installed_pkg_database}/${1}" --- [ ! -d "${pkg_path}" ] && die "Package could not be found in local installed package database. Exiting..." --- payloadfiles_path="${pkg_path}/payloadfiles" ---@@ -79,7 +80,7 @@ remove_local_package() { --- rm -rv "${pkg_path}" --- echo "[*] Removal complete for target ${pkg_name}" --- } ----sync_local_repo_database() { ---+sync_local_repo_database() { # --- syncs to local repo databese --- echo ":: Syncing local database for repo ${1}..." --- if [ ! -d "${locpkg_database}/${1}" ]; then --- echo ":: Local database for repo ${1} does not exist, cloning..." ---@@ -95,7 +96,7 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${ --- [ ! -d "${locpkg_database}/${1}/${2}" ] && die "[E] Target not found." --- install_local_package "${locpkg_database}/${1}/${2}" --- } ----upgrade() { ---+upgrade() { # --- upgrades --- echo ":: Upgrading installed packages..." --- unset_config_values --- cd "${installed_pkg_database}" || die "Could not enter installed package database. Exiting..." ---@@ -117,7 +118,21 @@ upgrade() { --- unset pkg_config_depends --- done --- } ----main() { ---+help(){ ---+ echo 'To install locally, do:' ---+ echo 'aps install' ---+ echo ---+ echo 'To install from repo (synchronize), do:' ---+ echo 'aps sync' ---+ echo ---+ echo 'To remove local packages, do:' ---+ echo 'aps remove' ---+ echo ---+ echo 'To upgrade repos, do:' ---+ echo 'aps upgrade' ---+ echo ---+} ---+main() { # --- does soem stuff --- if [ -f "${lock}" ]; then --- echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}." --- exit 1 ---@@ -131,6 +146,7 @@ main() { --- [ -z "${2}" ] && die "[*] No targets specified." --- install_package_from_repo "official" "${2}" ;; --- upgrade) upgrade "official" ;; ---+ help) help --- *) die "[E] Invalid option ${1}, exiting..." ;; --- esac --- rm "${lock}" -- 2.30.2 From 9960ac76751fc2e3380ecaeb13016d6c5891dc6c Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Mon, 12 Jul 2021 05:18:05 +0200 Subject: [PATCH 07/10] add wiki --- aps | 3 +++ wiki/APS.md | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 wiki/APS.md diff --git a/aps b/aps index ad07571..ecb8560 100644 --- a/aps +++ b/aps @@ -132,6 +132,9 @@ help(){ echo 'aps upgrade' echo } +local_installed_list(){ + ls ${locpkg_database} +} main() { # --- does soem stuff if [ -f "${lock}" ]; then echo "[E] A lock file already exists. If you're sure no package manager is running, remove the file ${lock}." diff --git a/wiki/APS.md b/wiki/APS.md new file mode 100644 index 0000000..238eaa6 --- /dev/null +++ b/wiki/APS.md @@ -0,0 +1,23 @@ +### BEGGINING +Now basic deps for aps are `make`, `gcc`, `git`. So, using aps, there are some variables, so, let's see them. +### VARIABLES +- `temp_location` is as says ***it's a temporary location***. +- `install_root` is as (again) as says ***it's a install root***. +- `installed_pkg_databese` is a ***database of installed pkgs*** for *APS*. +- `locpkg_database` is a ***database of pkgs in the repo*** that are for *APS* +- `lock` locks the package manager +### FUNCTIONS +The standard APS functions are as, follows: +- `install` installs **but locally** +- `sync` serves as update and install from repo +- `remove` removes packages +- `upgrade` upgrades installed packages +- `help` displays help +- `list` lists packages +### SETUP & INSTALL +Let's get an iso, i, personally (author, Ohio2) prefer [xubuntu](https://xubuntu.org/). You got an iso, congrats! Now flash it with some flashing software, like, [balenaEtcher](https://www.balena.io/etcher/) to your usb or something. If you boot up the iso & *you select i want to try out xubuntu*, you'll land up on xfce. Go to start > terminal. Now if you setup partitions earlier on, skip it. Now type in `sudo -i gparted`, make a msdos partition table, make two new partitions, one that's your disk size or whatever you prefer -512M and a second one... that's 512M large. Ok save and write. Mount /dev/sda1 to wherever you want, now wget aps: `wget https://git.hippoz.xyz/alnux/aps/raw/branch/master/aps`, edit aps to `install_root` variable to wherever you mounted /dev/sda1. If you want to, add make default variables like this, edit /etc/make.conf add `MAKEOPTS=-j` whatever was your processor number by x1.5 and save. Now that's done let's sync our first package, `aps sync make` and all for the packages that you want... `aps list`. Now do `mount /dev/sda2 /mnt/boot`, `aps sync grub-configmake` and run `/usr/bin/grub-configmake`, it should do all the necessary things... Now you can compile linux... get it from it's source to wherever you pick, do what you need to do, configure it by `make menuconfig`, make `make`, install `make modules_install DESTDIR="" && make install DESTDIR="` and mount every root directory with `-o rebind` and chroot andd install grub via grub-install --root-directory=, you can reboot now, and you can boot +### TROUBLESHOOTING +Git or Gzip need zlib +- `apt install zlib1g-dev` +Linux to compile needs: +- `apt install bison flex libssl-dev` -- 2.30.2 From 30135cbbbefdccb66bedf0af96a6b9ff739df3b5 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Mon, 12 Jul 2021 16:28:44 +0200 Subject: [PATCH 08/10] wiki/APS.md --- wiki/APS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/APS.md b/wiki/APS.md index 238eaa6..9b85d22 100644 --- a/wiki/APS.md +++ b/wiki/APS.md @@ -17,7 +17,7 @@ The standard APS functions are as, follows: ### SETUP & INSTALL Let's get an iso, i, personally (author, Ohio2) prefer [xubuntu](https://xubuntu.org/). You got an iso, congrats! Now flash it with some flashing software, like, [balenaEtcher](https://www.balena.io/etcher/) to your usb or something. If you boot up the iso & *you select i want to try out xubuntu*, you'll land up on xfce. Go to start > terminal. Now if you setup partitions earlier on, skip it. Now type in `sudo -i gparted`, make a msdos partition table, make two new partitions, one that's your disk size or whatever you prefer -512M and a second one... that's 512M large. Ok save and write. Mount /dev/sda1 to wherever you want, now wget aps: `wget https://git.hippoz.xyz/alnux/aps/raw/branch/master/aps`, edit aps to `install_root` variable to wherever you mounted /dev/sda1. If you want to, add make default variables like this, edit /etc/make.conf add `MAKEOPTS=-j` whatever was your processor number by x1.5 and save. Now that's done let's sync our first package, `aps sync make` and all for the packages that you want... `aps list`. Now do `mount /dev/sda2 /mnt/boot`, `aps sync grub-configmake` and run `/usr/bin/grub-configmake`, it should do all the necessary things... Now you can compile linux... get it from it's source to wherever you pick, do what you need to do, configure it by `make menuconfig`, make `make`, install `make modules_install DESTDIR="" && make install DESTDIR="` and mount every root directory with `-o rebind` and chroot andd install grub via grub-install --root-directory=, you can reboot now, and you can boot ### TROUBLESHOOTING -Git or Gzip need zlib +Git or Gzip need zlib: - `apt install zlib1g-dev` Linux to compile needs: - `apt install bison flex libssl-dev` -- 2.30.2 From 8939ea700fdf6c65d81541b97947022fb9b93462 Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Tue, 13 Jul 2021 22:51:57 +0200 Subject: [PATCH 09/10] i forgot to push --- aps | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/aps b/aps index ecb8560..f1a761c 100644 --- a/aps +++ b/aps @@ -1,4 +1,5 @@ #!/bin/sh +user="$(whoami)" temp_location="/tmp" install_root="/tmp/alroot" installed_pkg_database="${install_root}/var/aps/installed" @@ -11,6 +12,13 @@ die() { rm "${lock}" exit 2 } +verify(){ + if [ ${user} != root ] + die "[E] Please run this option as root!" + else + #do nothing + fi +} run_package_script() { # --- $2 is the package path, and $1 is the script to run # --- RPS installs to root { @@ -19,12 +27,13 @@ run_package_script() { # --- $2 is the package path, and $1 is the script to run cd "${2}" || die "Could not enter package working directory. Exiting..." "${2}/${1}" "${2}/payload" "${2}" fi - } + } } install_local_package() { # --- Install-Local-Package install package LOCALLY! [ ! -e "${1}" ] && die "[E] File ${1} does not exist. Exiting..." # Extract the package echo "[*] Copying package ${1} into temporary location ${temp_location}..." + verify cp -prv "${1}" "${temp_location}" pkg_name="${1%/}" pkg_name="${pkg_name##*/}" @@ -38,7 +47,7 @@ install_local_package() { # --- Install-Local-Package install package LOCALLY! pkg_config_depends="" # Install package . "${pkg_path}/package" - run_package_script "build" "${pkg_path}" + run_package_script "build" "${pkg_path}" run_package_script "predeploy" "${pkg_path}" # Deploy package if [ "${pkg_config_deploy}" = true ]; then @@ -71,6 +80,7 @@ install_local_package() { # --- Install-Local-Package install package LOCALLY! unset pkg_config_depends } remove_local_package() { # --- Removes local packges + verify pkg_path="${installed_pkg_database}/${1}" [ ! -d "${pkg_path}" ] && die "Package could not be found in local installed package database. Exiting..." payloadfiles_path="${pkg_path}/payloadfiles" @@ -82,6 +92,7 @@ remove_local_package() { # --- Removes local packges } sync_local_repo_database() { # --- syncs to local repo databese echo ":: Syncing local database for repo ${1}..." + verify if [ ! -d "${locpkg_database}/${1}" ]; then echo ":: Local database for repo ${1} does not exist, cloning..." git clone "${2}" "${locpkg_database}/${1}" @@ -98,6 +109,7 @@ install_package_from_repo() { # NOTE(hippoz): This can get a tad confusing... ${ } upgrade() { # --- upgrades echo ":: Upgrading installed packages..." + verify unset_config_values cd "${installed_pkg_database}" || die "Could not enter installed package database. Exiting..." for pkg in */; do -- 2.30.2 From d0c0857d3c9d99c9e54a824b7d2679b2c08e7c9d Mon Sep 17 00:00:00 2001 From: Ohio2 Date: Tue, 13 Jul 2021 22:52:05 +0200 Subject: [PATCH 10/10] i forgot to push --- wiki/APS.md | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 wiki/APS.md diff --git a/wiki/APS.md b/wiki/APS.md deleted file mode 100644 index 9b85d22..0000000 --- a/wiki/APS.md +++ /dev/null @@ -1,23 +0,0 @@ -### BEGGINING -Now basic deps for aps are `make`, `gcc`, `git`. So, using aps, there are some variables, so, let's see them. -### VARIABLES -- `temp_location` is as says ***it's a temporary location***. -- `install_root` is as (again) as says ***it's a install root***. -- `installed_pkg_databese` is a ***database of installed pkgs*** for *APS*. -- `locpkg_database` is a ***database of pkgs in the repo*** that are for *APS* -- `lock` locks the package manager -### FUNCTIONS -The standard APS functions are as, follows: -- `install` installs **but locally** -- `sync` serves as update and install from repo -- `remove` removes packages -- `upgrade` upgrades installed packages -- `help` displays help -- `list` lists packages -### SETUP & INSTALL -Let's get an iso, i, personally (author, Ohio2) prefer [xubuntu](https://xubuntu.org/). You got an iso, congrats! Now flash it with some flashing software, like, [balenaEtcher](https://www.balena.io/etcher/) to your usb or something. If you boot up the iso & *you select i want to try out xubuntu*, you'll land up on xfce. Go to start > terminal. Now if you setup partitions earlier on, skip it. Now type in `sudo -i gparted`, make a msdos partition table, make two new partitions, one that's your disk size or whatever you prefer -512M and a second one... that's 512M large. Ok save and write. Mount /dev/sda1 to wherever you want, now wget aps: `wget https://git.hippoz.xyz/alnux/aps/raw/branch/master/aps`, edit aps to `install_root` variable to wherever you mounted /dev/sda1. If you want to, add make default variables like this, edit /etc/make.conf add `MAKEOPTS=-j` whatever was your processor number by x1.5 and save. Now that's done let's sync our first package, `aps sync make` and all for the packages that you want... `aps list`. Now do `mount /dev/sda2 /mnt/boot`, `aps sync grub-configmake` and run `/usr/bin/grub-configmake`, it should do all the necessary things... Now you can compile linux... get it from it's source to wherever you pick, do what you need to do, configure it by `make menuconfig`, make `make`, install `make modules_install DESTDIR="" && make install DESTDIR="` and mount every root directory with `-o rebind` and chroot andd install grub via grub-install --root-directory=, you can reboot now, and you can boot -### TROUBLESHOOTING -Git or Gzip need zlib: -- `apt install zlib1g-dev` -Linux to compile needs: -- `apt install bison flex libssl-dev` -- 2.30.2