diff options
author | Mike Frysinger <vapier@gentoo.org> | 2006-07-15 02:34:48 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2006-07-15 02:34:48 +0000 |
commit | 65b22e94a97946aecf4fcc4249f4fc30d1aaeb03 (patch) | |
tree | b9d0eb49a14213a05116e29be2f8a60f4c4d4646 /app-editors/nano | |
parent | Fix from upstream. (diff) | |
download | gentoo-2-65b22e94a97946aecf4fcc4249f4fc30d1aaeb03.tar.gz gentoo-2-65b22e94a97946aecf4fcc4249f4fc30d1aaeb03.tar.bz2 gentoo-2-65b22e94a97946aecf4fcc4249f4fc30d1aaeb03.zip |
der, it would help if i had the ebuild actually apply the new patches ...
(Portage version: 2.1.1_pre2-r4)
Diffstat (limited to 'app-editors/nano')
-rw-r--r-- | app-editors/nano/ChangeLog | 7 | ||||
-rw-r--r-- | app-editors/nano/files/nano-1.3.12-path.patch | 199 | ||||
-rw-r--r-- | app-editors/nano/nano-1.3.12-r1.ebuild | 9 |
3 files changed, 211 insertions, 4 deletions
diff --git a/app-editors/nano/ChangeLog b/app-editors/nano/ChangeLog index 62a66e1741c1..a87be39c101b 100644 --- a/app-editors/nano/ChangeLog +++ b/app-editors/nano/ChangeLog @@ -1,12 +1,13 @@ # ChangeLog for app-editors/nano # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-editors/nano/ChangeLog,v 1.118 2006/07/15 02:31:14 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-editors/nano/ChangeLog,v 1.119 2006/07/15 02:34:48 vapier Exp $ *nano-1.3.12-r1 (15 Jul 2006) 15 Jul 2006; Mike Frysinger <vapier@gentoo.org> - +files/nano-1.3.12-scroll.patch, +nano-1.3.12-r1.ebuild: - Fix from upstream. + +files/nano-1.3.12-scroll.patch, +files/nano-1.3.12-path.patch, + +nano-1.3.12-r1.ebuild: + Fixes from upstream. 09 Jul 2006; Joshua Kinard <kumba@gentoo.org> nano-1.3.11-r2.ebuild: Marked stable on mips. diff --git a/app-editors/nano/files/nano-1.3.12-path.patch b/app-editors/nano/files/nano-1.3.12-path.patch new file mode 100644 index 000000000000..b8b2a7e11ff8 --- /dev/null +++ b/app-editors/nano/files/nano-1.3.12-path.patch @@ -0,0 +1,199 @@ +diff -ur nano-1.3.12/src/files.c nano-1.3.12-fixed/src/files.c +--- nano-1.3.12/src/files.c 2006-06-14 09:19:43.000000000 -0400 ++++ nano-1.3.12-fixed/src/files.c 2006-07-05 11:44:17.000000000 -0400 +@@ -902,21 +902,29 @@ + * able to go there. */ + char *get_full_path(const char *origpath) + { +- char *d_here, *d_there = NULL; ++ struct stat fileinfo; ++ char *d_here, *d_there, *d_there_file = NULL; ++ const char *last_slash; ++ bool path_only; + + if (origpath == NULL) + return NULL; + +- /* Get the current directory. */ ++ /* Get the current directory. If it doesn't exist, back up and try ++ * again until we get a directory that does, and use that as the ++ * current directory. */ + d_here = charalloc(PATH_MAX + 1); + d_here = getcwd(d_here, PATH_MAX + 1); + +- if (d_here != NULL) { +- const char *last_slash; +- char *d_there_file = NULL; +- bool path_only; +- struct stat fileinfo; ++ while (d_here == NULL) { ++ if (chdir("..") == -1) ++ break; ++ ++ d_here = getcwd(d_here, PATH_MAX + 1); ++ } + ++ /* If we succeeded, canonicalize it in d_here. */ ++ if (d_here != NULL) { + align(&d_here); + + /* If the current directory isn't "/", tack a slash onto the end +@@ -925,89 +933,91 @@ + d_here = charealloc(d_here, strlen(d_here) + 2); + strcat(d_here, "/"); + } ++ /* Otherwise, set d_here to "". */ ++ } else ++ d_here = mallocstrcpy(NULL, ""); + +- d_there = real_dir_from_tilde(origpath); ++ d_there = real_dir_from_tilde(origpath); + +- assert(d_there != NULL); ++ assert(d_there != NULL); + +- /* Stat d_there. If stat() fails, assume that d_there refers to +- * a new file that hasn't been saved to disk yet. Set path_only +- * to TRUE if d_there refers to a directory, and FALSE if +- * d_there refers to a file. */ +- path_only = !stat(d_there, &fileinfo) && +- S_ISDIR(fileinfo.st_mode); +- +- /* If path_only is TRUE, make sure d_there ends in a slash. */ +- if (path_only) { +- size_t d_there_len = strlen(d_there); +- +- if (d_there[d_there_len - 1] != '/') { +- d_there = charealloc(d_there, d_there_len + 2); +- strcat(d_there, "/"); +- } +- } ++ /* If stat()ing d_there fails, assume that d_there refers to a new ++ * file that hasn't been saved to disk yet. Set path_only to TRUE ++ * if d_there refers to a directory, and FALSE otherwise. */ ++ path_only = stat(d_there, &fileinfo) == 0 && ++ S_ISDIR(fileinfo.st_mode); + +- /* Search for the last slash in d_there. */ +- last_slash = strrchr(d_there, '/'); ++ /* If path_only is TRUE, make sure d_there ends in a slash. */ ++ if (path_only) { ++ size_t d_there_len = strlen(d_there); + +- /* If we didn't find one, then make sure the answer is in the +- * format "d_here/d_there". */ +- if (last_slash == NULL) { +- assert(!path_only); ++ if (d_there[d_there_len - 1] != '/') { ++ d_there = charealloc(d_there, d_there_len + 2); ++ strcat(d_there, "/"); ++ } ++ } + +- d_there_file = d_there; +- d_there = d_here; +- } else { +- /* If path_only is FALSE, then save the filename portion of +- * the answer, everything after the last slash, in +- * d_there_file. */ +- if (!path_only) +- d_there_file = mallocstrcpy(NULL, last_slash + 1); +- +- /* And remove the filename portion of the answer from +- * d_there. */ +- null_at(&d_there, last_slash - d_there + 1); +- +- /* Go to the path specified in d_there. */ +- if (chdir(d_there) == -1) { +- free(d_there); +- d_there = NULL; +- } else { +- /* Get the full path and save it in d_there. */ +- free(d_there); ++ /* Search for the last slash in d_there. */ ++ last_slash = strrchr(d_there, '/'); + +- d_there = charalloc(PATH_MAX + 1); +- d_there = getcwd(d_there, PATH_MAX + 1); ++ /* If we didn't find one, then make sure the answer is in the format ++ * "d_here/d_there". */ ++ if (last_slash == NULL) { ++ assert(!path_only); + +- if (d_there != NULL) { +- align(&d_there); ++ d_there_file = d_there; ++ d_there = d_here; ++ } else { ++ /* If path_only is FALSE, then save the filename portion of the ++ * answer (everything after the last slash) in d_there_file. */ ++ if (!path_only) ++ d_there_file = mallocstrcpy(NULL, last_slash + 1); ++ ++ /* And remove the filename portion of the answer from ++ * d_there. */ ++ null_at(&d_there, last_slash - d_there + 1); ++ ++ /* Go to the path specified in d_there. */ ++ if (chdir(d_there) == -1) { ++ free(d_there); ++ d_there = NULL; ++ } else { ++ free(d_there); + +- if (strcmp(d_there, "/") != 0) { +- /* Make sure d_there ends in a slash. */ +- d_there = charealloc(d_there, +- strlen(d_there) + 2); +- strcat(d_there, "/"); +- } +- } else +- /* If we couldn't get the full path, set path_only +- * to TRUE so that we clean up correctly, free all +- * allocated memory, and return NULL. */ +- path_only = TRUE; +- +- /* Finally, go back to the path specified in d_here, +- * where we were before. */ +- chdir(d_here); +- } ++ /* Get the full path. */ ++ d_there = charalloc(PATH_MAX + 1); ++ d_there = getcwd(d_there, PATH_MAX + 1); ++ ++ /* If we succeeded, canonicalize it in d_there. */ ++ if (d_there != NULL) { ++ align(&d_there); ++ ++ /* If the current directory isn't "/", tack a slash onto ++ * the end of it. */ ++ if (strcmp(d_there, "/") != 0) { ++ d_there = charealloc(d_there, strlen(d_there) + 2); ++ strcat(d_there, "/"); ++ } ++ } else ++ /* Otherwise, set path_only to TRUE, so that we clean up ++ * correctly, free all allocated memory, and return ++ * NULL. */ ++ path_only = TRUE; ++ ++ /* Finally, go back to the path specified in d_here, ++ * where we were before. We don't check for a chdir() ++ * error, since we can do nothing then. */ ++ chdir(d_here); + + /* Free d_here, since we're done using it. */ + free(d_here); + } + +- /* At this point, if path_only is FALSE and d_there exists, ++ /* At this point, if path_only is FALSE and d_there isn't NULL, + * d_there contains the path portion of the answer and + * d_there_file contains the filename portion of the answer. If +- * this is the case, tack d_there_file onto the end of +- * d_there, so that d_there contains the complete answer. */ ++ * this is the case, tack the latter onto the end of the former. ++ * d_there will then contain the complete answer. */ + if (!path_only && d_there != NULL) { + d_there = charealloc(d_there, strlen(d_there) + + strlen(d_there_file) + 1); diff --git a/app-editors/nano/nano-1.3.12-r1.ebuild b/app-editors/nano/nano-1.3.12-r1.ebuild index 780808dc4028..b7281fd7baee 100644 --- a/app-editors/nano/nano-1.3.12-r1.ebuild +++ b/app-editors/nano/nano-1.3.12-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-editors/nano/nano-1.3.12-r1.ebuild,v 1.1 2006/07/15 02:31:14 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-editors/nano/nano-1.3.12-r1.ebuild,v 1.2 2006/07/15 02:34:48 vapier Exp $ #ECVS_SERVER="savannah.gnu.org:/cvsroot/nano" #ECVS_MODULE="nano" @@ -24,6 +24,13 @@ DEPEND=">=sys-libs/ncurses-5.2 !ncurses? ( slang? ( sys-libs/slang ) )" PROVIDE="virtual/editor" +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-path.patch + epatch "${FILESDIR}"/${P}-scroll.patch +} + src_compile() { if [[ ! -e configure ]] ; then ./autogen.sh || die "autogen failed" |