-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibcdb.py
More file actions
34 lines (26 loc) · 835 Bytes
/
libcdb.py
File metadata and controls
34 lines (26 loc) · 835 Bytes
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*- #
import sys
from libcdblib.manage import add
from libcdblib.manage import delete
from libcdblib.manage import search
from libcdblib.getlibc.get_ubuntu_libc import get_all_ubuntu_libc
LIBCDBROOT = '/home/plusls/libcdbroot'
def update():
get_all_ubuntu_libc('/home/plusls/libcdbroot')
def main():
argv = sys.argv[1:]
if argv[0] == 'add':
for i in range(1, len(argv)):
add(LIBCDBROOT, argv[i])
elif argv[0] == 'delete':
for i in range(2, len(argv)):
delete(LIBCDBROOT, argv[1], argv[i])
print('Delete success!')
elif argv[0] == 'search':
libc_data = eval(argv[2])
print(search(LIBCDBROOT, argv[1], libc_data))
elif argv[0] == 'update':
update()
if __name__ == '__main__':
main()