forked from mirrored-repos/manjaro-tools
reorganizing lib
This commit is contained in:
parent
ba2634b8b6
commit
a4686bb42c
12 changed files with 56 additions and 71 deletions
|
@ -10,8 +10,12 @@
|
|||
|
||||
shopt -s extglob
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
if [[ -r @libdir@/mount-api.sh ]];then
|
||||
source @libdir@/mount-api.sh
|
||||
fi
|
||||
|
||||
newroot=/mnt
|
||||
|
|
|
@ -8,8 +8,12 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
if [[ -r @libdir@/build-api.sh ]];then
|
||||
source @libdir@/build-api.sh
|
||||
fi
|
||||
|
||||
run(){
|
||||
|
|
|
@ -8,8 +8,12 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
if [[ -r @libdir@/util.sh ]];then
|
||||
source @libdir@/util.sh
|
||||
fi
|
||||
|
||||
# Source makepkg.conf; fail if it is not found
|
||||
|
|
|
@ -8,8 +8,12 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
if [[ -r @libdir@/util.sh ]];then
|
||||
source @libdir@/util.sh
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
match=$1
|
||||
|
|
|
@ -10,8 +10,12 @@
|
|||
|
||||
shopt -s extglob
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
if [[ -r @libdir@/mount-api.sh ]];then
|
||||
source @libdir@/mount-api.sh
|
||||
fi
|
||||
|
||||
write_source() {
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
ifs=$IFS
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
if [[ -r @libdir@/build-api.sh ]];then
|
||||
source @libdir@/build-api.sh
|
||||
fi
|
||||
|
||||
manjaro_tools_conf='@sysconfdir@/manjaro-tools.conf'
|
||||
|
@ -23,36 +27,6 @@ remove=false
|
|||
display=false
|
||||
name='default'
|
||||
|
||||
create_set(){
|
||||
msg "Creating [${profiledir}/${name}.set] ..."
|
||||
local list=$(find * -maxdepth 0 -type d | sort)
|
||||
if [[ -f ${profiledir}/${name}.set ]];then
|
||||
msg2 "Backing up ${profiledir}/${name}.set.orig"
|
||||
mv "${profiledir}/${name}.set" "${profiledir}/${name}.set.orig"
|
||||
fi
|
||||
for item in ${list[@]};do
|
||||
cd $item
|
||||
if [[ -f PKGBUILD ]];then
|
||||
msg2 "Adding ${item##*/}"
|
||||
echo ${item##*/} >> ${profiledir}/${name}.set || break
|
||||
fi
|
||||
cd ..
|
||||
done
|
||||
}
|
||||
|
||||
remove_set(){
|
||||
msg "Removing [${profiledir}/${name}.set] ..."
|
||||
rm ${profiledir}/${name}.set
|
||||
}
|
||||
|
||||
display_set(){
|
||||
local list=$(cat ${profiledir}/${name}.set)
|
||||
msg "Content of [${profiledir}/${name}.set] ..."
|
||||
for item in ${list[@]}; do
|
||||
msg2 $item
|
||||
done
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "Usage: ${0##*/} [options]"
|
||||
echo " -c <name> Create set"
|
||||
|
|
|
@ -10,8 +10,12 @@
|
|||
|
||||
shopt -s extglob
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
if [[ -r @libdir@/mount-api.sh ]];then
|
||||
source @libdir@/mount-api.sh
|
||||
fi
|
||||
|
||||
usage() {
|
||||
|
|
|
@ -8,8 +8,12 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
if [[ -r @libdir@/mount-api.sh ]];then
|
||||
source @libdir@/mount-api.sh
|
||||
fi
|
||||
|
||||
CHROOT_VERSION='v3'
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
shopt -s nullglob
|
||||
|
|
|
@ -8,25 +8,8 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
|
||||
# err() {
|
||||
# ALL_OFF="\e[1;0m"
|
||||
# BOLD="\e[1;1m"
|
||||
# RED="${BOLD}\e[1;31m"
|
||||
# local mesg=$1; shift
|
||||
# printf "${RED}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
# }
|
||||
#
|
||||
# msg() {
|
||||
# ALL_OFF="\e[1;0m"
|
||||
# BOLD="\e[1;1m"
|
||||
# GREEN="${BOLD}\e[1;32m"
|
||||
# local mesg=$1; shift
|
||||
# printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
|
||||
# }
|
||||
|
||||
if [[ -r @libdir@/functions.sh ]];then
|
||||
source @libdir@/functions.sh
|
||||
if [[ -r @libdir@/messages.sh ]];then
|
||||
source @libdir@/messages.sh
|
||||
fi
|
||||
|
||||
. /etc/makepkg.conf
|
||||
|
|
Loading…
Reference in a new issue