summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@rogentos.ro>2016-11-18 18:34:54 +0000
committerV3n3RiX <venerix@rogentos.ro>2016-11-18 18:34:54 +0000
commitf0de9ffcc540de0499f37b656f7564a89c85314a (patch)
tree1024ecf6da85a079f85a02eb36012b91acac3743
parent2a36e3cccf1213b7f2c2d6afdc8ba7ae07475452 (diff)
merge resetmode script into libvasile
-rwxr-xr-xlibvasile27
-rwxr-xr-xresetmode27
-rwxr-xr-xvasile2
3 files changed, 28 insertions, 28 deletions
diff --git a/libvasile b/libvasile
index 37477ca..06a7502 100755
--- a/libvasile
+++ b/libvasile
@@ -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
diff --git a/vasile b/vasile
index 68e9c4a..c360f1c 100755
--- a/vasile
+++ b/vasile
@@ -24,7 +24,7 @@ case $1 in
makeiso
;;
--resetmode)
- source /usr/share/vasile/resetmode
+ resetmode
;;
--binmode)
source /usr/share/vasile/resetmode