diff options
author | V3n3RiX <venerix@rogentos.ro> | 2016-11-18 18:34:54 +0000 |
---|---|---|
committer | V3n3RiX <venerix@rogentos.ro> | 2016-11-18 18:34:54 +0000 |
commit | f0de9ffcc540de0499f37b656f7564a89c85314a (patch) | |
tree | 1024ecf6da85a079f85a02eb36012b91acac3743 | |
parent | 2a36e3cccf1213b7f2c2d6afdc8ba7ae07475452 (diff) |
merge resetmode script into libvasile
-rwxr-xr-x | libvasile | 27 | ||||
-rwxr-xr-x | resetmode | 27 | ||||
-rwxr-xr-x | vasile | 2 |
3 files changed, 28 insertions, 28 deletions
@@ -324,3 +324,30 @@ makeiso () { cleanupiso makeisoimg } + +# modechange functions + +removeportagetree() { + if [ -d ""$portagedir"/.git" ] ; then + find "$portagedir" -mindepth 1 -name "packages" -prune -o -name "distfiles" -prune -o -exec rm -rf {} \; > /dev/null 2>&1 + fi +} + +removeportageconfig() { + rm ""$confdir"/make.conf" > /dev/null 2>&1 + rm ""$confdir"/make.profile" > /dev/null 2>&1 + rm "$confdir" > /dev/null 2>&1 + rm -rf "$clonedir" > /dev/null 2>&1 +} + +resetmode () { + removeportagetree + removeportageconfig +} + +fetchportageconfig() { + pushd /opt > /dev/null 2>&1 + git clone https://gitlab.com/redcore/redcore-build.git > /dev/null 2>&1 + popd > /dev/null 2>&1 +} + diff --git a/resetmode b/resetmode deleted file mode 100755 index 6268998..0000000 --- a/resetmode +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -empty_portage_tree() { - if [ -d ""$portagedir"/.git" ] ; then - find "$portagedir" -mindepth 1 -name "packages" -prune -o -name "distfiles" -prune -o -exec rm -rf {} \; > /dev/null 2>&1 - fi -} - -reset_portage_config() { - rm ""$confdir"/make.conf" - rm ""$confdir"/make.profile" - rm "$confdir" - rm -rf "$clonedir" -} - -fetch_portage_config() { - pushd /opt > /dev/null 2>&1 - git clone https://gitlab.com/redcore/redcore-build.git > /dev/null 2>&1 - popd > /dev/null 2>&1 -} - -main () { - empty_portage_tree - reset_portage_config - fetch_portage_config -} -main @@ -24,7 +24,7 @@ case $1 in makeiso ;; --resetmode) - source /usr/share/vasile/resetmode + resetmode ;; --binmode) source /usr/share/vasile/resetmode |