macaroni-os / macaronictl

Macaroni OS System Management CLI
GNU General Public License v3.0
0 stars 0 forks source link

etc-update: Improve elaboration of ._cfg* when the target file is no more available #1

Closed geaaru closed 1 year ago

geaaru commented 1 year ago
Original file /etc/luet/repos.conf.d/mottainai-stable.yml replaced. ✔ 
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.

[  1] /etc/luet/repos.conf.d/macaroni-terragon-dev.yml
[  2] /etc/luet/repos.conf.d/macaroni-terragon.yml
[  3] /etc/luet/repos.conf.d/mottainai-testing.yml
[  4] /etc/luet/repos.conf.d/macaroni-commons-dev.yml
[  5] /etc/luet/repos.conf.d/macaroni-commons-testing.yml
[  6] /etc/luet/repos.conf.d/macaroni-commons.yml
[  7] /etc/luet/repos.conf.d/macaroni-funtoo-systemd-testing.yml

[ -1] to exit
[ -3] to auto merge all files
[ -7] to discard all updates

Please select a file to edit by entering the corresponding number.
    (don't use -3 or -7 if you're ensure what to do): -3
File /etc/luet/repos.conf.d/macaroni-terragon-dev.yml replaced by new file.
File /etc/luet/repos.conf.d/macaroni-terragon.yml replaced by new file.
File /etc/luet/repos.conf.d/mottainai-testing.yml replaced by new file.
File /etc/luet/repos.conf.d/macaroni-commons-dev.yml replaced by new file.
File /etc/luet/repos.conf.d/macaroni-commons-testing.yml replaced by new file.
💣  Error: stat /etc/luet/repos.conf.d/macaroni-commons.yml: no such file or directory🔥 
minion ~ # cd /etc/luet/repos.conf.d/
minion /etc/luet/repos.conf.d # ls -la
total 40
drwxr-xr-x 1 root root 560 Feb 10 11:29 .
drwxr-xr-x 1 root root  74 Jan 21 23:21 ..
-rw-r--r-- 1 root root 307 Feb 10 11:21 ._cfg0001_macaroni-commons.yml
-rw-r--r-- 1 root root 379 Feb 10 11:21 ._cfg0001_macaroni-funtoo-systemd-testing.yml
-rw-r--r-- 1 root root 200 Feb 10 11:21 macaroni-commons-dev.yml
-rw-r--r-- 1 root root 347 Feb 10 11:21 macaroni-commons-testing.yml
-rw-r--r-- 1 root root 211 Feb  3 08:57 macaroni-funtoo-systemd-dev.yml
-rw-r--r-- 1 root root 217 Jan 21 23:25 macaroni-funtoo-systemd-testing.yml
-rw-r--r-- 1 root root 195 Feb 10 11:22 macaroni-terragon-dev.yml
-rw-r--r-- 1 root root 312 Feb 10 11:21 macaroni-terragon.yml
-rw-r--r-- 1 root root 285 Feb 10 11:22 mottainai-stable.yml
-rw-r--r-- 1 root root 318 Feb 10 11:22 mottainai-testing.yml
geaaru commented 1 year ago

This is what will happen with the new release:

# macaronictl etc-update
Scanning Configuration files...
File ._cfg0001_macaroni-commons.yml is an orphan. Removing it directly...
Nothing left to do; exiting. :)