-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow distro-relative paths in custompios_path #206
Comments
The relative path becomes a problem if you are using docker build environment. Or multiple CustomPiOS source trees. I am not sure how to solve this without placing custompios in the execution PATH variable. So this was the compromise at the time. What exactly are you proposing with relative paths? Relative to the working directory or the distro you are building? |
i think that relative paths to the distro is what I mean. e.g. $ .
├── LICENSE
├── README.md
├── mydistro
│ └── src
│ ├── build_dist
│ ├── config
│ └── custompios_path
└── src
├── build
├── build_custom_os
├── build_docker
├── common.sh
├── config
├── config_sanity
├── custompios
├── make_custom_pi_os
└── update-custompios-paths
$ cat mydistro/src/custompios_path
../../src
this obviously assumes that it actually makes sense to use a relative path, because the it probably makes sense to have
|
sidenote: my current workaround to this problem is to exclude the so the priority of this issue is pretty low for me. |
i guess this might work: diff --git a/src/dist_generators/dist_example/src/build_dist b/src/dist_generators/dist_example/src/build_dist
index e3d3cb8..14799a7 100755
--- a/src/dist_generators/dist_example/src/build_dist
+++ b/src/dist_generators/dist_example/src/build_dist
@@ -5,4 +5,6 @@ export DIST_PATH=${DIR}
export CUSTOM_PI_OS_PATH=$(<${DIR}/custompios_path)
export PATH=$PATH:$CUSTOM_PI_OS_PATH
+CUSTOM_PI_OS_PATH="$( cd "$(DIR}" && cd "${CUSTOM_PI_OS_PATH}" && pwd )"
+
${CUSTOM_PI_OS_PATH}/build_custom_os $@ afaict, the this still doesn't handle the expansion in |
i guess that's the change required for the Vagrantfile: diff --git a/src/dist_generators/dist_example/src/vagrant/Vagrantfile b/src/dist_generators/dist_example/src/vagrant/Vagrantfile
index 4484441..f6bfa37 100644
--- a/src/dist_generators/dist_example/src/vagrant/Vagrantfile
+++ b/src/dist_generators/dist_example/src/vagrant/Vagrantfile
@@ -2,7 +2,7 @@ vagrant_root = File.dirname(__FILE__)
Vagrant.configure("2") do |o|
o.vm.box = "debian/buster64"
o.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
- o.vm.synced_folder File.read("../custompios_path").gsub("\n",""), "/CustomPiOS", create:true, type: "nfs"
+ o.vm.synced_folder File.expand_path(File.read("../custompios_path").gsub("\n", ""), ".."), "/CustomPiOS", create:true, type: "nfs"
o.vm.synced_folder "../", "/distro", create:true, type: "nfs"
o.vm.network :private_network, ip: "192.168.55.55"
o.vm.provision :shell, :path => "setup.sh", args: ENV['SHELL_ARGS'] note that i haven't actually tested this with Vagrant (just with a small, standalone ruby script) |
Its part of .gitignore on my distros: I initially didn't add git files in to the template folder of a new distro. But since 2013 when it started git has become the only version control out there. Though there are a few that use mercurial (though I rarely see .hgignore). So perhaps it might make sense to add now a default .gitignore. ATM the vagrant is falling out of support no one is actually using it. And I have no time to test it. |
I initially didn't add git files in to the template folder of a new distro. oops: with b10ed77 i have introduced a default so probably, you could just keep it and add more files? and what do you think of #206 (comment)? one potential drawback i see is, that if the path in |
the
<dist>/src/custompios_path
generated bysrc/make_custom_pi_os
holds the absolute path to theCustomPiOS
sources (so all the scripts (and sourced scriptlets) can find the other scripts).this means, that it is useless to track this file in git (assuming that not everybody clones the repo into
/home/guysoft/sources/CustomPiOS
:-P)probably this file could hold a relative path (at least if
make_custom_pi_os
was called via a relative path, such as./src/make_custom_pi_os
)?i'm a bit unsure about the interaction with the vagrant snippet.
The text was updated successfully, but these errors were encountered: