Merge branch 'devel' of github.com:manjaro/manjaro-tools into devel

This commit is contained in:
Philip 2015-06-06 10:12:58 +02:00
commit b759189077
4 changed files with 87 additions and 41 deletions

View file

@ -16,38 +16,6 @@ SYSCONFDIR='@sysconfdir@'
[[ -r @libdir@/util-msg.sh ]] && source @libdir@/util-msg.sh
[[ -r @libdir@/util.sh ]] && source @libdir@/util.sh
create_set(){
msg "[$1/${name}.set]"
if [[ -f $1/${name}.set ]];then
msg3 "Backing up $1/${name}.set.orig"
mv "$1/${name}.set" "$1/${name}.set.orig"
fi
local list=$(find * -maxdepth 0 -type d | sort)
for item in ${list[@]};do
if [[ -f $item/$2 ]];then
cd $item
msg2 "Adding ${item##*/}"
echo ${item##*/} >> $1/${name}.set || break
cd ..
fi
done
}
remove_set(){
if [[ -f $1/${name}.set ]]; then
msg "Removing [$1/${name}.set] ..."
rm $1/${name}.set
fi
}
show_set(){
local list=$(cat $1/${name}.set)
msg "Content of [$1/${name}.set] ..."
for item in ${list[@]}; do
msg2 "$item"
done
}
load_user_info
load_config "${USER_CONFIG}/manjaro-tools.conf"

View file

@ -7,6 +7,9 @@
# displaymanager="lightdm"
# autologin
# autologin="true"
################ install ################
# unset defaults to given value

View file

@ -423,20 +423,24 @@ configure_displaymanager(){
gpasswd -a ${username} autologin &> /dev/null
# hopefully fixes autologin on openrc livecd
if [[ -d /run/openrc ]];then
sed -i -e 's/^.*pam-autologin-service=.*/pam-autologin-service=lightdm-autologin/' /etc/lightdm/lightdm.conf
${autologin} && sed -i -e 's/^.*pam-autologin-service=.*/pam-autologin-service=lightdm-autologin/' /etc/lightdm/lightdm.conf
fi
if ${autologin};then
sed -i -e "s/^.*autologin-user=.*/autologin-user=${username}/" /etc/lightdm/lightdm.conf
sed -i -e "s/^.*autologin-user-timeout=.*/autologin-user-timeout=0/" /etc/lightdm/lightdm.conf
fi
sed -i -e "s/^.*autologin-user=.*/autologin-user=${username}/" /etc/lightdm/lightdm.conf
sed -i -e "s/^.*autologin-user-timeout=.*/autologin-user-timeout=0/" /etc/lightdm/lightdm.conf
elif [[ -f /usr/bin/kdm ]];then
sed -i -e "s/^.*AutoLoginUser=.*/AutoLoginUser=${username}/" /usr/share/config/kdm/kdmrc
sed -i -e "s/^.*AutoLoginPass=.*/AutoLoginPass=${password}/" /usr/share/config/kdm/kdmrc
if ${autologin},then
sed -i -e "s/^.*AutoLoginUser=.*/AutoLoginUser=${username}/" /usr/share/config/kdm/kdmrc
sed -i -e "s/^.*AutoLoginPass=.*/AutoLoginPass=${password}/" /usr/share/config/kdm/kdmrc
fi
xdg-icon-resource forceupdate --theme hicolor &> /dev/null
[[ -e "/usr/bin/update-desktop-database" ]] && update-desktop-database -q
elif [[ -f /usr/bin/sddm ]];then
sed -i -e "s|^User=.*|User=${username}|" /etc/sddm.conf
elif [[ -f /usr/bin/lxdm ]];then
sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf
${autologin} && sed -i -e "s/^.*autologin=.*/autologin=${username}/" /etc/lxdm/lxdm.conf
elif [[ -f /usr/bin/gdm ]];then
sed -i -e "s/^.*AutomaticLogin=.*/AutomaticLogin=${username}/" /etc/gdm/custom.conf
${autologin} && sed -i -e "s/^.*AutomaticLogin=.*/AutomaticLogin=${username}/" /etc/gdm/custom.conf
fi
}

View file

@ -12,6 +12,75 @@ import(){
[[ -r $1 ]] && source $1
}
create_set(){
msg "[$1/${name}.set]"
if [[ -f $1/${name}.set ]];then
msg3 "Backing up $1/${name}.set.orig"
mv "$1/${name}.set" "$1/${name}.set.orig"
fi
local list=$(find * -maxdepth 0 -type d | sort)
for item in ${list[@]};do
if [[ -f $item/$2 ]];then
cd $item
msg2 "Adding ${item##*/}"
echo ${item##*/} >> $1/${name}.set || break
cd ..
fi
done
}
calculate_build_order(){
local is_split=false
for pkg in $(cat /tmp/${name}.set);do
cd $pkg
source PKGBUILD
if [[ -n $pkgbase ]];then
is_split=true; echo "$pkgbase" >> /tmp/${name}.split
fi
for m in ${makedepends[@]};do
echo $m >> /tmp/${name}.makedeps
done
cd ..
done
sort -u /tmp/${name}.split > /tmp/${name}.split.sort
sort -u /tmp/${name}.makedeps > /tmp/${name}.makedeps.sort
rm /tmp/${name}.split
#[[ -f /tmp/${name}.makedeps ]] && rm /tmp/${name}.makedeps
for d in $(cat /tmp/${name}.makedeps.sort);do
for pkg in $(cat /tmp/${name}.set);do
if [[ $pkg == $d ]];then
echo $d >> /tmp/${name}.makedeps
fi
done
done
sort -u /tmp/${name}.makedeps > /tmp/${name}.makedeps.sort
#[[ -f /tmp/${name}.makedeps ]] && rm /tmp/${name}.makedeps
rm /tmp/${name}.*sort
}
remove_set(){
if [[ -f $1/${name}.set ]]; then
msg "Removing [$1/${name}.set] ..."
rm $1/${name}.set
fi
}
show_set(){
local list=$(cat $1/${name}.set)
msg "Content of [$1/${name}.set] ..."
for item in ${list[@]}; do
msg2 "$item"
done
}
get_deps(){
echo $(pactree -u $1)
}
get_timer(){
echo $(date +%s)
}
@ -271,6 +340,8 @@ load_config(){
[[ -z ${sets_dir} ]] && sets_dir="${SYSCONFDIR}/sets"
[[ -z ${build_mirror} ]] && build_mirror='http://mirror.netzspielplatz.de/manjaro/packages'
###################
# buildtree
###################
@ -291,8 +362,6 @@ load_config(){
[[ -z ${buildset_pkg} ]] && buildset_pkg='default'
[[ -z ${build_mirror} ]] && build_mirror='http://mirror.netzspielplatz.de/manjaro/packages'
[[ -z ${blacklist_trigger[@]} ]] && blacklist_trigger=('eudev' 'upower-pm-utils' 'eudev-systemdcompat')
[[ -z ${blacklist[@]} ]] && blacklist=('libsystemd')
@ -356,6 +425,8 @@ load_profile_config(){
[[ -z ${displaymanager} ]] && displaymanager="none"
[[ -z ${autologin} ]] && displaymanager="true"
[[ -z ${default_desktop_executable} ]] && default_desktop_executable="none"
[[ -z ${default_desktop_file} ]] && default_desktop_file="none"