Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
1
Konular (issue)
1
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
SulinOS
inary
Commits
85b1bc23
Kaydet (Commit)
85b1bc23
authored
May 11, 2020
tarafından
Suleyman Poyraz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Changed configs has been fixed for "install, upgrade, emerge, emergeup" commands
üst
e901e7ea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
34 deletions
+51
-34
emerge.py
inary/cli/emerge.py
+11
-1
emergeup.py
inary/cli/emergeup.py
+12
-3
upgrade.py
inary/cli/upgrade.py
+8
-7
helper.py
inary/operations/helper.py
+20
-23
No files found.
inary/cli/emerge.py
Dosyayı görüntüle @
85b1bc23
...
...
@@ -58,7 +58,7 @@ You can also give the name of a component.
self
.
parser
.
add_option_group
(
group
)
def
run
(
self
):
import
inary.operations.emerge
as
emerge
from
inary.operations
import
emerge
,
helper
self
.
init
(
database
=
True
)
component
=
ctx
.
get_option
(
'component'
)
...
...
@@ -79,5 +79,15 @@ You can also give the name of a component.
ctx
.
config
.
options
.
output_dir
=
ctx
.
config
.
cached_packages_dir
()
emerge
.
emerge
(
sources
)
try
:
config_changes
,
opt
=
helper
.
check_config_changes
([
util
.
parse_package_name_legacy
(
i
.
split
(
"/"
)[
-
1
])[
0
]
for
i
in
packages
])
if
config_changes
:
if
ctx
.
ui
.
confirm
(
_
(
"[!] Some config files have been changed. Would you like to see and apply them?"
)):
helper
.
show_changed_configs
(
config_changes
,
opt
)
except
ValueError
:
pass
if
not
self
.
options
.
ignore_sysconf
:
sysconf
.
proceed
(
self
.
options
.
force_sysconf
)
inary/cli/emergeup.py
Dosyayı görüntüle @
85b1bc23
...
...
@@ -58,7 +58,7 @@ You can also give the name of a component.
self
.
parser
.
add_option_group
(
group
)
def
run
(
self
):
from
inary.operations
import
repository
,
emerge
from
inary.operations
import
repository
,
emerge
,
helper
self
.
init
(
database
=
True
)
source
=
inary
.
db
.
sourcedb
.
SourceDB
()
...
...
@@ -85,5 +85,15 @@ You can also give the name of a component.
repository
.
update_repos
(
repos
,
ctx
.
get_option
(
'force'
))
emerge
.
emerge
(
emerge_up_list
)
try
:
config_changes
,
opt
=
helper
.
check_config_changes
([
util
.
parse_package_name_legacy
(
i
.
split
(
"/"
)[
-
1
])[
0
]
for
i
in
packages
])
if
config_changes
:
if
ctx
.
ui
.
confirm
(
_
(
"[!] Some config files have been changed. Would you like to see and apply them?"
)):
helper
.
show_changed_configs
(
config_changes
,
opt
)
except
ValueError
:
pass
if
not
self
.
options
.
ignore_sysconf
:
sysconf
.
proceed
(
self
.
options
.
force_sysconf
)
\ No newline at end of file
sysconf
.
proceed
(
self
.
options
.
force_sysconf
)
inary/cli/upgrade.py
Dosyayı görüntüle @
85b1bc23
...
...
@@ -112,12 +112,13 @@ expanded to package names.
upgrade
.
upgrade
(
packages
,
reposit
)
config_changes
=
helper
.
check_config_changes
(
[
util
.
parse_package_name_legacy
(
i
.
split
(
"/"
)[
-
1
])[
0
]
for
i
in
packages
])
try
:
config_changes
,
opt
=
helper
.
check_config_changes
([
util
.
parse_package_name_legacy
(
i
.
split
(
"/"
)[
-
1
])[
0
]
for
i
in
packages
])
if
config_changes
:
if
ctx
.
ui
.
confirm
(
_
(
"[!] Some config files have been changed. Would you like to see and apply them?"
)):
helper
.
show_changed_configs
(
config_changes
,
opt
)
except
ValueError
:
pass
if
not
self
.
options
.
ignore_sysconf
:
sysconf
.
proceed
(
self
.
options
.
force_sysconf
)
if
config_changes
:
if
ctx
.
ui
.
confirm
(
_
(
"[!] Some config files have been changed. Would you like to see and apply them?"
)):
helper
.
show_changed_configs
(
config_changes
)
inary/operations/helper.py
Dosyayı görüntüle @
85b1bc23
...
...
@@ -229,32 +229,29 @@ def apply_changed_config(old_file, new_file, keep=True):
util
.
copy_file
(
new_file
,
old_file
)
util
.
delete_file
(
new_file
)
#def store_new_config(file):
# util.copy_file(file, file+".new-byinary")
def
show_changed_configs
(
package_dict
,
opt
):
for
package
in
package_dict
:
if
package_dict
[
package
]:
if
ctx
.
ui
.
confirm
(
util
.
colorize
(
_
(
"[?] Would you like to see changes in config files of
\"
{0}
\"
package"
)
.
format
(
package
),
color
=
'brightyellow'
)):
for
file
in
package_dict
[
package
]:
new_file
=
util
.
join_path
(
ctx
.
config
.
history_dir
(),
opt
,
package
,
ctx
.
config
.
dest_dir
(),
file
)
ctx
.
ui
.
info
(
_
(
"[*] Changes in config file: {}"
)
.
format
(
file
),
color
=
'yellow'
)
os
.
system
(
"diff -u {0} {1} | less"
.
format
(
new_file
,
file
))
prompt
=
ctx
.
ui
.
choose
(
_
(
"[?] Select the process which will be happened:"
),
[
_
(
"1. Store new config file, not apply [*]"
),
_
(
"2. Apply new config file (keep old config)"
),
_
(
"3. Apply new config file (don't keep old config)"
),
_
(
"4. Delete new config file"
)
])
if
prompt
==
_
(
"1. Store new config file, not apply [*]"
):
pass
# store_new_config(new_file)
elif
prompt
==
_
(
"2. Apply new config file (keep old config)"
):
apply_changed_config
(
util
.
join_path
(
ctx
.
config
.
dest_dir
(),
file
),
new_file
,
keep
=
True
)
elif
prompt
==
_
(
"3. Apply new config file (don't keep old config)"
):
apply_changed_config
(
util
.
join_path
(
ctx
.
config
.
dest_dir
(),
file
),
new_file
,
keep
=
False
)
else
:
ctx
.
ui
.
info
(
_
(
"Deleting new config file {0}"
)
.
format
(
file
),
verbose
=
True
)
util
.
delete_file
(
new_file
)
if
os
.
path
.
exist
(
new_file
):
ctx
.
ui
.
info
(
_
(
"[*] Changes in config file: {}"
)
.
format
(
file
),
color
=
'yellow'
)
os
.
system
(
"diff -u {0} {1} | less"
.
format
(
new_file
,
file
))
prompt
=
ctx
.
ui
.
choose
(
_
(
"[?] Select the process which will be happened:"
),
[
_
(
"1. Store new config file, not apply [*]"
),
_
(
"2. Apply new config file (keep old config)"
),
_
(
"3. Apply new config file (don't keep old config)"
),
_
(
"4. Delete new config file"
)
])
if
prompt
==
_
(
"1. Store new config file, not apply [*]"
):
pass
elif
prompt
==
_
(
"2. Apply new config file (keep old config)"
):
apply_changed_config
(
util
.
join_path
(
ctx
.
config
.
dest_dir
(),
file
),
new_file
,
keep
=
True
)
elif
prompt
==
_
(
"3. Apply new config file (don't keep old config)"
):
apply_changed_config
(
util
.
join_path
(
ctx
.
config
.
dest_dir
(),
file
),
new_file
,
keep
=
False
)
else
:
ctx
.
ui
.
info
(
_
(
"Deleting new config file {0}"
)
.
format
(
file
),
verbose
=
True
)
util
.
delete_file
(
new_file
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment