Skip to content

add wrapper to adjust timedatectl for writable-paths handling (LP: #1650688)#8

Merged
ogra1 merged 4 commits intocanonical:masterfrom
ogra1:core-fix-timedatectl
Mar 3, 2017
Merged

add wrapper to adjust timedatectl for writable-paths handling (LP: #1650688)#8
ogra1 merged 4 commits intocanonical:masterfrom
ogra1:core-fix-timedatectl

Conversation

@ogra1
Copy link
Contributor

@ogra1 ogra1 commented Feb 24, 2017

No description provided.

Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach is fine, but it looks like there are some issues to sort out.


TIMEDATECTL=/usr/bin/timedatectl.real

case $1 in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not relevant here because of the inputs we get, but don't we want quotes around $1 and $2 ?

Copy link
Contributor

@zyga zyga Mar 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to spellcheck this script please (EDIT: I did mean shellcheck, blame the silly auto-complete)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, spellcheck and shell-check

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#16

Copy link
Contributor Author

@ogra1 ogra1 Mar 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i merged #16 anything else for spellchecking needed ? (do you want to run spellintian too ?)
note that any spellcheck will choke on the mentioning of "writable-paths" because the original implementation of it is already missing an "e"


mv /usr/bin/timedatectl /usr/bin/timedatectl.real

cat >/usr/bin/timedatectl<<EOF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, did you test this? A normal "heredoc" will substitute vars, so all the $1, $2, $@ will be empty in the output. You probably want cat >/usr/bin/timedatectl<<'EOF' instead.

Copy link
Contributor Author

@ogra1 ogra1 Mar 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i tested it many times... copied the original timedatectl to $HOME and bind mounted the script on top of /usr/bin/timedatectl after changing the value of TIMEDATECTL to point there.. i didnt test the creation bit though ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added the necessary escapes now


TIMEDATECTL=/usr/bin/timedatectl.real

case \$1 in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you quote everything instead of using:

cat > foo <<'EOF'
No substitution of $1 or $2 or anything with 'EOF'
EOF

? It seems the 'EOF' version is easier to read, no?

Copy link
Contributor

@mvo5 mvo5 Mar 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(note the ' around EOF) (as suggested in https://github.com/snapcore/core/pull/8/files#r104106673)

@ogra1 ogra1 merged commit c6c07da into canonical:master Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants