-
Notifications
You must be signed in to change notification settings - Fork 0
/
.makizushi
62 lines (51 loc) · 1.74 KB
/
.makizushi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
chrootdir='/var/mychroots'
declare -A chroots
chroots=(['stable32']='linux32' ['stable64']='linux64')
packager='Thomas Dziedzic < gostrc at gmail >'
makeflags='-j2'
alias db-aur='ssh aur.archlinux.org /arch/db-update'
mkchr() {
if [[ ${#} = 0 ]] ; then
for k in ${!chroots[@]} ; do
${chroots[$k]} sudo makechrootpkg -c -r ${chrootdir}/${k} -- -L --noconfirm
done
else
${chroots[$1]} sudo makechrootpkg -c -r ${chrootdir}/${1} ${@:2} -- -L --noconfirm
fi
}
mkdchr() {
if [[ ${#} = 0 ]] ; then
for k in ${!chroots[@]} ; do
${chroots[$k]} sudo makechrootpkg -r ${chrootdir}/${k} -- -L --noconfirm
done
else
${chroots[$1]} sudo makechrootpkg -r ${chrootdir}/${1} ${@:2} -- -L --noconfirm
fi
}
upchr() {
if [[ ${#} = 0 ]] ; then
for k in ${!chroots[@]} ; do
${chroots[$k]} sudo mkarchroot -u ${chrootdir}/${k}/root
done
else
${chroots[$1]} sudo mkarchroot -u ${chrootdir}/${1}/root ${@:2}
fi
}
newchr() {
if [[ ${#} = 0 ]] ; then
sudo rm -rf ${chrootdir}
for k in ${!chroots[@]} ; do
sudo mkdir -p ${chrootdir}/${k}
${chroots[$k]} sudo mkarchroot ${chrootdir}/${k}/root base base-devel sudo
sudo sed "s/#PACKAGER=.*/PACKAGER='${packager}'/" -i ${chrootdir}/${k}/root/etc/makepkg.conf
sudo sed "s/#MAKEFLAGS=.*/MAKEFLAGS='${makeflags}'/" -i ${chrootdir}/${k}/root/etc/makepkg.conf
done
else
sudo rm -rf ${chrootdir}/${1}
sudo mkdir -p ${chrootdir}/${1}
${chroots[$1]} sudo mkarchroot ${@:2} ${chrootdir}/${1}/root base base-devel sudo
sudo sed "s/#PACKAGER=.*/PACKAGER='${packager}'/" -i ${chrootdir}/${1}/root/etc/makepkg.conf
sudo sed "s/#MAKEFLAGS=.*/MAKEFLAGS='${makeflags}'/" -i ${chrootdir}/${1}/root/etc/makepkg.conf
fi
}