IBM / ibmichroot

A set of scripts to facilitate the use of chroot-based containers for IBM i
MIT License
21 stars 9 forks source link

Command arg to var proposal #12

Closed abmusse closed 9 years ago

abmusse commented 9 years ago

Original report by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).


I was furthering my use of chroot_minimal.lst and realized only the :system portion had variable substitution (i.e. $myuser). I'd like to propose we introduce that into other areas also.

I've created a snippet with a git diff of my proposed changes.

Thoughts?

abmusse commented 9 years ago

Original comment by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).


Resolved in this commit.

abmusse commented 9 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


Oh moved to script "main" (and store global var), wherein, any function could use parsed replacements. Seems reasonable to me.

abmusse commented 9 years ago

Original comment by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).


I neglected to give a bigger picture. My proposal removes the arg replacement from function chroot_system and instead puts it in function chroot_setup.

Essentially it makes arg replacement work for all sections (i.e. :system, :cp, :chmod, etc)

abmusse commented 9 years ago

Original comment by Tony Cairns (Bitbucket: rangercairns, GitHub: rangercairns).


I have no idea what you are doing here ... snippet looks the same as original code ...

abmusse commented 9 years ago

Original comment by Aaron Bartell (Bitbucket: aaronbartell, GitHub: aaronbartell).


@rangercairns What are your thoughts on this? Note it slows everything down because each line is separately processed. Might be better to do a single complex sed.