[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#500397: debian-goodies: opens a package homepage



Package: debian-goodies
Version: 0.47
Severity: wishlist
Tags: patch

This little wrapper opens a package homepage in a sensible browser.



-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.27-rc6-00001-g46bec93 (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages debian-goodies depends on:
ii  curl                      7.18.2-7       Get a file from an HTTP, HTTPS or 
ii  dctrl-tools [grep-dctrl]  2.13.0         Command-line tools to process Debi
ii  dialog                    1.1-20080819-1 Displays user-friendly dialog boxe
ii  less                      418-1          Pager program similar to more
ii  lsof                      4.78.dfsg.1-4  List open files
ii  python                    2.5.2-1        An interactive high-level object-o
ii  whiptail                  0.52.2-11.3    Displays user-friendly dialog boxe

debian-goodies recommends no packages.

-- no debconf information
diff --git a/debian/control b/debian/control
index a45b2a9..619c7dd 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Standards-Version: 3.5.2
 
 Package: debian-goodies
 Architecture: all
-Depends: dctrl-tools | grep-dctrl, curl, python (>= 2.4), lsof, whiptail | dialog, less
+Depends: dctrl-tools | grep-dctrl, debianutils, curl, python (>= 2.4), lsof, whiptail | dialog, less
 Suggests: popularity-contest, xdg-utils, zenity
 Conflicts: debget
 Replaces: debget
diff --git a/dhomepage b/dhomepage
new file mode 100755
index 0000000..9b6e587
--- /dev/null
+++ b/dhomepage
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+#  Copyright (C) 2008  Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License along
+#  with this program; if not, write to the Free Software Foundation, Inc.,
+#  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+VERSION="0.1"
+
+function version()
+{
+  echo "dhomepage version $VERSION"
+  echo "dhomepage is licensed under the GNU General Public License"
+  echo "version 2 or later"
+}
+
+function usage()
+{
+  echo "dhomepage PACKAGE"
+  echo ""
+  echo "--version	Show version information"
+  echo "--help		Show this help message"
+  echo ""
+}
+
+PACKAGE="$1"
+
+if [ -z "$PACKAGE" ]; then
+  usage
+  exit 0
+fi
+
+case "$1" in
+	--help)
+		usage
+		exit 0
+		;;
+	--version)
+		version
+		exit 0
+		;;
+esac
+
+HOMEPAGE=`grep-aptavail -PX $PACKAGE -s Homepage | sed 's,^Homepage: ,,'`
+
+if [ -z "$HOMEPAGE" ]; then
+  HOMEPAGE=`grep-aptavail -PX $PACKAGE -s Description | \
+    sed -n '/^  Homepage: /{s,^  Homepage: ,,;p}'`
+fi
+
+if [ -z "$HOMEPAGE" ]; then
+  echo "$PACKAGE has no homepage"
+  exit 1
+fi
+
+sensible-browser "$HOMEPAGE"
diff --git a/dhomepage.1 b/dhomepage.1
new file mode 100644
index 0000000..5c3baf8
--- /dev/null
+++ b/dhomepage.1
@@ -0,0 +1,48 @@
+.\"
+.\"  Copyright (C) 2008  Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
+.\"
+.\"  This program is free software; you can redistribute it and/or modify
+.\"  it under the terms of the GNU General Public License as published by
+.\"  the Free Software Foundation; either version 2 of the License, or
+.\"  (at your option) any later version.
+.\"
+.\"  This program is distributed in the hope that it will be useful,
+.\"  but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\"  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\"  GNU General Public License for more details.
+.\"
+.\"  You should have received a copy of the GNU General Public License along
+.\"  with this program; if not, write to the Free Software Foundation, Inc.,
+.\"  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+.\"
+
+.TH DHOMEPAGE 1 2008-09-27
+
+.SH NAME
+dhomepage - show the homepage of a package in a browser
+
+.SH SYNOPSIS
+dhomepage PACKAGE
+
+.SH DESCRIPTION
+Shows the homepage of a Debian package using a sensible browser.
+
+.SH OPTIONS
+
+.TP
+\fB\-\-help\fR
+Print help message
+
+.TP
+\fB\-\-help\fR
+Print version message
+
+.SH EXIT STATUS
+Returns 0 if homepage was found, and 1 otherwise.
+
+.SH BUGS
+Report bugs to this man page and program to cascardo@minaslivre.org.
+
+.SH SEE ALSO
+.BR dgrep (1)
+.BR sensible-browser (1)

Reply to: