diff options
author | Yuta SATOH <nigoro.dev@gmail.com> | 2017-12-10 07:29:07 +0900 |
---|---|---|
committer | Yuta SATOH <nigoro.dev@gmail.com> | 2017-12-10 07:29:07 +0900 |
commit | 577e2305cbb5ee32eb808b3728dd84b291f02db2 (patch) | |
tree | 1977128f91d9ae46f4715d68613be566415717e9 /dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch | |
parent | dev-util/catalyst: import from the main tree. (diff) | |
download | gentoo-bsd-577e2305cbb5ee32eb808b3728dd84b291f02db2.tar.gz gentoo-bsd-577e2305cbb5ee32eb808b3728dd84b291f02db2.tar.bz2 gentoo-bsd-577e2305cbb5ee32eb808b3728dd84b291f02db2.zip |
dev-util/catalyst: add the patches for Gentoo/FreeBSD.
Diffstat (limited to 'dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch')
-rw-r--r-- | dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch new file mode 100644 index 0000000..33e5325 --- /dev/null +++ b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch @@ -0,0 +1,52 @@ +https://bugs.gentoo.org/show_bug.cgi?id=363577 + +diff --git a/catalyst-2.0.18/modules/generic_stage_target.py b/catalyst-2.0.18/modules/generic_stage_target.py +index cc24c63..ad8138d 100644 +--- a/catalyst-2.0.18/modules/generic_stage_target.py ++++ b/catalyst-2.0.18/modules/generic_stage_target.py +@@ -1124,11 +1124,17 @@ class generic_stage_target(generic_target): + self.settings["chroot_path"]+"/etc/hosts",\ + "Could not replace /etc/hosts",env=self.env) + ++ """ GNU sed should be used on Gentoo/FreeBSD """ ++ if os.uname()[0] == "FreeBSD": ++ self.settings["sed"]="gsed" ++ else: ++ self.settings["sed"]="sed" ++ + """ Remove our overlay """ + if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"): + cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage",\ + "Could not remove /usr/local/portage",env=self.env) +- cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\ ++ cmd(self.settings["sed"]+" -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\ + "/etc/portage/make.conf",\ + "Could not remove PORTDIR_OVERLAY from make.conf",env=self.env) + +diff --git a/catalyst-2.0.18/targets/support/chroot-functions.sh b/catalyst-2.0.18/targets/support/chroot-functions.sh +index 67874a0..983a3a7 100755 +--- a/catalyst-2.0.18/targets/support/chroot-functions.sh ++++ b/catalyst-2.0.18/targets/support/chroot-functions.sh +@@ -422,5 +422,22 @@ Comment=This is a link to the local copy of the Gentoo Linux Handbook. + Icon=text-editor" > /usr/share/applications/gentoo-handbook.desktop + } + ++# GNU sed wrapper ++sed(){ ++ if [ -e /usr/bin/gsed ] ++ then ++ /usr/bin/gsed "$@" ++ elif [ -e /bin/sed ] ++ then ++ /bin/sed "$@" ++ elif [ -e /usr/bin/sed ] ++ then ++ /usr/bin/sed "$@" ++ else ++ echo "ERROR: Failed to select sed." ++ exit 1 ++ fi ++} ++ + # We do this everywhere, so why not put it in this script + run_default_funcs |