diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-06-26 11:32:34 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-06-26 11:32:34 +0100 |
commit | 9bace987b61523b1d95518e1e8072404242bd34b (patch) | |
tree | dfa07ba220fe6372884af46c6bb0d1412126bd48 | |
parent | 6d8090456cbe6ddf11d285cf4059df30b6e627af (diff) |
kill old backend
-rwxr-xr-x | src/backend/libsisyphus.sh | 179 | ||||
-rwxr-xr-x | src/frontend/cli/sisyphus-cli.sh | 116 |
2 files changed, 0 insertions, 295 deletions
diff --git a/src/backend/libsisyphus.sh b/src/backend/libsisyphus.sh deleted file mode 100755 index 530f9bf..0000000 --- a/src/backend/libsisyphus.sh +++ /dev/null @@ -1,179 +0,0 @@ -#!/usr/bin/env bash - -# import gentoo functions -source /lib/gentoo/functions.sh - -checkroot () { - if [[ "$(whoami)" != root ]] ; then - eerror "You're not root?...No cookies for you, go away !!!" - exit 1 - fi -} - -checksystemmode() { - if [[ "$(readlink -f "/etc/portage/make.conf")" = /opt/redcore-build/conf/intel/portage/make.conf.amd64-srcmode ]] ; then - eerror "The system is set to srcmode (full Gentoo mode), cowardly refusing to run!" - exit 1 - fi -} - -checkportageconfig () { - pushd /opt/redcore-build > /dev/null 2>&1 - git remote update > /dev/null 2>&1 - export local confhash=$(git rev-parse @) - export local rconfhash=$(git rev-parse @{u}) - if [ $confhash != $rconfhash ] ; then - eerror "Portage config is out-of-date, run "sisyphus update" first" - exit 1 - fi - popd > /dev/null 2>&1 -} - -checkportagetree () { - pushd /usr/portage > /dev/null 2>&1 - git remote update > /dev/null 2>&1 - export local treehash=$(git rev-parse @) - export local rtreehash=$(git rev-parse @{u}) - if [ $treehash != $rtreehash ] ; then - eerror "Portage tree is out-of-date, run "sisyphus update" first" - exit 1 - fi - popd > /dev/null 2>&1 -} - -checkredcoreoverlay () { - pushd /var/lib/layman/redcore-desktop > /dev/null 2>&1 - git remote update > /dev/null 2>&1 - export local overlayhash=$(git rev-parse @) - export local roverlayhash=$(git rev-parse @{u}) - if [ $overlayhash != $roverlayhash ] ; then - eerror "Redcore Desktop overlay is out-of-date, run "sisyphus update" first" - exit 1 - fi -} - -remotedbcsvget () { - if [[ ! -f /var/lib/sisyphus/csv/remote_preinst.csv ]] ; then - pushd /var/lib/sisyphus/csv > /dev/null 2>&1 - touch remote_preinst.csv - wget -c http://mirror.math.princeton.edu/pub/redcorelinux/csv/remote_preinst.csv -O remote_postinst.csv > /dev/null 2>&1 - popd > /dev/null 2>&1 - elif [[ -f /var/lib/sisyphus/csv/remote_preinst.csv ]] ; then - pushd /var/lib/sisyphus/csv > /dev/null 2>&1 - wget -c http://mirror.math.princeton.edu/pub/redcorelinux/csv/remote_preinst.csv -O remote_postinst.csv > /dev/null 2>&1 - popd > /dev/null 2>&1 - fi -} - -remotedbcsvcheck () { - if ! cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then - eerror "SisyphusDB : "remote_packages" table is out-of-date, run "sisyphus update" first" - rm -rf /var/lib/sisyphus/csv/remote_postinst.csv - exit 1 - elif cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then - rm -rf /var/lib/sisyphus/csv/remote_postinst.csv - fi -} - -checkremotedb () { - remotedbcsvget - remotedbcsvcheck -} - -checksync () { - checkroot - checkportagetree - checkredcoreoverlay - checkportageconfig - checkremotedb -} - -syncrepos () { - emerge --sync -} - -syncportageconfig () { - pushd /opt/redcore-build > /dev/null 2>&1 - echo ">>> Syncing 'portage config' into '/etc/portage'..." - echo "/usr/bin/git pull" - git pull - echo "=== Sync completed for 'portage config'" - popd > /dev/null 2>&1 -} - -remotedbcsvsync () { - if ! cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then - echo ">>> Syncing 'SisyphusDB remote_packages' into '/var/lib/sisyphus/db/sisyphus.db'" - echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" - pushd /var/lib/sisyphus/db > /dev/null 2>&1 - sqlite3 -echo sisyphus.db<<-EXIT_HERE - drop table if exists remote_packages; - create table remote_packages (category TEXT,name TEXT,version TEXT,slot TEXT,description TEXT); - .mode csv - .import /var/lib/sisyphus/csv/remote_postinst.csv remote_packages - EXIT_HERE - popd > /dev/null 2>&1 - echo "=== Sync completed for 'SisyphusDB remote_packages'" - elif cmp /var/lib/sisyphus/csv/remote_preinst.csv /var/lib/sisyphus/csv/remote_postinst.csv > /dev/null 2>&1 ; then - echo ">>> Syncing 'SisyphusDB remote_packages' into '/var/lib/sisyphus/db/sisyphus.db'" - echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" - echo "Already up-to-date." - echo "=== Sync completed for 'SisyphusDB remote_packages'" - fi - mv /var/lib/sisyphus/csv/remote_postinst.csv /var/lib/sisyphus/csv/remote_preinst.csv -} - -syncremotedb() { - remotedbcsvget - remotedbcsvsync -} - -redcoresync () { - checkroot - syncrepos - syncportageconfig - syncremotedb -} - -localdbcsvpre () { - if [[ ! -f /var/lib/sisyphus/csv/local_preinst.csv ]] ; then - for i in $(qlist -ICv); do - pushd /var/db/pkg/$i > /dev/null 2>&1 - echo "$(<CATEGORY),$(sed -re "s/-([0-9])/,\1/" <PF),$(<SLOT),$(sed -e "s/\"//g" -e "s/\'//g" -e "s/\,//g" <DESCRIPTION)" >> /var/lib/sisyphus/csv/local_preinst.csv - popd > /dev/null 2>&1 - done - fi -} - -localdbcsvpost () { - for i in $(qlist -ICv); do - pushd /var/db/pkg/$i > /dev/null 2>&1 - echo "$(<CATEGORY),$(sed -re "s/-([0-9])/,\1/" <PF),$(<SLOT),$(sed -e "s/\"//g" -e "s/\'//g" -e "s/\,//g" <DESCRIPTION)" >> /var/lib/sisyphus/csv/local_postinst.csv - popd > /dev/null 2>&1 - done -} - -localdbcsvsync () { - if cmp /var/lib/sisyphus/csv/local_preinst.csv /var/lib/sisyphus/csv/local_postinst.csv > /dev/null 2>&1 ; then - einfo "'PortageDB' && 'SisyphusDB local_packages' are in sync, nothing to do..." - else - einfo "'PortageDB' && 'SisyphusDB local_packages' are out of sync, syncing now..." - echo "/usr/bin/sqlite3 /var/lib/sisyphus/db/sisyphus.db" - pushd /var/lib/sisyphus/db > /dev/null 2>&1 - sqlite3 -echo sisyphus.db<<-EXIT_HERE - drop table if exists local_packages; - create table local_packages (category TEXT,name TEXT,version TEXT,slot TEXT,description TEXT); - .mode csv - .import /var/lib/sisyphus/csv/local_postinst.csv local_packages - EXIT_HERE - popd > /dev/null 2>&1 - einfo "'PortageDB' && 'SisyphusDB local_packages' resync complete..." - fi - mv /var/lib/sisyphus/csv/local_postinst.csv /var/lib/sisyphus/csv/local_preinst.csv -} - -updatelocaldb () { - checkroot - localdbcsvpost - localdbcsvsync -} diff --git a/src/frontend/cli/sisyphus-cli.sh b/src/frontend/cli/sisyphus-cli.sh deleted file mode 100755 index 79023aa..0000000 --- a/src/frontend/cli/sisyphus-cli.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env bash - -source /usr/lib/sisyphus/libsisyphus.sh - -checksystemmode - -action=$1 -shift - -case "$action" in - install) - checksync - localdbcsvpre - emerge -a "$@" - updatelocaldb - ;; - uninstall) - checksync - localdbcsvpre - emerge --depclean -a "$@" - updatelocaldb - ;; - force-uninstall) - checksync - localdbcsvpre - emerge --unmerge -a "$@" - updatelocaldb - ;; - remove-orphans) - checksync - localdbcsvpre - emerge --depclean -a - updatelocaldb - ;; - upgrade) - checksync - localdbcsvpre - emerge -uDaN --with-bdeps=y @system @world "$@" - updatelocaldb - ;; - auto-install) - redcoresync - localdbcsvpre - emerge "$@" - updatelocaldb - ;; - auto-uninstall) - redcoresync - localdbcsvpre - emerge --depclean "$@" - updatelocaldb - ;; - auto-force-uninstall) - redcoresync - localdbcsvpre - emerge --unmerge "$@" - updatelocaldb - ;; - auto-remove-orphans) - redcoresync - localdbcsvpre - emerge --depclean -q - updatelocaldb - ;; - auto-upgrade) - redcoresync - localdbcsvpre - emerge -uDN --with-bdeps=y @system @world "$@" - updatelocaldb - ;; - search) - emerge -s "$@" - ;; - update) - redcoresync - ;; - belongs) - equery belongs "$@" - ;; - depends) - equery depends "$@" - ;; - files) - equery files "$@" - ;; - sysinfo) - emerge --info - ;; - *) - cat <<-"EOH" - Usage: sisyphus command [package(s)] - - sisyphus is a simple wrapper around portage, gentoolkit, and portage-utils that provides an - apt-get/yum-alike interface to these commands, to assist people transitioning from - Debian/RedHat-based systems to Gentoo. - - Commands : - install - Install new packages - uninstall - Uninstall packages safely - force-uninstall - *Unsafely* uninstall packages - remove-orphans - Uninstall packages that are no longer needed - upgrade - Upgrade system - auto-install - Install new packages (no confirmation) - auto-uninstall - Uninstall packages safely (no confirmation) - auto-force-uninstall - *Unsafely* uninstall packages (no confirmation) - auto-remove-orphans - Uninstall packages that are no longer needed (no confirmation) - auto-upgrade - Upgrade system (no confirmation) - search - Search for packages - update - Resync portage tree, portage config && redcore overlay - belongs - List what package FILE(s) belong to - depends - List all packages directly depending on given package - files - List all files installed by package - sysinfo - Display information about installed core packages and portage configuration - EOH - ;; -esac |