public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] Path addition fixes to prevent multiple slashes in paths.
@ 2013-12-18  1:12 Brian Dolbec
  2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 1/3] Remove some troublesome trailing slashes from paths Brian Dolbec
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Brian Dolbec @ 2013-12-18  1:12 UTC (permalink / raw
  To: gentoo-catalyst

These three patches fix multiple slash issues in paths.  The relative path bug fix will be needed for later
in the commit series, but it does work for now in either position.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [gentoo-catalyst] [PATCH 1/3] Remove some troublesome trailing slashes from paths
  2013-12-18  1:12 [gentoo-catalyst] Path addition fixes to prevent multiple slashes in paths Brian Dolbec
@ 2013-12-18  1:12 ` Brian Dolbec
  2013-12-18  3:41   ` W. Trevor King
  2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 2/3] Remove an extra slash in the path Brian Dolbec
  2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 3/3] Fix a relative path bug Brian Dolbec
  2 siblings, 1 reply; 8+ messages in thread
From: Brian Dolbec @ 2013-12-18  1:12 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

---
 modules/generic_stage_target.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index d9cc499..fea2f64 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -446,7 +446,7 @@ class generic_stage_target(generic_target):
 		if "SNAPCACHE" in self.settings:
 			self.settings["snapshot_cache_path"]=\
 				normpath(self.settings["snapshot_cache"]+"/"+\
-				self.settings["snapshot"]+"/")
+				self.settings["snapshot"])
 			self.snapcache_lock=\
 				catalyst_lock.LockDir(self.settings["snapshot_cache_path"])
 			print "Caching snapshot to "+self.settings["snapshot_cache_path"]
@@ -457,14 +457,14 @@ class generic_stage_target(generic_target):
 		Things *will* break without it!
 		"""
 		self.settings["chroot_path"]=normpath(self.settings["storedir"]+\
-			"/tmp/"+self.settings["target_subpath"]+"/")
+			"/tmp/"+self.settings["target_subpath"])
 		self.chroot_lock=catalyst_lock.LockDir(self.settings["chroot_path"])
 
 	def set_autoresume_path(self):
 		self.settings["autoresume_path"]=normpath(self.settings["storedir"]+\
 			"/tmp/"+self.settings["rel_type"]+"/"+".autoresume-"+\
 			self.settings["target"]+"-"+self.settings["subarch"]+"-"+\
-			self.settings["version_stamp"]+"/")
+			self.settings["version_stamp"])
 		if "AUTORESUME" in self.settings:
 			print "The autoresume path is " + self.settings["autoresume_path"]
 		if not os.path.exists(self.settings["autoresume_path"]):
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-catalyst] [PATCH 2/3] Remove an extra slash in the path.
  2013-12-18  1:12 [gentoo-catalyst] Path addition fixes to prevent multiple slashes in paths Brian Dolbec
  2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 1/3] Remove some troublesome trailing slashes from paths Brian Dolbec
@ 2013-12-18  1:12 ` Brian Dolbec
  2013-12-18  3:42   ` W. Trevor King
  2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 3/3] Fix a relative path bug Brian Dolbec
  2 siblings, 1 reply; 8+ messages in thread
From: Brian Dolbec @ 2013-12-18  1:12 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

---
 targets/stage1/stage1-controller.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/targets/stage1/stage1-controller.sh b/targets/stage1/stage1-controller.sh
index 3671095..d38ac73 100644
--- a/targets/stage1/stage1-controller.sh
+++ b/targets/stage1/stage1-controller.sh
@@ -14,7 +14,7 @@ case $1 in
 		install -d ${clst_chroot_path}/${clst_root_path}/etc/portage
 
 		# Setup make.conf and make.profile link in "ROOT in chroot":
-		copy_to_chroot ${clst_chroot_path}/etc/portage/make.conf /${clst_root_path}/etc/portage
+		copy_to_chroot ${clst_chroot_path}/etc/portage/make.conf ${clst_root_path}/etc/portage
 
 		# Enter chroot, execute our build script
 		exec_in_chroot \
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [gentoo-catalyst] [PATCH 3/3] Fix a relative path bug
  2013-12-18  1:12 [gentoo-catalyst] Path addition fixes to prevent multiple slashes in paths Brian Dolbec
  2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 1/3] Remove some troublesome trailing slashes from paths Brian Dolbec
  2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 2/3] Remove an extra slash in the path Brian Dolbec
@ 2013-12-18  1:12 ` Brian Dolbec
  2013-12-18  3:48   ` W. Trevor King
  2 siblings, 1 reply; 8+ messages in thread
From: Brian Dolbec @ 2013-12-18  1:12 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

---
 targets/support/functions.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/targets/support/functions.sh b/targets/support/functions.sh
index 80e371c..3245862 100644
--- a/targets/support/functions.sh
+++ b/targets/support/functions.sh
@@ -20,7 +20,7 @@ exec_in_chroot(){
 # and executes it.
 	local file_name=$(basename ${1})
 	local subdir=${2}
-	local destdir=".${subdir}/tmp"
+	local destdir="${subdir}/tmp"
 
 	echo "Copying ${file_name} to ${destdir}"
 	copy_to_chroot ${1} ${destdir}
@@ -33,7 +33,7 @@ exec_in_chroot(){
 	chmod +x ${chroot_path}/${destdir}/${file_name}
 
 	echo "Running ${file_name} in chroot ${chroot_path}"
-	${clst_CHROOT} ${chroot_path} ${destdir}/${file_name} || exit 1
+	${clst_CHROOT} ${chroot_path} .${destdir}/${file_name} || exit 1
 
 	delete_from_chroot ${destdir}/${file_name}
 	delete_from_chroot ${destdir}/chroot-functions.sh
-- 
1.8.3.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [gentoo-catalyst] [PATCH 1/3] Remove some troublesome trailing slashes from paths
  2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 1/3] Remove some troublesome trailing slashes from paths Brian Dolbec
@ 2013-12-18  3:41   ` W. Trevor King
  2013-12-18  5:40     ` Brian Dolbec
  0 siblings, 1 reply; 8+ messages in thread
From: W. Trevor King @ 2013-12-18  3:41 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

On Tue, Dec 17, 2013 at 05:12:09PM -0800, Brian Dolbec wrote:
> -				self.settings["snapshot"]+"/")
> +				self.settings["snapshot"])
> …
> -			"/tmp/"+self.settings["target_subpath"]+"/")
> +			"/tmp/"+self.settings["target_subpath"])
> …
> -			self.settings["version_stamp"]+"/")
> +			self.settings["version_stamp"])

Acked by me, although I think path consumers should be able to handle
both forms.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-catalyst] [PATCH 2/3] Remove an extra slash in the path.
  2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 2/3] Remove an extra slash in the path Brian Dolbec
@ 2013-12-18  3:42   ` W. Trevor King
  0 siblings, 0 replies; 8+ messages in thread
From: W. Trevor King @ 2013-12-18  3:42 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

On Tue, Dec 17, 2013 at 05:12:10PM -0800, Brian Dolbec wrote:
> -		copy_to_chroot ${clst_chroot_path}/etc/portage/make.conf /${clst_root_path}/etc/portage
> +		copy_to_chroot ${clst_chroot_path}/etc/portage/make.conf ${clst_root_path}/etc/portage

Acked by me.

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-catalyst] [PATCH 3/3] Fix a relative path bug
  2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 3/3] Fix a relative path bug Brian Dolbec
@ 2013-12-18  3:48   ` W. Trevor King
  0 siblings, 0 replies; 8+ messages in thread
From: W. Trevor King @ 2013-12-18  3:48 UTC (permalink / raw
  To: gentoo-catalyst; +Cc: Brian Dolbec

[-- Attachment #1: Type: text/plain, Size: 995 bytes --]

What's the bug?  More details in the commit message would be good.

On Tue, Dec 17, 2013 at 05:12:11PM -0800, Brian Dolbec wrote:
> -	local destdir=".${subdir}/tmp"
> +	local destdir="${subdir}/tmp"
> …
>  	copy_to_chroot ${1} ${destdir}
> @@ -33,7 +33,7 @@ exec_in_chroot(){
>  	chmod +x ${chroot_path}/${destdir}/${file_name}

If we're requiring ${subdir} (and thus ${destdit}) to be an absolute
chroot path, you may want to fix this too.

>  	echo "Running ${file_name} in chroot ${chroot_path}"
> -	${clst_CHROOT} ${chroot_path} ${destdir}/${file_name} || exit 1
> +	${clst_CHROOT} ${chroot_path} .${destdir}/${file_name} || exit 1

Do we need the leading dot here?  Can we store:

  file_path="${chroot_path}/${destdir}/${file_name}"

and use that for both the chmod and clst_CHROOT calls?

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-catalyst] [PATCH 1/3] Remove some troublesome trailing slashes from paths
  2013-12-18  3:41   ` W. Trevor King
@ 2013-12-18  5:40     ` Brian Dolbec
  0 siblings, 0 replies; 8+ messages in thread
From: Brian Dolbec @ 2013-12-18  5:40 UTC (permalink / raw
  To: gentoo-catalyst

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

On Tue, 2013-12-17 at 19:41 -0800, W. Trevor King wrote:
> On Tue, Dec 17, 2013 at 05:12:09PM -0800, Brian Dolbec wrote:
> > -				self.settings["snapshot"]+"/")
> > +				self.settings["snapshot"])
> > …
> > -			"/tmp/"+self.settings["target_subpath"]+"/")
> > +			"/tmp/"+self.settings["target_subpath"])
> > …
> > -			self.settings["version_stamp"]+"/")
> > +			self.settings["version_stamp"])
> 
> Acked by me, although I think path consumers should be able to handle
> both forms.
> 
> Cheers,
> Trevor
> 

They should, but I found catalyst's code to be fragile, fixing these
issues got things working again.  I also found that once fixed, things
seemed to be more stable when making changes.

Plus I like it better when looking through output to see it not have //
or /// in the middle of a path. 

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-12-18  5:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-18  1:12 [gentoo-catalyst] Path addition fixes to prevent multiple slashes in paths Brian Dolbec
2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 1/3] Remove some troublesome trailing slashes from paths Brian Dolbec
2013-12-18  3:41   ` W. Trevor King
2013-12-18  5:40     ` Brian Dolbec
2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 2/3] Remove an extra slash in the path Brian Dolbec
2013-12-18  3:42   ` W. Trevor King
2013-12-18  1:12 ` [gentoo-catalyst] [PATCH 3/3] Fix a relative path bug Brian Dolbec
2013-12-18  3:48   ` W. Trevor King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox