Skip to content

Commit

Permalink
New menu system: the configuration file is saved as .<filename>.old
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-labastie committed Apr 24, 2019
1 parent 834db3b commit a645174
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
configuration*
.configuration*
custom/config/*
menu/__pycache__
pkgmngt/packInstall.sh
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ all: menuconfig
@$$(grep RUN_ME configuration 2>/dev/null | sed -e 's@RUN_ME=\"@@' -e 's@\"@@')

menuconfig:
@cp -a configuration configuration.old 2>/dev/null || true
@cp -a configuration .configuration.old 2>/dev/null || true
@CONFIG_="" KCONFIG_CONFIG=configuration $(CONFIG)/menuconfig.py $(CONFIG_CONFIG_IN)

# Clean up
Expand Down
2 changes: 1 addition & 1 deletion jhalfs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ esac
# If the user has not saved his configuration file, let's ask
# if he or she really wants to run this stuff
time_current=$(stat -c '%Y' configuration 2>/dev/null || date +%s)
time_old=$(stat -c '%Y' configuration.old 2>/dev/null || printf '%s' "$time_current")
time_old=$(stat -c '%Y' .configuration.old 2>/dev/null || printf '%s' "$time_current")

This comment has been minimized.

Copy link
@ulfalizer

ulfalizer Apr 28, 2019

Hmm... I wonder if adding that extra "helpful" leading . for a KCONFIG_CONFIG that lacks it was such a great idea in Kconfiglib. Maybe I should undo it, with a new major release. It can obviously break scripts.

This comment has been minimized.

Copy link
@pierre-labastie

pierre-labastie Apr 29, 2019

Author Member

Thanks for the comment. And thanks for Kconfiglib too. We have been using an old patched version of the C Kconfig program (from busybox) for years, and this one is much easier... For us, no need to change anything. I just did not read the doc carefully enough, so I missed the leading dot. OTOH, I'd think that if a user does not put a leading dot to KCONFIG_CONFIG, he or she does not want a leading dot to the backup file either.

This comment has been minimized.

Copy link
@ulfalizer

ulfalizer Apr 30, 2019

Glad it's useful!

Yeah, I kinda considered the backup file to be in the same vein as Vim backup files, which are dotfiles. On second thought, the backup file is much more likely to be processed by scripts though, plus it's easy to miss now if the configuration file isn't a dotfile.

I should probably change it (and bump the major version to 11).

if [ "$(printf '%d' "$time_old")" -ge "$(printf '%d' "$time_current")" ] ; then
printf 'Do you want to run jhalfs? yes/no (yes): '
read -r ANSWER
Expand Down

0 comments on commit a645174

Please sign in to comment.