summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@gentoo.org>2003-01-14 04:14:38 +0000
committerBrandon Low <lostlogic@gentoo.org>2003-01-14 04:14:38 +0000
commit727fcd294d0f6c69a58a24fb7e3710dab61edf28 (patch)
tree249781f9fa81f22da8e2bf552335722d44cfa729 /net-im/pork
parentversion bump (diff)
downloadhistorical-727fcd294d0f6c69a58a24fb7e3710dab61edf28.tar.gz
historical-727fcd294d0f6c69a58a24fb7e3710dab61edf28.tar.bz2
historical-727fcd294d0f6c69a58a24fb7e3710dab61edf28.zip
add /help command
Diffstat (limited to 'net-im/pork')
-rw-r--r--net-im/pork/ChangeLog10
-rw-r--r--net-im/pork/files/README.gentoo-0.3.02
-rw-r--r--net-im/pork/files/digest-pork-0.3.0-r11
-rw-r--r--net-im/pork/files/pork-0.3.0-help.patch141
-rw-r--r--net-im/pork/pork-0.3.0-r1.ebuild38
5 files changed, 190 insertions, 2 deletions
diff --git a/net-im/pork/ChangeLog b/net-im/pork/ChangeLog
index 1df946fb40f3..c8f43ff07908 100644
--- a/net-im/pork/ChangeLog
+++ b/net-im/pork/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-im/pork
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-im/pork/ChangeLog,v 1.1 2003/01/13 17:34:41 lostlogic Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-im/pork/ChangeLog,v 1.2 2003/01/14 04:14:38 lostlogic Exp $
+
+*pork-0.3.0-r1 (13 Jan 2003)
+
+ 13 Jan 2003; Brandon Low <lostlogic@gentoo.org> pork-0.3.0-r1.ebuild,
+ files/pork-0.3.0-help.patch:
+
+ Add the help command to pork, submitted upstream.
+
*pork-0.3.0 (13 Jan 2003)
diff --git a/net-im/pork/files/README.gentoo-0.3.0 b/net-im/pork/files/README.gentoo-0.3.0
index fbee603cc0cc..d36f63532c4c 100644
--- a/net-im/pork/files/README.gentoo-0.3.0
+++ b/net-im/pork/files/README.gentoo-0.3.0
@@ -18,7 +18,7 @@ This is FAR from complete in how to use pork, to find a full listing of commands
$ find /usr/share/pork/help
-To get the usage info about a specific command simply cat it's file out of the listing generated above.
+To get the usage info about a specific command simply cat it's file out of the listing generated above, or use the /help command from inside pork.
Things that I discovered: pork has a hard time syncing LARGE buddy lists on first connect. If you find that not all of your buddy list is downloaded from the server, you can actually use gaim to sync your list, and then copy that list verbatim from ~/.gaim/[screenname].0.blist to ~/.pork/[screenname]/buddy_list and restart pork to get your whole buddy list. Note that gaim uses all caps for the [screenname] and pork uses all lowercase.
diff --git a/net-im/pork/files/digest-pork-0.3.0-r1 b/net-im/pork/files/digest-pork-0.3.0-r1
new file mode 100644
index 000000000000..9925ebb99cc0
--- /dev/null
+++ b/net-im/pork/files/digest-pork-0.3.0-r1
@@ -0,0 +1 @@
+MD5 ffafe7b2a0f99c5fd66f60786a415b05 pork-0.3.0.tar.gz 341832
diff --git a/net-im/pork/files/pork-0.3.0-help.patch b/net-im/pork/files/pork-0.3.0-help.patch
new file mode 100644
index 000000000000..449f38c8b045
--- /dev/null
+++ b/net-im/pork/files/pork-0.3.0-help.patch
@@ -0,0 +1,141 @@
+diff -Nru pork-0.3.0-clean/src/Makefile.am pork-0.3.0/src/Makefile.am
+--- pork-0.3.0-clean/src/Makefile.am 2003-01-08 21:24:34.000000000 -0600
++++ pork-0.3.0/src/Makefile.am 2003-01-13 19:02:10.000000000 -0600
+@@ -2,7 +2,7 @@
+ bin_PROGRAMS = pork
+
+ AM_CFLAGS = -funsigned-char -Imissing -Wall
+-AM_CFLAGS += -DSYSTEM_PORKRC=\"$(pkgdatadir)/porkrc\"
++AM_CFLAGS += -DHELP_PATH=\"$(pkgdatadir)/help\" -DSYSTEM_PORKRC=\"$(pkgdatadir)/porkrc\"
+ AM_CFLAGS += $(PERL_CFLAGS) $(DEBUG_CFLAGS)
+
+ pork_LDFLAGS = -Lmissing -Llibfaim
+diff -Nru pork-0.3.0-clean/src/Makefile.in pork-0.3.0/src/Makefile.in
+--- pork-0.3.0-clean/src/Makefile.in 2003-01-08 21:41:16.000000000 -0600
++++ pork-0.3.0/src/Makefile.in 2003-01-13 19:02:10.000000000 -0600
+@@ -122,7 +122,7 @@
+ SUBDIRS = missing libfaim
+ bin_PROGRAMS = pork
+
+-AM_CFLAGS = -funsigned-char -Imissing -Wall -DSYSTEM_PORKRC=\"$(pkgdatadir)/porkrc\" $(PERL_CFLAGS) $(DEBUG_CFLAGS)
++AM_CFLAGS = -funsigned-char -Imissing -Wall -DHELP_PATH=\"$(pkgdatadir)/help\" -DSYSTEM_PORKRC=\"$(pkgdatadir)/porkrc\" $(PERL_CFLAGS) $(DEBUG_CFLAGS)
+
+ pork_LDFLAGS = -Lmissing -Llibfaim
+ pork_LDADD = -lmissing -lfaim -lncurses $(PERL_LIBS) $(DEBUG_LIBS)
+diff -Nru pork-0.3.0-clean/src/pork_command.c pork-0.3.0/src/pork_command.c
+--- pork-0.3.0-clean/src/pork_command.c 2003-01-08 20:33:32.000000000 -0600
++++ pork-0.3.0/src/pork_command.c 2003-01-13 22:11:43.000000000 -0600
+@@ -11,7 +11,9 @@
+ #include <config.h>
+
+ #include <unistd.h>
++#include <dirent.h>
+ #include <ncurses.h>
++#include <sys/stat.h>
+ #include <sys/types.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -1932,6 +1934,103 @@
+ }
+
+ USER_COMMAND(cmd_help) {
++ /* For printing help files */
++ char buf[4096];
++
++ /* Next 3 for separating args */
++ char *section;
++ char *command;
++ char *last;
++
++ /* Directory and filenames of help area */
++ char *dir_name;
++ char *file_name;
++
++ struct stat st;
++ struct dirent *d_ent;
++
++ DIR *dp;
++ FILE *fp;
++
++ /* Start both pointers at the beginning */
++ section = args;
++ command = section;
++
++ /* Ensure that the help files are available */
++ if (stat(HELP_PATH, &st) != 0 || !S_ISDIR(st.st_mode)) {
++ screen_err_msg("Cannot find help path: %s", HELP_PATH);
++ } else if (args != NULL) {
++ /* Parse the arguments into a section and a command */
++ while ((last = strsep(&args, " ")) != NULL) {
++ if (args != NULL) {
++ command = args;
++ }
++ if ( section < last && last < command ) {
++ *(last - 1) = '/';
++ }
++ }
++
++ /* Create full path of section */
++ dir_name = malloc(sizeof(HELP_PATH) + strlen(section) + 2);
++ snprintf(dir_name, sizeof(HELP_PATH) + strlen(section) + 2,
++ "%s/%s", HELP_PATH, section);
++ /* Create full path of command */
++ if ( command == section ) {
++ file_name = dir_name;
++ } else {
++ file_name = malloc(strlen(dir_name) + strlen(command) + 2);
++ snprintf(file_name, strlen(dir_name) + strlen(command) + 2,
++ "%s/%s", dir_name, command);
++ }
++
++ /* Make sure that we have a valid section */
++ if (stat(dir_name, &st) != 0 || !S_ISDIR(st.st_mode)) {
++ screen_err_msg("Error: %s is not a valid help command",
++ section);
++ /* Make sure we have a valid command */
++ } else if (stat(file_name, &st) != 0) {
++ screen_err_msg("Error: No help in section %s for %s",
++ section, command);
++ /* If command is a section itself, print the section */
++ } else if (S_ISDIR(st.st_mode)) {
++ screen_win_msg(cur_window(), 0, 0, 1,
++ "Help topics from command %s:", section);
++ dp = opendir(dir_name);
++ while((d_ent = readdir(dp)) != NULL){
++ if ( d_ent->d_name[0] != '.' )
++ screen_win_msg(cur_window(), 0, 0, 1,
++ "%s", d_ent->d_name);
++ }
++ closedir(dp);
++ /* If command matches a helpfile, print it */
++ } else if (S_ISREG(st.st_mode)) {
++ screen_win_msg(cur_window(), 0, 0, 1,
++ "Help from command %s for %s:", section, command);
++ fp = fopen(file_name,"r");
++ while (fgets(buf, sizeof(buf), fp) != NULL)
++ screen_win_msg(cur_window(), 0, 0, 1, "%s", buf);
++ fclose(fp);
++ /* If command matches anything else, error */
++ } else {
++ screen_err_msg("Error opening help file");
++ }
++ /* Clean up */
++ if (file_name != dir_name)
++ free(file_name);
++ free(dir_name);
++ /* Otherwise print the list of sections */
++ } else {
++
++ screen_win_msg(cur_window(), 0, 0, 1, "Available help commands:");
++
++ dp = opendir(HELP_PATH);
++ while((d_ent = readdir(dp)) != NULL){
++ if ( d_ent->d_name[0] != '.' )
++ screen_win_msg(cur_window(), 0, 0, 1,
++ "%s", d_ent->d_name);
++ }
++ closedir(dp);
++ }
+ }
+
+ USER_COMMAND(cmd_idle) {
diff --git a/net-im/pork/pork-0.3.0-r1.ebuild b/net-im/pork/pork-0.3.0-r1.ebuild
new file mode 100644
index 000000000000..5ad2570e01e5
--- /dev/null
+++ b/net-im/pork/pork-0.3.0-r1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-im/pork/pork-0.3.0-r1.ebuild,v 1.1 2003/01/14 04:14:38 lostlogic Exp $
+
+IUSE=""
+
+SRC_URI="mirror://sourceforge/ojnk/${P}.tar.gz"
+DESCRIPTION="Console based AIM client that looks like ircII"
+HOMEPAGE="http://dev.ojnk.net/"
+LICENSE="GPLv2"
+
+KEYWORDS="~x86"
+SLOT="0"
+DEPEND="sys-devel/perl
+ sys-libs/ncurses"
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S}
+ patch -p1 < ${FILESDIR}/${P}-help.patch || die
+}
+
+src_install() {
+ einstall
+
+ dodoc ${FILESDIR}/README.gentoo-${PV}
+
+ doman doc/pork.1
+ insinto /usr/share/pork/examples
+ doins examples/blist.txt
+
+ dodoc AUTHORS COPYING ChangeLog INSTALL NEWS README STYLE TODO
+}
+
+pkg_postinst() {
+ einfo "Please read /usr/share/doc/${PN}-${PVR}/README.gentoo-${PV} for quickstart info."
+}