Skip to content

Commit 639a08b

Browse files
Pyabr 1.3.0
1 parent 6f0055f commit 639a08b

File tree

13 files changed

+98
-42
lines changed

13 files changed

+98
-42
lines changed

osinstaller.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/python3
2+
#######################################################################################
3+
# In the name of God, the Compassionate, the Merciful
4+
# Pyabr (c) 2020 Mani Jamali. GNU General Public License v3.0
5+
#
6+
# Official Website: http://pyabr.rf.gd
7+
# Programmer & Creator: Mani Jamali <manijamali2003@gmail.com>
8+
# Gap channel: @pyabr
9+
# Gap group: @pyabr_community
10+
# Git source: github.com/PyFarsi/pyabr
11+
#
12+
#######################################################################################
13+
14+
from buildlibs import pack_archives as pack
15+
from buildlibs import control
16+
import shutil, os, sys, hashlib,getpass
17+
18+
os.chdir('/')
19+
20+
if os.path.isfile('/stor/vmabr.pyc'):
21+
22+
if os.path.isdir('/stor/pyabr-master'):
23+
shutil.rmtree('/stor/pyabr-master')
24+
25+
if os.path.isfile ('/stor/master.zip'):
26+
os.remove('/stor/master.zip')
27+
28+
if os.path.isfile('/stor/proc/0'): os.remove('/stor/proc/0')
29+
if os.path.isfile('/stor/proc/id/desktop'): os.remove('/stor/proc/id/desktop')
30+
if not os.path.isdir('/stor/proc/id'): os.mkdir('/stor/proc/id')
31+
32+
os.system(f'cd /stor && "{sys.executable}" vmabr.pyc')
33+
else:
34+
## pre build ##
35+
36+
if not os.path.isdir("/app"):
37+
os.mkdir("/app")
38+
os.mkdir("/app/cache")
39+
os.mkdir("/app/cache/archives")
40+
os.mkdir("/app/cache/archives/data")
41+
os.mkdir("/app/cache/archives/control")
42+
os.mkdir("/app/cache/archives/code")
43+
os.mkdir("/app/cache/archives/build")
44+
os.mkdir("/app/cache/gets")
45+
46+
if not os.path.isdir("/stor"):
47+
os.mkdir("/stor")
48+
os.mkdir("/stor/app")
49+
os.mkdir("/stor/app/packages")
50+
51+
if not os.path.isdir("/build-packs"): os.mkdir("/build-packs")
52+
53+
# build #
54+
55+
pack.install()
56+
pack.inst('baran')
57+
pack.inst('setup')
58+
59+
# run #
60+
if os.path.isfile('/stor/proc/0'): os.remove('/stor/proc/0')
61+
if os.path.isfile('/stor/proc/id/desktop'): os.remove('/stor/proc/id/desktop')
62+
if not os.path.isdir('/stor/proc/id'): os.mkdir('/stor/proc/id')
63+
64+
# debug app #
65+
f = open('/stor/etc/suapp', 'w')
66+
f.write('setup')
67+
f.close()
68+
69+
os.system(f'cd /stor && "{sys.executable}" vmabr.pyc gui-desktop root toor')
70+
71+
if not os.path.isfile('/stor/testing'):
72+
os.system('poweroff')

pack-sb.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,11 @@
3232
list.remove('AUTHERS')
3333

3434
if not os.path.isdir('sb'):
35-
3635
os.mkdir('sb')
37-
os.mkdir('sb/pyabr')
38-
os.mkdir('sb/pyabr/pyabr-master')
3936
os.mkdir('sb/stor')
4037
os.mkdir('sb/root')
4138
os.mkdir('sb/etc')
4239

43-
f = open('sb/root/.xinitrc','w')
44-
f.write('pyabr')
45-
f.close()
46-
4740
f = open('sb/etc/issue.net', 'w')
4841
f.write('Pyabr')
4942
f.close()
@@ -52,18 +45,9 @@
5245

5346
for i in list:
5447
if os.path.isdir(i):
55-
shutil.copytree(i,'sb/pyabr/pyabr-master/'+i)
48+
shutil.copytree(i,'sb/'+i)
5649
else:
57-
if i=='debug.py':
58-
i = 'osinstaller.py'
59-
shutil.copyfile('debug.py','osinstaller.py')
60-
61-
shutil.copyfile(i, 'sb/pyabr/pyabr-master/'+i)
62-
63-
shutil.make_archive('sb/stor/master','zip','sb/pyabr/')
64-
shutil.rmtree('sb/pyabr')
50+
shutil.copyfile(i, 'sb/'+i)
6551

6652
subprocess.call(['mksquashfs','sb','stor.sb','-comp','xz'])
67-
68-
os.remove('osinstaller.py')
6953
import clean

packs/baran/code/baran.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ def escape_act_(self):
777777
def signout_act_(self):
778778
app.endall()
779779
commands.shutdown([])
780-
subprocess.call([sys.executable, files.readall('/proc/info/boot'), "gui-login"])
780+
subprocess.call([sys.executable, 'vmabr.pyc', "gui-login"])
781781
sys.exit(0)
782782

783783
def __init__(self,ports,username):
@@ -1896,7 +1896,7 @@ def signout_act_ (self,yes):
18961896
if yes:
18971897
app.endall()
18981898
commands.shutdown([])
1899-
subprocess.call([sys.executable, files.readall('/proc/info/boot'), "gui-login"])
1899+
subprocess.call([sys.executable, 'vmabr.pyc', "gui-login"])
19001900
sys.exit(0)
19011901

19021902
def switchuser_act (self):
@@ -1907,8 +1907,7 @@ def switchuser_act (self):
19071907
def switchuser_act_(self,yes):
19081908
if yes:
19091909
files.create('/tmp/switched-user')
1910-
subprocess.call([sys.executable, files.readall('/proc/info/boot'), "gui-login"]) # just run the login
1911-
1910+
subprocess.call([sys.executable, 'vmabr.pyc', "gui-login"]) # just run the login
19121911

19131912
def unlock_act (self):
19141913
if self.username=='guest':
@@ -1918,7 +1917,7 @@ def unlock_act (self):
19181917
self.BtnUnlock.hide()
19191918
self.lock.hide()
19201919
else:
1921-
subprocess.call([sys.executable,files.readall('/proc/info/boot'),'gui-unlock',self.username])
1920+
subprocess.call([sys.executable,'vmabr.pyc','gui-unlock',self.username])
19221921

19231922
def showTime_lock (self):
19241923

packs/baran/data/usr/share/themes/glass-dark.sa

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
cp /usr/share/themes/glass-dark-theme /etc/gui
1+
sel /etc/gui
2+
add /usr/share/themes/glass-dark-theme
3+
unsel
24

35
sel /usr/share/applications/roller.desk
46
set folder-icon: @icon/folder

packs/baran/data/usr/share/themes/glass.sa

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
cp /usr/share/themes/glass-theme /etc/gui
1+
sel /etc/gui
2+
add /usr/share/themes/glass-theme
3+
unsel
24

35
sel /usr/share/applications/roller.desk
46
set folder-icon: @icon/folder

packs/baran/data/usr/share/themes/snow.sa

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
cp /usr/share/themes/snow-theme /etc/gui
1+
sel /etc/gui
2+
add /usr/share/themes/snow-theme
3+
unsel
24

35
sel /usr/share/applications/roller.desk
46
set folder-icon: @icon/folder

packs/pyabr/code/vmabr.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -394,14 +394,6 @@
394394
if not (files.isdir('/usr/share/fonts') and files.isfile('/usr/share/fonts')):
395395
os.system('ln -s /usr/share/fonts usr/share/fonts')
396396

397-
## @core/removeinstaller ##
398-
399-
if not (argv[0]=='user' or argv[0]=='login'):
400-
if files.isfile('/master.zip'): files.remove('/master.zip')
401-
if files.isfile('/pyabr-master.zip'): files.remove('/pyabr-master.zip')
402-
if files.isfile('/pyabr.zip'): files.remove('/pyabr.zip')
403-
if files.isdir('/pyabr-master'): files.removedirs('/pyabr-master')
404-
405397
## @core/kernel-info ##
406398

407399
files.write("/proc/info/kname", kernel_name)

packs/pyabr/data/proc/info/boot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vmabr.pyc

packs/pyabr/data/proc/info/os

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Pyabr

packs/pyabr/data/proc/info/os_su

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
root

0 commit comments

Comments
 (0)