dpkg-www-2.54+nmu1/0000755000232200023220000000000010751712464014264 5ustar pbuilderpbuilderdpkg-www-2.54+nmu1/src/0000755000232200023220000000000010751711346015051 5ustar pbuilderpbuilderdpkg-www-2.54+nmu1/src/dpkg-www.xpm0000644000232200023220000000232007633661570017353 0ustar pbuilderpbuilder/* XPM */ static char *dpkg_www[] = { "32 32 2 1", " c None", "# c #ff0000", " ", " # ", " ######### ", " ############## ", " ###### ###### ", " ##### #### ", " #### #### ", " #### #### ", " ## ### ", " ## ## ", " ## ## # ## ", " ### # ## ", " ## # ## ", " ## # ## ", " ## # ## ", " # # # ", " ## # ## ", " # # # ", " ## ## ## ", " # # ## ", " ## ####### ", " ## ", " ### ", " ## ", " ## ", " ## ", " ### ", " ## ", " ## ", " ### ", " ## ", " # " }; dpkg-www-2.54+nmu1/src/dpkg-www.10000644000232200023220000000545710222750501016702 0ustar pbuilderpbuilder.TH DPKG-WWW 1 "September 1, 2004" .SH NAME dpkg-www \- program to remotely open a WWW Debian package browser .SH SYNOPSIS .B dpkg-www .I [-s|--stdout] [-h|--host host] [query] .SH DESCRIPTION .B dpkg-www is used to remotely control a WEB browser and open a dpkg URL on the local host from an interactive shell or script. If the command is invoked while running under X-window the script will try to find an installed X browser to open the specified URL. If not running under X it will try to use a text browser instead. If Netscape is found and a Netscape instance is already running it will be asked to open the dpkg URL on localhost with the optional .I query supplied on the command line. If there is no browser running, it will start automatically a new one. The functionality provided by this program is identical to running a web browser with the .B \-remote openURL(http://localhost/cgi-bin/dpkg) argument or opening the same URL from within the browser. .B dpkg-www-installer is an helper application which can configured in the WWW browser for web installation. It should never be invoked directly by the user. .SH OPTIONS .TP \fB\-s\fR, \fB\-\-stdout\fR Redirect output to stdout. Requires one of the text browsers (lynx, lynx-ssl or links) installed. .TP \fB\-h\fR, \fB\-\-host\fR \fBhost\fR Send the query to a remote host, where dpkg-www must be installed. .TP .BI query Specifies an optional package name, an absolute pathname or a query argument which is passed to the dpkg cgi-bin. See .BR dpkg-www(8) for more information about the use of the cgi. .SH FILES .IP /etc/dpkg-www.conf .IP ~/.dpkg-www Configuration files for dpkg-www. It is not necessary for these files to exist, there are sensible defaults for everything, but you can specify your preferred www browser with the DPKG_WWW_BROWSER variable, for example: .B DPKG_WWW_BROWSER=mozilla .SH EXAMPLES .TP .B dpkg-www This would open a dpkg URL on localhost listing all the installed packages. .TP .B dpkg-www bash This would open a dpkg URL asking info on the bash package. .TP .B dpkg-www -h pisolo bash This would open a dpkg URL asking info on the bash package on host pisolo. .TP .B dpkg-www 'dpkg*' This would open a dpkg URL listing all packages matching dpkg*. .TP .B dpkg-www /bin/bash This would open a dpkg URL asking info on the package(s) owning the file /bin/bash . .TP .B dpkg-www depends=svgalib This would open a dpkg URL listing all packages depending on svgalib. .TP .B dpkg-www --stdout depends=awk | grep ^ii This would list on stdout all packages depending on awk and grep all lines of installed packages. .SH "SEE ALSO" .BR dpkg(8) , .BR dpkg-www(8) .SH AUTHOR Massimo Dal Zotto . .br Bugs should be reported via the normal Debian bug reporting system. .SH LICENCE dpkg-www is licensed under the GNU General Public License version 2. dpkg-www-2.54+nmu1/src/dpkg-www-browser0000755000232200023220000000531007362774470020241 0ustar pbuilderpbuilder#!/bin/sh # # Dpkg browser helper used by dpkg-www. # # Copyright (C) 1999-2001 Massimo Dal Zotto # # 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. usage() { echo "${0##*/} [-x|--xterm] [-f|--file] " } press_enter() { echo "" echo -n "Press Enter to close this window..."; read x } packageURI() { local package="$1" local pkgcache=$(tempfile) local srcpkgcache=$(tempfile) trap "rm -f $pkgcache $srcpkgcache" 0 apt-get -o "Debug::NoLocking=1" \ -o "Dir::Cache=/tmp" \ -o "Dir::Cache::pkgcache=$pkgcache" \ -o "Dir::Cache::srcpkgcache=$srcpkgcache" \ -o "Dir::Cache::archives=/var/cache/apt/archives" \ install --reinstall --print-uris -y "$package" \ | grep -F "/${package}_" \ | sed "/^'/!d; s/^'//; s/'.*//" rm -f $pkgcache $srcpkgcache 2>/dev/null } # Source optional config file test -e /etc/dpkg-www.conf && . /etc/dpkg-www.conf 2>/dev/null FILE="" ACTION="" HOST="" PACKAGES="" # Restart self in an xterm window. Must be the first option. Used by netscape. if [ "$DISPLAY" -a "$1" = "-x" -o "$1" = "--xterm" ]; then shift 1 xterm -T "Package Browser" -e $0 "$@" exit 0 fi while [ "${1#-}" != "$1" ]; do case "$1" in -\?|-help|--help) usage exit ;; -f|--file) FILE="$2" shift 2 ;; -*) echo "Invalid option: $1" >&2 press_enter exit 1 ;; esac done FILE="${FILE:-$1}" if [ "$FILE" != "" -a ! -e "$FILE" ]; then echo "File not found: $FILE" >&2 press_enter exit 1 fi request="$(cat "$FILE" | head -10)" if echo "$request" | grep -q "^Browse-package:"; then PACKAGE=$( echo "$request" | grep ^Browse-package: \ | head -1 | sed 's/.*: *//' ) else echo "Invalid request" >&2 press_enter exit 1 fi uri="$(packageURI "$PACKAGE")" file="${uri#file:}" if [ ! "$file" -o "$file" = "$uri" -o ! -e "$file" ]; then echo "Package not found: $file" >&2 press_enter exit 1 fi if [ "$DISPLAY" ]; then sensible-editor "$file" & sleep 1 else exec sensible-editor "$file" fi # end of file dpkg-www-2.54+nmu1/src/apache.conf0000644000232200023220000000036410321454556017144 0ustar pbuilderpbuilder# Apache config for dpkg-www # Disable execution of dpkg from remote hosts order deny,allow deny from all allow from localhost 127.0.0.1 # allow from .your_domain.com # End dpkg-www config dpkg-www-2.54+nmu1/src/dpkg-www.80000644000232200023220000002732010321455037016710 0ustar pbuilderpbuilder.TH DPKG-WWW 8 "Oct 7, 2005" .SH NAME dpkg-www, dpkg-www-installer \- WWW Debian package browser .SH SYNOPSIS http:///cgi-bin/dpkg .SH DESCRIPTION A typical Debian system can have hundreds installed packages and thousands available for installation. Information about installed and available packages can usually be obtained with the .B dpkg(1) command, but navigating through the package dependencies and the documentation files can be a very frustrating and time-consuming task. .PP With the .B dpkg-www cgi you can instead browse Debian packages info with a WEB browser, following package dependencies and locating documentation (man pages, Info files, READMEs, and so on) with a few mouse clicks. If you have superuser privileges you can even install, upgrade or remove packages from your WEB browser. The output provided by .B dpkg-www is basically that of .B dpkg with the addition of HREF's for packages dependencies and documentation files. .PP The cgi program can take an optional query argument which can be given in the URL or entered in the query field of the html form. This can be: .IP list concisely all installed packages .IP *\ (asterisk) list concisely all installed and available packages .IP list concisely the requested packages .IP list concisely all packages whose name matches the expression, for example `*image*' will find all packages which contain the string `image'. .IP list verbosely a package and, if the package is installed, all its files. If the package is not installed and the WEB installation is enabled you can install it by clicking on the `Install' button. If the package is installed you can remove it or upgrade to a new version, if available, by clicking on the respective buttons. .IP list all the packages owners of a file. This can be used for example to find which package installed a program. .IP / list all the packages owners of a file. The regexp form can be used to find which packages own a non installed file. .IP = list all the packages with control field matching value. If the field name is omitted the value is searched in any control field. The default search is a case-insensitive fixed substring match but it can be changed with the .B GREP_DCTRL_OPTS option in the config file. This feature works only if the .B grep-dctrl package is installed. .IP ?\ (question\ mark) show a concise help about the cgi usage. .IP \ (a\ single\ space) print only the input form, for use from window-manager menus. .SS Configuration dpkg-www can be configured by the local system administrator via the optional .I /etc/dpkg-www.conf file. This file is a simple Bourne shell .IR "" ( /bin/sh ) script that defines some or all the following variables (defaults are used if the file doesn't exist, or doesn't define the variable): .IP CHECK_BUTTONS If this option is enabled .B dpkw-www will add a small `install' check-button for each package shown in the package list. Default is 0 (disabled) because the resulting interface is not very nice. The use of this option is therefore not recommended. .IP INSTALL_BUTTON If this option is set the `Install' or `Upgrade' and `Remove' buttons will be added to the verbose info of a package. By clicking on these button you will start the installation of removal the package as described in the section .B WEB Installation. Since this option can potentially introduce security holes it is disabled (0) by default. Use at your own risk. If the variable is set to "top" the button will be located before the file list, default is the bottom of the page. .IP SHOW_LOCAL_FILES If this variable is set, dpkg-www will use file:/ style URL's to access html files -- bypassing the cgi script. This is faster on slow machines. Default is not defined, which means use local files for connection from localhost and http:// URL's for remote connections. .IP CHECK_PACKAGE_VERSION If this variable is set, dpkg-www will check if a newer version of an installed package is available. On slow machines you may want to set this option to false since it can considerably slow down the execution. .IP LIST_UNAVAILABLE This option enables listing also unavailable packages in the packages list. Disabled by default. .IP LIST_DOCUMENTATION This option enables the display of references to documents registered with .B install-docs(8) to the detailed package info, providing a quick path to relevant package documentation. Unfortunately this feature is not totally reliable because currently there is no way to find documents registered by a package with .B install-docs and the search is done with an ugly hack. Hopefully things will change in woody. This option is enabled (1) by default. .IP FORCE_SSH_PASSWD This option forces ssh passwd prompt for package installation on a remote host even if an ssh agent holds the private key. .IP GREP_DCTRL_OPTS These options are passed to .B grep-dctrl(1) when doing a query by field. Default is "-i" for case-insensitive fixed substring match. See .B grep-dctrl(1) for more info. .IP DPKG Command providing the .B dpkg(1) query functionalities. This can be .B dpkg or .B dlocate , or .B auto . Default is auto, meaning that the cgi will use .B dlocate if installed, otherwise revert to .B dpkg which should always be available on a Debian system. By specifying this option you can force the use of one of the two program. .IP MAN Manpage to HTML translation command. Can be .B dwww , .B man2html or .B auto . Default is auto, meaning that the cgi will use .B man2thml if installed, otherwise revert to .B dwww . By specifying this option you can force the use of one of the two program. .IP DEBIAN_CONTENTS Optional list of one or more .I Contents-xxx.gz files mapping each file available in the Debian GNU/Linux system to the package from which it originates. If available these files are used to find the owner packages of non installed files. This can be useful for quickly finding the package to install when a needed command is missing. .IP BGCOLOR background color of the HTML body. .IP DEBUG internal option used only for debugging. Disabled by default since it is useless for normal users. .IP DWWW_PATH path on webserver to dwww cgi-bin. .IP INFO2WWW_PATH path on webserver to info2www cgi-bin. .PP The following is an exaple /etc/dpkg-www.conf file: .PP .in +2 # Enable install check-buttons in package list. .br CHECK_BUTTONS=0 .br .br # Enable install, upgrade and remove buttons in package info. .br INSTALL_BUTTON=1 .br .br # List registered package documentation. .br LIST_DOCUMENTATION=1 .br .br # Options passed to grep-dctrl in queryPackagesByField() .br GREP_DCTRL_OPTS="-i" .br .br # Show local files directly. Automatically set. .br SHOW_LOCAL_FILES=auto .br .br # Force ssh passwd prompt even if an ssh agent holds .br # the private key. .br FORCE_SSH_PASSWD=true .br .br # List of Contents-xxx.gz files, if available. .br DEBIAN_CONTENTS=" .br \ \ \ \ \ \ \ \ /debian/dists/stable/Contents-i386.gz .br \ \ \ \ \ \ \ \ /debian/dists/potato/non-US/Contents-i386.gz" .br .br # Dpkg command (dpkg|dlocate|auto). Automatically detected. .br # DPKG=auto .br .br # Manpage conversion command (dwww|man2html|auto). Automatically detected. .br # MAN=auto .br .br # HTML background color. .br # BGCOLOR="#c0c0c0" .br .br # Enable cgi debugging. Not really useful. .br # DEBUG=1 .PP .SS Cgi access The information provided by .B dpkg-www and the ability to install or remove packages also remotely can potentially give useful information to crackers and open security holes. For these reasons access to this cgi program should be allowed only from localhost and trusted hosts or domains. Unfortunately this configuration is dependent on the particular installed WEB server. The dpkg-www package configures the apache server, if installed, to allow access only from localhost. Other WEB servers must be configured manually by the system administrator to restrict access to trusted hosts. If you administer many Debian system on a local network you may want to enable access to the cgi from your network and browse packages on any host from any other machine. .SS WEB installation If this option is enabled in the .I /etc/dpkg-www.conf file, the `Install', `Upgrade' and `Remove' buttons are added to the info page of installed or uninstalled packages. By clicking on this button the system administrator, or more precisely any user who has the ability to become system administrator (since you don't want to run a web browser as root!), will be able to install or remove a package on the fly, provided he has properly configured his browser for WEB installation. .PP For security reasons the installation is done entirely from the browser side, so that you don't need to gain root privileges from the cgi program which is run on the server. The only thing done on the server is to generate an installation request which is downloaded to the browser for the execution, which is started under control of the user and with his privileges. The real installation is done by a small helper script run from the user's browser when a document with content-type `application/dpkg-www-installer' is received from the web server. The helper script opens an XTerm on the user's display and runs a script which becomes superuser, after asking the root password, and execs an apt-get command to install the requested packages. .PP The WEB browser must have been configured to handle the above content-type by running the command "/usr/sbin/dpkg-www-installer -x -f '%s'", which must obviously intalled also on the client side if installing from remote. If the dpkg-www package is not installed on the browser client you can simply copy the script /usr/sbin/dpkg-www-installer and hope it works... .PP You can configure your .B Netscape. browser from the Navigator -> Application menu of the Preferences window. You must add a new item with MIME type "application/dpkg-www-installer" and application "/usr/sbin/dpkg-www-installer -x -f '%s'". This should add the following line to your Netscape mailcap file: .PP .in +2 application/dpkg-www-installer;/usr/sbin/dpkg-www-installer -x -f '%s' .PP The dpkg-www WEB installation has been succesfully tested only with .B Netscape. With other WEB browsers it is untested and it may not work correctly. .PP In order to be able to install the packages the user must known the root password asked for `su root' when installing on the local server, or have the ability to ssh as root to the remote host when installing from a remote client. .PP From the security point of view, executing a WEB installation is functionally equivalent to opening a shell in an XTerm, becoming superuser after having supplied the proper password and running apt-get as root to install or remove the required packages. Starting this from the WEB could be potentially vulnerable to man-in-the-middle attacks, but since it requires a password on the client it seems quite safe. If you are really paranoid connect to a secure server from an SSL-enabled browser. .PP The dpkg-www WEB installation is not intended to replace the normal use of apt-get from the shell. It is provided only as a shortcut to allow the installation of a package after having located it with the browser without needing to open a root shell and run apt-get manually. For normal package maintenance and system upgrade the use of apt-get from the shell is recommended. .SH FILES .IP /etc/dpkg-www.conf Configuration file for dpkg-www. It is not necessary for this file to exist, there are sensible defaults for everything. .SH "SEE ALSO" .BR dpkg(8) , .BR dwww(1) , .BR dwww(8) , .BR dlocate(1) , .BR man2html(8) , .BR grep-dctrl(1) .SH AUTHOR Massimo Dal Zotto . .br Bugs should be reported via the normal Debian bug reporting system. .SH LICENCE dpkg-www is licensed under the GNU General Public License version 2. dpkg-www-2.54+nmu1/src/dpkg0000755000232200023220000011701310751711346015727 0ustar pbuilderpbuilder#!/bin/bash # # Cgi interface to dpkg. Show information about debian packages. # # Copyright (C) 1999-2006 Massimo Dal Zotto # # 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. PROG_VERSION=2.54 SELF=${0##*/}; export SELF HELP_PAGE="/usr/share/man/man8/dpkg-www.8.gz" COLUMNS=256; export COLUMNS SECTION_DESCRIPTIONS=" admin Utilities to administer the system base Basic needed utilities of every Debian system comm Software to use your modem in the old fashioned style devel Development utilities, compilers, environments, libraries, etc. doc FAQs, HOWTOs, documents and software to browse documentation editors Software to edit files and programming environments electronics Electronics utilities games Programs to spend a nice time with after setting up Debian graphics Editors, viewers, converters... Everything to become an artist hamradio Software for ham radio interpreters Interpreters for interpreted languages and macro processors libs Libraries to make other programs work mail Programs to route, read, and compose E-mail messages math Math software misc Miscellaneous utilities that didn't fit well anywhere else net Daemons and clients to connect your system to the world news Software to access Usenet, to set up news servers, etc. non-us Software restricted in the US by export regulations or patents oldlibs Old versions of libraries, kept for backward compatibility otherosfs Software to use programs and filesystems for other O.S. science Basic tools for scientific work shells Command shells and friendly user interfaces for beginners. sound Utilities to deal with sound: mixers, players, recorders, etc. tex The famous typesetting software and related programs text Utilities to format and print text documents utils Utilities for file/disk manipulation, backup, monitoring, etc. web Web servers, browsers, proxies, download tools etc. x11 X servers, libraries, fonts, window managers, and applications " TASK_DESCRIPTIONS=" basic-desktop X window system c-dev C and C++ chinese-s simplified Chinese environment chinese-t traditional Chinese environment cyrillic Cyrillic environment database-server SQL database desktop desktop environment dialup dialup system dns-server DNS server file-server file server fortran-dev fortran french French environment games games german German environment japanese Japanese environment junior Debian Jr. korean Korean environment laptop laptop system mail-server mail server news-server usenet news server polish Polish environment print-server print server python-dev Python russian Russian environment science scientific applications spanish Spanish environment tcltk-dev Tcl/Tk tex TeX/LaTeX environment unix-server conventional unix server web-server web server " # Configuration defaults, can be overriden in /etc/dpkg-www.conf # SHOW_LOCAL_FILES=auto # Show local files directly (automatic) LIST_UNAVAILABLE=0 # List also unavailable packages LIST_DOCUMENTATION=1 # List registered package documentation DPKG=auto # Select the dpkg program (automatic) MAN=auto # Select the man program (automatic) DEBIAN_CONTENTS= # List of Contents-xxx.gz files INSTALLED_ONLY=0 # Only installed packages DPKG_STATUS=/var/lib/dpkg/status DPKG_AVAILABLE=/var/lib/dpkg/available TASK_DESCRIPTIONS_FILE=/usr/share/tasksel/debian-tasks.desc APT_CACHE_OPTS="-o APT::Cache::AllVersions=0" CHECK_PACKAGE_VERSION=true DPKG_WWW_BROWSER_HACK=false GREP_DCTRL_OPTS="-i" BGCOLOR="#c0c0c0" KEEP_INPUT=0 DEBUG=0 DWWW_PATH="/cgi-bin/dwww" INFO2WWW_PATH="/cgi-bin/info2www" # Install buttons support. This require that users define the following # mime action in their netscape mailcap file: # # application/dpkg-www-installer;/usr/sbin/dpkg-www-installer -f '%s' # CHECK_BUTTONS=0 # Enable install check-buttons in package list INSTALL_BUTTON=0 # Enable install button in package info # Source optional local configuration file test -e /etc/dpkg-www.conf && . /etc/dpkg-www.conf 2>/dev/null set -o noglob HOSTNAME_FULL="$(hostname -f)" HOSTNAME="${HOSTNAME_FULL%%.*}" # Use dlocate, if installed, to speedup certain queries if [ ! "$DPKG" -o "$DPKG" = auto ]; then if [ -x /usr/bin/dlocate ]; then DPKG=dlocate else DPKG=dpkg fi fi # Select the Manpage to HTML translator if [ "$MAN" = dwww ]; then MAN="${DWWW_PATH}?type=man\\\\&location=" fi if [ "$MAN" = man2html ]; then if [ -x /usr/lib/cgi-bin/man/man2html ]; then MAN="/cgi-bin/man/man2html?" elif [ -x /usr/lib/cgi-bin/man2html ]; then MAN="/cgi-bin/man2html?" else MAN="${DWWW_PATH}?type=man\\\\&location=" fi fi if [ ! "$MAN" -o "$MAN" = auto ]; then if [ -x /usr/lib/cgi-bin/man/man2html ]; then MAN="/cgi-bin/man/man2html?" elif [ -x /usr/lib/cgi-bin/man2html ]; then MAN="/cgi-bin/man2html?" else MAN="${DWWW_PATH}?type=man\\\\&location=" fi fi # If remote host is localhost generate local URL's for local files case "$REMOTE_HOST" in localhost|$HOSTNAME|$HOSTNAME_FULL) if [ ! "$SHOW_LOCAL_FILES" -o "$SHOW_LOCAL_FILES" = auto ]; then SHOW_LOCAL_FILES=true fi if [ "$HTTP_USER_AGENT" != "${HTTP_USER_AGENT#*Mozilla/[56]}" ]; then # It seems that Mozilla/5.0 refuses to access local files from # a web page for security reasons. SHOW_LOCAL_FILES=false fi ;; *) SHOW_LOCAL_FILES=false ;; esac # Print a short help for the cgi-program usage() { cat <<- EOF

You can query information about Debian packages and installed files. The search argument can be:

? show this help page
* list all packages available on your system
<empty> list all packages installed on your system
<space> print only the input form, for use from wm menus
package list the required package and its owned files
list of packages list required packages concisely
wilcard expression list matching packages concisely
absolute pathname list packages owning pathname
field=value list packages with control field matching value
=value list packages with any field matching value
section=? list available package sections
task=? list available tasks
recent=[<N>] list packages installed in last N days (default 1)

Examples:

* list all packages available on your system
<empty> list all packages installed on your system
binutils list verbosely the package binutils
dpkg apt list the dpkg and apt packages
jpeg* list packages with name beginning with "jpeg"
*jpeg* list packages with name containing "jpeg"
/usr/bin/tail list packages owning the file /usr/bin/tail
/.*/postfix list packages owning any file named "postfix" (1)
/.*pbm.* list packages owning any file matching *pbm* (1)
maintainer=Joey Hess list packages with maintainer Joey Hess (2)
section=net list packages with section net (2)
=firewall list packages with any field matching "firewall" (2)
section=? list available package sections
task=? list available tasks
recent=2 list packages installed in last 2 days
package hello install the package hello (3)
package hello remove the package hello (3)

(1) The regexp form can be used to query also packages owning files not installed on your system. However this works only if you have properly configured the variable DEBIAN_CONTENTS in the configuration file /etc/dpkg-www.conf. This query can be used to find which package you should install in order to get some missing command or file. Note that the leading '/' is required to distinguish filename queries from package queries.

(2) This works only if the grep-dctrl package is installed.

(3) This works only if INSTALL_BUTTON=1 has been set in the configuration file /etc/dpkg-www.conf, your browser has been configured to handle WEB installation requests and, of course, you know the root password. See dpkg-www(8) man page for more information.

EOF } debug() { test_flag "$DEBUG" && echo "$(escape_html "$*")
" } test_flag() { case "$1" in 0|false|n|no|"") return 1 ;; *) return 0 ;; esac } # Sanity check on input values checkInput() { if echo "$*" | grep -q '[(){}<>$%#&!|\\;`]'; then printError "Error: invalid input" exit fi } # Execute the query doQuery() { debug "doQuery $1" local query="$1" case "${query%/}" in \?|-\?|-h|-help|--help) usage ;; " ") return ;; -*) printError "Invalid keyword: $query" exit ;; /*) queryOwners "$query" ;; *=*) queryPackagesByField "$query" ;; *) checkInput "$query" queryPackages "$query" ;; esac } # Query one or more packages queryPackages() { debug "queryPackages $*" local packages="$*" local package="${packages%% *}" if [ ! "$packages" ]; then # No argument, show the package list debug "no arguments" listPackages elif [ "$package" != "$packages" -o "$packages" != "${packages#*[\[*?]}" ] then # Package list or wildcard, list packages concisely debug "package list" listPackages $packages else # One package, show package information debug "one package" listPackage $package fi } # Query one or more packages by control field value queryPackagesByField() { field="${*%%=*}"; arg="${*#$field}"; arg="${arg#=}" field="${field## }"; field="${field%% }" arg="${arg## }"; arg="${arg%% }" if [ "$field" = section -a "$arg" = "?" ]; then listSections return fi if [ "$field" = task -a "$arg" = "?" ]; then listTasks return fi if [ "$field" = recent -o "$field" = new ]; then listRecentPackages $arg return fi if [ "$field" != "" -a ! -x /usr/bin/grep-dctrl ]; then echo "
"
	echo -n "Error: the "
	echo -n "grep-dctrl"
	echo " command is not installed on your system"
	echo "
" return fi echo "
"
    echo "Packages with $(escape_html "${field:-any field matching} $arg")"
    echo ""
    {
	if [ -x /usr/bin/grep-dctrl ]; then
	    grep-dctrl $GREP_DCTRL_OPTS -s Package -F "$field" "$arg" \
		$DPKG_STATUS $DPKG_AVAILABLE
	else
	    apt-cache search "$arg" | sed 's/ .*//;s/^/Package: /'
	fi
	dpkg -l "*" 2>&1
    } \
    | awk '
	/^Package:/ { p[$2]=1; NR=0; next }
	(NR <= 5) { print }
	(p[$2] != 1) { next }
	{ print }' \
    | listFilter
    echo "
" } # List available sections listSections() { sections=$( grep -h "^Section:" $DPKG_STATUS $DPKG_AVAILABLE \ | sed 's|.*:[ ]*||; s|.*/||' | sort | uniq | grep -v "^non-" ) echo "
"
    echo "Available sections:"
    echo ""
    for s in $sections; do
	desc=$(
	    echo "$SECTION_DESCRIPTIONS" | sed "/^$s/!d; s/^$s[	 ]*//;q"
	)
	desc=${desc:="no description available"}
	x=$(printf "%$[16-${#s}]s" " ")
	echo "  ${s}${x} ${desc}"
    done
    echo "
" } # List available tasks listTasks() { tasks=$( grep -h "^Task:" $DPKG_STATUS $DPKG_AVAILABLE \ | sed 's|.*:[ ]*||; s|,[ ]*|\ |g' | sort | uniq ) echo "
"
    echo "Available tasks:"
    echo ""
    for t in $tasks; do
	desc=$(
	    if [ -e "$TASK_DESCRIPTIONS_FILE" ]; then
		cat "$TASK_DESCRIPTIONS_FILE" 2>/dev/null | awk -v t="$t" '
		    /^Task:/ { task = $2 }
		    /^Description:/ && (task == t) {
			sub($1"[ ]*",""); print; exit
		    }'
	    else
		echo "$TASK_DESCRIPTIONS" | sed "/^$t/!d; s/^$t[ 	]*//;q"
	    fi
	)
	desc=${desc:="no description available"}
	x=$(printf "%$[16-${#t}]s" " ")
	echo "  ${t}${x} ${desc}"
    done
    echo "
" } # List recent packages listRecentPackages() { n=${1:-1} packages=$( find /var/lib/dpkg/info/ -daystart \( -name \*.list -a -mtime -$n \) \ | sed 's|.list$||;s|.*/||' \ | sort ) if [ "$packages" ]; then echo "
"
	echo "Recent packages in last $n days:"
	echo ""
	dpkg -l $packages 2>&1 | listFilter
	echo "
" else echo "
"
	echo "No recent packages in last $n days"
	echo "
" fi } # List one or more packages concisely listPackages() { debug "listPackages $*" echo "
"
    dpkg -l "$@" 2>&1 | listFilter
    echo "
" } # List a single package # listPackage() { debug "listPackage $*" local package="$1" local installed local status local version local latest local priority local essential pkg_info="$(dpkg -s $package)" if [ ! "$pkg_info" ]; then # Unknown package or virtual package listVirtualPackage $package || listUnknownPackage $package return 1 fi status="$(echo "$pkg_info" | awk '/^Status:/ {print $4}')" # installed The package is unpacked and configured OK. # half-installed The installation has started but not completed. # not-installed The package is not installed on your system. # unpacked The package is unpacked, but not configured. # half-configured The package configuration has not completed. # config-files Only the config files exist on the system. # Handle unknown package if [ ! "$status" ]; then listUnknownPackage $package return 1 fi if [ "$status" = not-installed -o "$status" = config-files ]; then if [ -x /usr/bin/apt-cache ]; then pkg_info="$( echo "$pkg_info" \ | grep "^\(Package\|Status\|Priority\|Section\):" apt-cache $APT_CACHE_OPTS show $package 2>/dev/null \ | sed 's/^installed-size:/Installed-Size:/' \ | grep -v -e "^\(Package\|Status\|Priority\|Section\):" \ -e "^\(Filename\|MD5sum\|Size\):" )" else pkg_info="$( echo "$pkg_info" \ | grep "^\(Package\|Status\|Priority\|Section\):" dpkg --print-avail $package 2>/dev/null \ | grep -v -e "^\(Package\|Status\|Priority\|Section\):" \ -e "^\(Filename\|MD5sum\|Size\):" )" fi fi # Check for newer version of installed package if [ "$status" = installed ]; then version="$(echo "$pkg_info" | awk '/^Version:/ {print $2}')" priority="$(echo "$pkg_info" | grep ^Priority: | awk '{print $2}')" essential="$(echo "$pkg_info" | grep ^Essential: | awk '{print $2}')" if test_flag "$CHECK_PACKAGE_VERSION"; then latest=$( apt-cache $APT_CACHE_OPTS show $package \ | grep ^Version: | awk '{print $2}' ); latest=${latest:-$version} if dpkg --compare-versions "$latest" gt "$version"; then pkg_info="$( echo "$pkg_info" \ | sed "/^Version:/s/\$/ (latest is $latest)/" )" fi else latest="$version" fi fi echo "
"

    # Print package info
    echo "$pkg_info" | packageFilter $package

    if [ "$INSTALL_BUTTON" = "top" ]; then
	addButtons
    fi

    # Print documentation and file list
    if [ "$status" != not-installed ]; then
	listPackageDocumentation $package
	listPackageFiles $package
    fi

    if [ "$INSTALL_BUTTON" != "top" ]; then
	addButtons
    fi

    echo "
" } # Add "Install", "Update" and "Remove" buttons if enabled. addButtons() { if [ "$status" = installed ]; then if [ "$priority" = required -o "$essential" = yes ]; then if [ "$version" != "$latest" ]; then addUpgradeButton $package $latest fi else if [ "$version" != "$latest" ]; then addRemoveUpgradeButtons $package $latest else addRemoveButton $package fi fi else addInstallButton $package fi } # Print a "Package not installed" message and add the "Install" button # if enabled in the configuration file. # addInstallButton() { debug "addInstallButton $*" local package="$1" local pkgname="$package" if test_flag "$INSTALL_BUTTON"; then echo "
" \ "" echo -n \ "Package $(escape_html "$package") is not installed." \ "" \ "
" else echo "" echo "Package $(escape_html "$package") is not installed." fi } # Add the "Remove" button if enabled in the configuration file. # addRemoveButton() { debug "addRemoveButton $*" local package="$1" local pkgname="$package" if test_flag "$INSTALL_BUTTON"; then echo "
" \ "" echo -n \ "" \ "package $package" \ "
" fi } # Add the "Upgrade" button if enabled in the configuration file. # addUpgradeButton() { debug "addUpgradeButton $*" local package="$1" local latest="$2" local pkgname="$package" if test_flag "$INSTALL_BUTTON"; then echo "
" \ "" echo -n \ "" \ "package $package to version $latest" \ "
" fi } # Add the "Remove" and "Upgrade" buttons if enabled in the configuration file. # addRemoveUpgradeButtons() { debug "addRemoveUpgradeButtons $*" local package="$1" local latest="$2" local pkgname="$package" if test_flag "$INSTALL_BUTTON"; then echo "
" \ "" echo -n \ "" \ "package $package. " \ "" \ "to version $latest" \ "
" fi } # List all packages providing a virtual package. # listVirtualPackage() { debug "listVirtualPackage $*" local package="$1" local packages=$( cat $DPKG_STATUS $DPKG_AVAILABLE \ | awk -v package=$package ' /^Package:/ { owner = $2 } /^Provides:/ { gsub(",","") for (i=2; i<=NF; i++) { if ($i == package) { print owner } } }' \ | sort | uniq ) test "$packages" || return 1 debug "is virtual package" echo "
"
    echo "Virtual package $(escape_html "$package") is provided by:"
    echo "
" listPackages $(echo $packages) } listUnknownPackage() { debug "listUnknownPackage $*" local package="$(escape_html "$1")" echo "
"
    echo "Package $package is not installed and no info is available."
    echo "
" } listPackageFiles() { debug "listPackageFiles $*" local package="$1" echo echo "Files owned by package $(escape_html "$package"):" echo $DPKG -L $package | sort | fileFilter } # This is really ugly but I don't know a better way since install-docs # doesn't record package ownership of documents. # listPackageDocumentation() { debug "listPackageDocumentation $*" local package="$1" local installdocs_files local document_id local f test_flag "$LIST_DOCUMENTATION" || return test -x /usr/sbin/install-docs || return test -e /var/lib/dpkg/info/$package.postinst || return installdocs_files=$( cat /var/lib/dpkg/info/$package.postinst \ | grep 'install-docs[ ]*-i' \ | sed 's/.*install-docs[ ]*-i[ ]*//;s/[ ].*//' \ | sort | uniq ) debug "installdocs_files=$installdocs_files" test "$installdocs_files" || return echo echo "Documentation:" echo for f in $installdocs_files; do # Hack for postinsts with `$package' in filenames test ! -e $f && f="$(echo "$f" | sed "s/\$package/$package/i")" # Get document_id (this can be different than file basename) if [ -e $f ]; then document_id="$(grep "^Document:" "$f" | sed 's/.*: //' | head -1)" else document_id="${f##*/}" fi debug "document_id=$document_id" title="$( /usr/sbin/install-docs -s "$document_id" 2>/dev/null \ | awk '/^Title: / { sub("^Title: *",""); print $0 }' )" /usr/sbin/install-docs -s "$document_id" 2>/dev/null \ | awk ' /^Format:/ { format = $2 } /^Index: / { print $2 "\t" format } /^Files: / { if (!match($2,"\\*")) { print $2 "\t" format } }' \ | sort | uniq | fileFilter "$title" | sed 's/^/ /' done } # Find all packages owning a file. Must be able to handle things like: # # /usr/lib/games/maelstrom/Maelstrom Fonts # /usr/share/ucblogo/logolib/# # /usr/share/ucblogo/logolib/` # /etc/diskless-image/config.sh # /bin/bash # /.*/postfix # /.*pbm.* # queryOwners() { debug "queryOwners $*" local file="${1%/}" local owners=$( # Must grep the exact filename when using dlocate $DPKG -S "$file" 2>/dev/null | grep ": $file$" | cut -f1 -d: \ | grep -v diversion | tr -d ',' ) if [ "$owners" ]; then echo "
"
	echo "Packages owning $(escape_html "$file"):"
	echo "
" listPackages $owners return fi if [ "$DEBIAN_CONTENTS" ]; then owners=$( zcat $DEBIAN_CONTENTS 2>/dev/null \ | grep "^${file#/}[ ][ ]*[^ ]*\$" \ | sed "s^${file#/}[ ][ ]*; s/,/\\ /" | sed 's|.*/||' \ | sort | uniq ) fi if [ "$owners" ]; then echo "
"
	echo "Packages owning $(escape_html "$file"):"
	echo "
" listPackages $owners return fi echo "
"
    echo "No package is owning $(escape_html "$file")"
    echo "
" } # Convert package info to html by adding hrefs to other packages. # packageFilter() { local package="$1" local uri="" if [ "$DPKG_WWW_BROWSER_HACK" = true -a "$SHOW_LOCAL_FILES" ]; then uri="$(packageURI "$package")" test "$uri" = "${uri#file:/}" && uri="" fi awk -v SELF=$SELF -v package="$package" -v uri="$uri" ' { gsub("<","\\<"); gsub(">","\\>") } /^Package:/ { # Add link to the Debian package page for this package p = s = package; gsub("\\+", "%2B", s) u = "http://packages.debian.org" $2 = sprintf("%s", u,s,p) } /^Section:/ { # Add link to package section list s = t = r = $2 gsub("\\+", "\\+", r) gsub("\\+", "%2B", s) sub(r, "" t "", $2) } /^Task:/ { # Add links to package tasks list for (f=2; f<=NF; f++) { r = $f; gsub(",", "", r) s = t = r gsub("\\+", "\\+", r) gsub("\\+", "%2B", s) sub(r, "" t "", $f) } } /^Maintainer:/ { # Add link to maintainer packages overview m = $0; sub(".*: ","",m);sub(" <.*","",m);gsub("[()]","\\\\&",m) e = $0; sub(".*<","",e);sub(">.*","",e) u = "http://qa.debian.org/developer.php/developer.php?login=" e sub(m, "&") # Add link to Debian BTS page for this package s = package; gsub("\\+", "%2B", s) d = "[Debian Bug Report]" u = "http://bugs.debian.org/cgi-bin/pkgreport.cgi" h = sprintf("%s", u,s,d) $0 = $0 " " h } /^(Depends|Pre-Depends|Conflicts|Replaces|Provides|Suggests|\ |Recommends|Enhances):/\ { # Workaround for apt-cache missing space: # Depends: python-slang(>= 0.2.0), python (>= 2.1) gsub("\\(", " (") for (f=2; f<=NF; f++) { if ($f == "|") { continue } if (match($f,"^\\(")) { f++; continue } r = $f; gsub(",", "", r) s = t = r gsub("\\+", "\\+", r) gsub("\\+", "%2B", s) sub(r, "" t "", $f) } } /^Description:/ { if (uri != "") { s = package t = uri gsub("\\+", "%2B", s) gsub("^file:", "", t) h = SELF "?browse=Browse&packages=" s printf("Filename: %s\n", h, t) } } /^Version:/ { if (match($0, "latest is")) { # Show latest version in bold sub("\\(latest is", "(latest is"); sub("\\)", ")") } } /^$/ { next} /^ .$/ { $0 = " " } { print }' } # Convert a dpkg package list to html adding hrefs to package names. # This is used for both file list and documentation list. # listFilter() { awk -v SELF=$SELF \ -v CHECK_BUTTONS=$CHECK_BUTTONS \ -v DPKG_AVAILABLE=$DPKG_AVAILABLE \ -v LIST_UNAVAILABLE=$LIST_UNAVAILABLE \ -v INSTALLED_ONLY=$INSTALLED_ONLY ' BEGIN { is_hdr = 1 statMax = 3 nameMax = 10 versMax = 10 descMax = 10 if (CHECK_BUTTONS) { pkg_button = \ "" install_button = \ "" reset_button = \ "" buttonW = 2 } } /^No packages found matching/ { print $0 missing++ NR-- next } (is_hdr) { header[NR] = $0 } (is_hdr == 1) && ($1 == "||/") { # ||/ Name Version Description hstat = $1 hname = $2 hvers = $3 hdesc = $4 is_hdr = 2 next } (is_hdr == 2) { # +++-==============-==============-=============================== split($0,A,"-") statLen = length(A[1]) nameLen = length(A[2]) versLen = length(A[3]) hsep = A[4] A[4] A[4] is_hdr = 0 next } (!is_hdr) { # ii dpkg-www 2.52 package description ... stat = substr($0,1,statLen) name = substr($0,5,nameLen) vers = substr($0,6+nameLen,versLen) desc = substr($0,7+nameLen+versLen) sub("[ ]+$","",name) sub("[ ]+$","",vers) sub("[ ]+$","",desc) if (INSTALLED_ONLY && !match(stat,"^(i.|.c)")) { next } # if (vers == "") { vers = "-" } nameMax = max(nameMax, length(name)) versMax = max(versMax, length(vers)) descMax = max(descMax, length(desc)) packages[NR,"stat"] = stat packages[NR,"name"] = name packages[NR,"vers"] = vers packages[NR,"desc"] = desc if (desc == "(no description available)") { needs_desc = missing_desc[name] = NR } } END { if (needs_desc) { update_descs() } if (NR < 6) { if (!missing) { print "no packages found" } exit } if (missing) { print "" } if (CHECK_BUTTONS) { printf "
" } for (i=1; i<=3; i++) { print header[i] } descMax = max(descMax,80-statMax-nameMax-versMax-3) printf("%s %s %s %s\n", \ pad(hstat,statMax+buttonW), pad(hname,nameMax), \ pad(hvers,versMax), hdesc) printf("+++%s-%s-%s-%s\n", substr("--",1,buttonW), \ pad(hsep,nameMax), pad(hsep,versMax), pad(hsep,descMax)) nr = NR npackages = 0 for (i=6; i<=nr; i++) { name = packages[i,"name"] if (!name) { continue } if (CHECK_BUTTONS) { if (substr(packages[i,"stat"],2,1) == "n") { stat = pad(packages[i,"stat"],statMax) button = sprintf(pkg_button, name",") install = 1 } else { stat = pad(packages[i,"stat"],statMax) button = " " } } else { stat = pad(packages[i,"stat"],statMax) } npad = pad("", nameMax-length(name)) vers = escape(pad(packages[i,"vers"],versMax)) desc = escape(packages[i,"desc"]) if ((LIST_UNAVAILABLE == 0) && (desc == "(no description available)")) { NR-- continue } href = link = name gsub("\\+", "%2B", href) href = "" link "" npad printf("%s%s %s %s %s\n", stat, button, href, vers, desc) npackages++ } if (npackages > 0) { npad = statMax+2+buttonW+nameMax print "" printf(pad(sprintf("%d packages", npackages), npad)) } if (CHECK_BUTTONS) { if (install) { printf reset_button " " install_button "\n" } printf "
" } } function escape(s) { gsub("&","\\&",s) gsub("<","\\<",s) gsub(">","\\>",s) return s } function pad(s,l) { while (length(s) < l) { s = s " " } return substr(s,1,l) } function max(x,y) { return ((x > y) ? x : y) } function update_descs() { while (getline < DPKG_AVAILABLE) { if ($1 == "Package:") { if ((nr=missing_desc[$2])) { package = $2 } else { package = "" } } if (package && ($1 == "Version:")) { sub("Version: ",""); vers = $0 packages[nr,"vers"] = vers versMax = max(versMax, length(vers)) } if (package && ($1 == "Description:")) { sub("Description: ",""); desc = $0 packages[nr,"desc"] = desc descMax = max(descMax, length(desc)) } } }' } # Convert a file list to html adding hrefs to files in /usr/{doc,info,man}. # fileFilter() { awk -v title="$*" -v show_local_files="$SHOW_LOCAL_FILES" \ -v man="$MAN" -v info2www="$INFO2WWW_PATH" -v dwww="$DWWW_PATH" ' /\/usr\/(share\/)?([a-zA-Z0-9_+-]+\/)?man\/.*\..*/ { if (title) { t = title } else { t = $1 } if ($2) { t = t " [" $2 "]"; NF=1 } r = s = $1 gsub("\\+", "\\+", r); gsub("\\+", "%2B", s); gsub("\\$","\\$",r) sub(r, "" t "") print next } /\/usr\/(share\/)?info\/.*\.gz/ { if (title) { t = title } else { t = $1 } if ($2) { t = t " [" $2 "]"; NF=1 } r = s = $1 gsub("\\+", "\\+", r); gsub("\\+", "%2B", s); gsub("\\$","\\$",r) sub(r, "" t "") print next } /\/usr\/(doc|share\/(doc|gtk-doc|gnome\/(html|help)|RFC))\// { if (title) { t = title } else { t = $1 } if ($2) { t = t " [" $2 "]"; NF=1 } r = s = $1 gsub("\\+", "\\+", r); gsub("\\+", "%2B", s); gsub("\\$","\\$",r) if (show_local_files == "true") { sub(r, "" t "") } else { sub(r, ""\ t "") } print next } /^\/.$/ { next } /^$/ { next } /^[^\/]/ { sub("^"," ") } { print }' } packageURI() { local package="$1" local pkgcache=$(tempfile) local srcpkgcache=$(tempfile) trap "rm -f $pkgcache $srcpkgcache" 0 apt-get -o "Debug::NoLocking=1" \ -o "Dir::Cache=/tmp" \ -o "Dir::Cache::pkgcache=$pkgcache" \ -o "Dir::Cache::srcpkgcache=$srcpkgcache" \ -o "Dir::Cache::archives=/var/cache/apt/archives" \ install --reinstall --print-uris -y "$package" \ | grep -F "/${package}_" \ | sed "/^'/!d; s/^'//; s/'.*//" rm -f $pkgcache $srcpkgcache 2>/dev/null } printInstallRequest() { local packages="$1" local host="$HOSTNAME_FULL" cat <<-EOF

dpkg-www WEB Installation

If you are reading this document on your browser or you have been asked to save it to disk instead of running the installation of the required packages this means that your browser has not been set up correctly for dpkg-www WEB installation. See dpkg-www(8) man page for more information.

EOF } printRemoveRequest() { local packages="$1" local host="$HOSTNAME_FULL" cat <<-EOF

dpkg-www WEB Deinstallation

If you are reading this document on your browser or you have been asked to save it to disk instead of running the installation of the required packages this means that your browser has not been set up correctly for dpkg-www WEB installation. See dpkg-www(8) man page for more information.

EOF } printBrowseRequest() { local package="$1" local host="$HOSTNAME_FULL" cat <<-EOF

dpkg-www Browse Request

If you are reading this document on your browser or you have been asked to save it to disk instead of running a browser on the required packages this means that your browser has not been set up correctly for dpkg-www WEB installation. See dpkg-www(8) man page for more information.

EOF } # Get the value of a query argument getValue() { local key="$1" test -x /usr/bin/perl || return perl -e "use CGI; my \$q = new CGI(\$_); print \$q->param('$key')" "$1" } escape_html() { echo "$*" | sed 's/&/\&/g; s/\"/\"/g; s//\>/g' } printHtmlHeader() { local title="${1:-Debian Packages}" local content_type="${2:-text/html}" test "$html_header_done" && return html_header_done=true echo "Content-type: $content_type" echo "Connection: close" echo "" if [ "$content_type" ]; then echo "" echo "" echo "$title" echo "" echo "" fi } # Generate an input form or the tag printInputForm() { local default local installed test "$noheader" = true && return test "$input_form_done" = true && return test "$KEEP_INPUT" = 1 && default="$query" test "$INSTALLED_ONLY" = 1 && installed="checked" echo "

Debian packages on $HOSTNAME

" if [ -x /usr/bin/perl ]; then echo '

' if [ "${HTTP_USER_AGENT#Lynx}" != "$HTTP_USER_AGENT" ]; then echo "

" echo "Search:" echo '' echo '' echo '(? for help)
' echo '' \ 'only installed packages' '
 
' echo '
' else echo "
" echo '' echo '' echo '' echo '' \ 'only installed packages' echo '
' test "$query" != " " && echo '
' fi echo '

' else echo '

' echo '' echo '

' fi input_form_done=true } # Print bottom info printHtmlBottom() { test "$noheader" = true && return cat <<- EOF


Generated by dpkg-www $PROG_VERSION - Copyright (C) 1999-2006 Massimo Dal Zotto <dz@debian.org>

$(test "${tempfile}" && echo "
" && cat $tempfile | sed 's/")
	
	
EOF
}

printError() {
    local message="$*"
    printHtmlHeader "$title" text/html
    printInputForm
    echo "

" echo "$(escape_html "$message")" echo "

" usage printHtmlBottom } #------------------------------------------------------------------------------ # Get the query arguments if [ "$*" ]; then # ISINDEX or interactive invocation debug="" query="$*" help="" install="" remove="" browse="" packages="" bgcolor="" noheader="" installed="" else # GET method debug="$(getValue debug)" query="$(getValue query)" help="$(getValue help)" install="$(getValue install)" remove="$(getValue remove)" browse="$(getValue browse)" packages="$(getValue packages)" bgcolor="$(getValue bgcolor)" noheader="$(getValue noheader)" installed="$(getValue installed)" fi test "$help" != "" && query="?" test "$debug" != "" && DEBUG="$debug" test "$bgcolor" != "" && BGCOLOR="$bgcolor" # Print debugging info if test_flag "$DEBUG"; then printHtmlHeader "$title" text/html cat <<- EOF

	$(env | sort)
	SELF=$SELF
	DPKG=$DPKG
	SHOW_LOCAL_FILES=$SHOW_LOCAL_FILES
	LIST_DOCUMENTATION=$LIST_DOCUMENTATION
	CHECK_BUTTONS=$CHECK_BUTTONS
	INSTALL_BUTTON=$INSTALL_BUTTON
	PROG=$0
	ARGC=$#
	ARGV="$(escape_html "$*")"
	query="$(escape_html "$query")"
	install="$(escape_html "$install")"
	remove="$(escape_html "$remove")"
	browse="$(escape_html "$browse")"
	packages="$(escape_html "$packages")"
	bgcolor="$(escape_html "$bgcolor")"
	noheader="$(escape_html "$noheader")"
	installed="$(escape_html "$installed")"
	debug="$(escape_html "$debug")"
	
EOF tempfile=$(tempfile); trap "rm -f $tempfile" 0 exec 2>$tempfile set -x fi # Sanity check on input values. $query is checked in doQuery. checkInput "$install$remove$packages$debug" if [ "$install" -a "$remove" ]; then printError "Error: invalid request" exit fi if [ "$install$remove$browse" -a "$packages" = "" ]; then printError "Error: invalid request" exit fi if [ "$install$remove$browse" -a "$query" != "" ]; then printError "Error: invalid request" exit fi if [ "$install" -a "$install" != "Install" -a "$install" != "Upgrade" ]; then printError "Error: invalid request" exit fi if [ "$remove" -a "$remove" != "Remove" ]; then printError "Error: invalid request" exit fi if [ "$browse" -a "$browse" != "Browse" ]; then printError "Error: invalid request" exit fi if [ "$installed" != "" ]; then if test_flag "$installed"; then INSTALLED_ONLY=1 else INSTALLED_ONLY=0 fi fi title="Debian Packages${query:+: $query}" if [ "$install" ]; then printHtmlHeader "Package Installation" application/dpkg-www-installer printInstallRequest "$packages" printHtmlBottom elif [ "$remove" ]; then printHtmlHeader "Package Deinstallation" application/dpkg-www-installer printRemoveRequest "$packages" printHtmlBottom elif [ "$browse" ]; then printHtmlHeader "Package Browser" application/dpkg-www-browser printBrowseRequest "$packages" printHtmlBottom else printHtmlHeader "$title" text/html printInputForm doQuery "$query" printHtmlBottom fi # end of file dpkg-www-2.54+nmu1/src/dpkg-www-installer0000755000232200023220000001060511032500425020526 0ustar pbuilderpbuilder#!/bin/sh # # Dpkg-www install helper used for dpkg-www cgi installation. # # Copyright (C) 1999-2003 Massimo Dal Zotto # # 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. usage() { echo "${0##*/} [-x|--xterm] [-f|--file] " } press_enter() { echo "" echo -n "Press Enter to close this window..."; read x } # Restart self in an xterm window. Must be the first option. Used by netscape. if [ "$1" = "-x" -o "$1" = "--xterm" ]; then shift 1 xterm -T "Package Installation" -e $0 "$@" exit 0 fi # Restart self in an xterm window. Used by mozilla which can't pass -x switch. if [ "$DPKG_WWW_INSTALLER_XTERM" != true ] && ! tty -s; then DPKG_WWW_INSTALLER_XTERM=true xterm -T "Package Installation" -e $0 "$@" exit 0 fi # Source optional config file test -e /etc/dpkg-www.conf && . /etc/dpkg-www.conf 2>/dev/null FILE="" ACTION="" HOST="" PACKAGES="" while [ "${1#-}" != "$1" ]; do case "$1" in -\?|-help|--help) usage exit ;; -f|--file) FILE="$2" shift 2 ;; -*) echo "Invalid option: $1" >&2 press_enter exit 1 ;; esac done FILE="${FILE:-$1}" if [ "$FILE" != "" -a ! -e "$FILE" ]; then echo "File not found: $FILE" >&2 press_enter exit 1 fi request="$(cat "$FILE" | head -10)"; rm -f "$FILE" if echo "$request" | grep -q "^Install-packages:"; then ACTION=install HOST=$( echo "$request" | grep ^Install-host: \ | head -1 | sed 's/.*: *//; s/,/ /g' ) PACKAGES=$( echo "$request" | grep ^Install-packages: \ | head -1 | sed 's/.*: *//; s/,/ /g' ) else ACTION=remove HOST=$( echo "$request" | grep ^Remove-host: \ | head -1 | sed 's/.*: *//; s/,/ /g' ) PACKAGES=$( echo "$request" | grep ^Remove-packages: \ | head -1 | sed 's/.*: *//; s/,/ /g' ) fi if [ ! "$HOST" ]; then echo "Missing hostname" >&2 press_enter exit 1 fi if [ "$(echo "$HOST" | sed 's/[ a-zA-Z0-9_.+-]//g')" ]; then echo "Invalid characters in hostname: $HOST" >&2 press_enter exit 1 fi if [ ! "$PACKAGES" ]; then echo "Missing package names" >&2 press_enter exit 1 fi # From Debian Packaging Manual, 4.2.1: # # The name of the binary package. Package names consist of the alphanumerics # and + - . (plus, minus and full stop). In current versions of dpkg they are # sort of case-sensitive. # if [ "$(echo "$PACKAGES" | sed 's/[ a-zA-Z0-9.+-]//g')" ]; then echo "Invalid characters in package names: $PACKAGES" >&2 press_enter exit 1 fi if [ $(echo "$PACKAGES" | wc -w) -gt 1 ]; then if [ "$ACTION" = install ]; then echo "Installing the following packages on $HOST:" else echo "Removing the following packages on $HOST:" fi echo "" echo "$PACKAGES" \ | if [ -x /usr/bin/fold ]; then fold -s -w 76; else cat; fi \ | sed 's/^/ /' echo "" else if [ "$ACTION" = install ]; then echo "Installing package $PACKAGES on $HOST." else echo "Removing package $PACKAGES from $HOST." fi echo "" fi case "$HOST" in localhost|$(hostname)|$(hostname -f)) if [ "$(id -u)" = "0" ]; then echo "You should NOT run this script as root!" echo "" echo -n "Press Enter to continue..."; read x echo "" apt-get -s $REINSTALL $ACTION $PACKAGES; echo apt-get $REINSTALL $ACTION $PACKAGES else echo -n "Root "; su root -c "\ apt-get -s $REINSTALL $ACTION $PACKAGES; echo apt-get $REINSTALL $ACTION $PACKAGES" fi ;; *) # Ignore any active ssh-agent to force ssh passwd prompt test "$FORCE_SSH_PASSWD" = true && unset SSH_AGENT_PID SSH_AUTH_SOCK /usr/bin/ssh -l root "$HOST" PATH=/usr/sbin:/sbin:/usr/bin:/bin \ apt-get -s $REINSTALL $ACTION $PACKAGES \; echo \; \ apt-get $REINSTALL $ACTION $PACKAGES ;; esac press_enter exit 0 # end of file dpkg-www-2.54+nmu1/src/dpkg-www0000755000232200023220000000602711020063333016535 0ustar pbuilderpbuilder#!/bin/sh # # Command-line interface to dpkg-www. # # Copyright (C) 1999-2006 Massimo Dal Zotto # # 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. usage() { # Automatic help hack echo "Usage: ${0##*/} [] []" echo echo "Options:" echo sed '/^ -/!d; s/\\//; s/)//; s/#//' $0 echo } urlencode() { perl -e ' $s=join(" ",@ARGV); $s=~s/([^a-zA-Z0-9 _\.*@-])/uc sprintf("%%%02x",ord($1))/eg; $s=~s/ /+/g; print $s . "\n";' "$*" } DPKG_WWW_URL="http://${DPKG_WWW_HOST:-localhost}/cgi-bin/dpkg" X11_BROWSERS="\ sensible-browser x-www-browser mozilla firefox galeon gzilla arena chimera chimera2 amaya gnome-help-browser opera netscape" TXT_BROWSERS="\ sensible-browser www-browser lynx lynx-ssl links w3m" browser= browser_args= while [ "${1#-}" != "$1" ]; do case "$1" in -\?|-help|--help) usage exit ;; -x|--xtrace) shift 1 set -x ;; -h|--host) #host# test "$2" || { usage; exit 1; } DPKG_WWW_URL="http://${2}/cgi-bin/dpkg" shift 2 || exit 1 ;; -s|--stdout) shift 1 export DISPLAY="" noheader="&noheader=true" if [ -x /usr/bin/lynx ]; then browser="lynx" browser_args="-dump -nolist" elif [ -x /usr/bin/lynx-ssl ]; then browser="lynx" browser_args="-dump -nolist" elif [ -x /usr/bin/links ]; then browser="links" browser_args="" elif [ -x /usr/bin/w3m ]; then browser="w3m" browser_args="" fi ;; --|*) break ;; esac done # Source optional local and user configuration files test -e /etc/dpkg-www.conf && . /etc/dpkg-www.conf 2>/dev/null test -e ~/.dpkg-www && . ~/.dpkg-www 2>/dev/null if [ "$DISPLAY" ]; then for f in $browser $DPKG_WWW_BROWSER $X11_BROWSERS $TXT_BROWSERS; do if which $f >/dev/null 2>&1; then browser=$f break fi done else for f in $browser $DPKG_WWW_BROWSER $TXT_BROWSERS; do echo $X11_BROWSERS | grep -qw "$f" && continue # skip X11 $BROWSER if which $f >/dev/null 2>&1; then browser=$f break fi done fi if [ ! "$browser" ]; then echo "dpkg-www: no WWW browser found" >&2 exit 1 fi query=$(urlencode "$*") if [ "$DEBUG" = 1 -o "$DEBUG" = true ]; then echo $browser $browser_args "$DPKG_WWW_URL?query=$query$noheader" fi exec $browser $browser_args "$DPKG_WWW_URL?query=$query$noheader" # end of file dpkg-www-2.54+nmu1/src/dpkg-www.conf0000644000232200023220000000246310321452170017462 0ustar pbuilderpbuilder# Configuration file for dpkg-www. See dpkg-www(8) for more info. # Enable install check-buttons in package list. Not recommended. CHECK_BUTTONS=0 # Enable the install, upgrade and remove buttons in package info page. # Use at your own risk. Possible values: (0|1|top). INSTALL_BUTTON=0 # List also unavailable packages. LIST_UNAVAILABLE=0 # List registered package documentation. LIST_DOCUMENTATION=1 # Show local files directly. Automatically set. SHOW_LOCAL_FILES=auto # Check for newer versions. On slow machines you may want to disable this. CHECK_PACKAGE_VERSION=1 # Options passed to grep-dctrl in queryPackagesByField() GREP_DCTRL_OPTS="-i" # Force ssh passwd prompt even if an ssh agent holds the private key. FORCE_SSH_PASSWD=true # List of Contents-xxx.gz files, if available. # DEBIAN_CONTENTS=" # /mirror/debian/dists/stable/Contents-i386.gz # /mirror/debian/dists/stable/non-US/Contents-i386.gz" # Dpkg command (dpkg|dlocate|auto). Automatically detected. #DPKG=auto # Manpage conversion command (dwww|man2html|auto). Automatically detected. #MAN=auto # HTML background color. BGCOLOR="#d0e0d0" # Enable cgi debugging. Not really useful to normal users. # DEBUG=1 # Path on webserver to dwww #DWWW_PATH="/cgi-bin/dwww" # Path on webserver to info2www #INFO2WWW_PATH="/cgi-bin/info2www" # end of file dpkg-www-2.54+nmu1/debian/0000755000232200023220000000000011020063761015473 5ustar pbuilderpbuilderdpkg-www-2.54+nmu1/debian/dpkg-www.mime0000644000232200023220000000020310075315376020121 0ustar pbuilderpbuilderapplication/dpkg-www-installer; /usr/sbin/dpkg-www-installer %s; needsterminal; description=dpkg-www-installer request; priority=2 dpkg-www-2.54+nmu1/debian/copyright0000644000232200023220000000207710421404113017426 0ustar pbuilderpbuilderThis package was written by Massimo Dal Zotto on Mon, 2 Aug 1999 17:37:25 +0200. This software is released under the terms of the GNU General Public Licence. Copyright (C) 1999-2006 Massimo Dal Zotto 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 St, Fifth Floor, Boston, MA 02110-1301, USA. On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. dpkg-www-2.54+nmu1/debian/dirs0000644000232200023220000000013510201450532016352 0ustar pbuilderpbuilderetc usr/bin usr/lib/cgi-bin usr/sbin usr/share/man/man1 usr/share/man/man8 usr/share/pixmaps dpkg-www-2.54+nmu1/debian/postinst0000644000232200023220000000075710506214563017320 0ustar pbuilderpbuilder#!/bin/sh set -e case "$1" in configure) ;; abort-upgrade|abort-remove|abort-deconfigure) exit 0 ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac for server in apache2 apache apache-ssl; do apachectl="/usr/sbin/${server}ctl" apachepid="/var/run/${server}.pid" if [ -x $apachectl -a -f $apachepid ]; then echo "Restarting $server..." >&2 $apachectl restart >&2 Build-Depends: debhelper (>= 4.1.16) Standards-Version: 3.5.8 Package: dpkg-www Architecture: all Depends: apt, dwww, info2www, perl | perl5, apache2 | httpd Suggests: dlocate, grep-dctrl, mozilla-firefox | www-browser, man2html, tasksel Description: Web based Debian package browser With the dpkg cgi-bin you can browse Debian packages on a local or remote host using a normal web browser. . You can list packages, show package information and installed files, browse documentation and navigate through the packages dependencies. You can also find all the packages owners of a file or directory or those providing a virtual package. . If you are the system administrator you can also install or remove packages by clicking on the buttons found in the package info page, provided that this feature has been enabled and you have properly configured your web browser. dpkg-www-2.54+nmu1/debian/changelog0000644000232200023220000005132211020063724017347 0ustar pbuilderpbuilderdpkg-www (2.54+nmu1) unstable; urgency=low * Non-maintainer upload. * Lintian-based changes: - Build-Depend on debhelper, clean-should-be-satisfied-by-build-depends - debian/compat:4, comment DH_COMPAT in rules, debian-rules-sets-DH_COMPAT - s/-$(MAKE)/$(MAKE)/ debian/rules as Makefile is always present + debian-rules-ignores-make-clean-error * Fixed bashisms in dpkg-www-installer (Closes: #468679). - Additionally changed the shebang of dpkg-www to sh, as it's bashisms-free -- Raphael Geissert Fri, 30 May 2008 15:46:11 -0500 dpkg-www (2.54) unstable; urgency=low * Fixed parsing of dpkg -l headers in listFilter. Closes: #463871. -- Massimo Dal Zotto Mon, 04 Feb 2008 23:31:43 +0100 dpkg-www (2.53) unstable; urgency=low * Rewritten parsing of dpkg -l headers in listFilter. Closes: #455483. * Fixed package building with dash as /bin/sh. Closes: #459047. -- Massimo Dal Zotto Tue, 22 Jan 2008 15:05:09 +0100 dpkg-www (2.52) unstable; urgency=low * Removed debconf stuff and moved notes to README.Debian. Closes: #388886, #372236, #383178. -- Massimo Dal Zotto Tue, 26 Sep 2006 14:08:33 +0200 dpkg-www (2.51) unstable; urgency=low * Updated Dutch translation. Closes: #380493. -- Massimo Dal Zotto Sun, 30 Jul 2006 18:28:55 +0200 dpkg-www (2.50) unstable; urgency=low * Updated Swedish translation. Closes: #365776. * Added Spanish translation. Closes: #367306. * Added Portuguese translation. Closes: #372236. * Updated Dutch translation. Closes: #375674. -- Massimo Dal Zotto Sat, 29 Jul 2006 17:52:01 +0200 dpkg-www (2.49) unstable; urgency=low * Added Polish translation. Closes: #339851. * Added Swedish translation. Closes: #333170. * Updated French translation. Closes: #333555. * Updated Czech translation. Closes: #335349. * Updated Russian translation. Closes: #340628, #361649. * Updated German translation. Closes: #345701. -- Massimo Dal Zotto Wed, 19 Apr 2006 12:00:39 +0200 dpkg-www (2.48) unstable; urgency=low * Fixed duplicate lines for doc-base documentation files. * Use apache's conf.d instead modifying httpd.conf. Also changed debconf templates to simply output a note. Closes: #281833, #329622. * Added Vietnamese translation. Thanks to Clytie Siddall. Closes: #311594. * Allow alternate location of info2www and dwww. Closes: #315541. * Added alternate dependency on debconf-2.0. Closes: #331805. * Added support for /usr/share/gtk-doc/html directory. * Removed again dependency on awk. -- Massimo Dal Zotto Fri, 7 Oct 2005 13:10:38 +0200 dpkg-www (2.47) unstable; urgency=low * Applied forgotten patch of dpkg-www-2.46. Closes: #302294. -- Massimo Dal Zotto Mon, 4 Apr 2005 10:05:00 +0200 dpkg-www (2.46) unstable; urgency=low * Fixed regexp for plus(+) in fileFilter when using gawk. Closes: #302294. * Added dependency on awk to have the installed flavors in reportbug. * Moved dpkg-www-installer manpage in section 8. -- Massimo Dal Zotto Thu, 31 Mar 2005 12:11:21 +0200 dpkg-www (2.45) unstable; urgency=low * Fixed po filename of Czech translation. Closes: #293781. * Moved menu icon in /usr/share/pixmaps/. -- Massimo Dal Zotto Sun, 6 Feb 2005 18:01:30 +0100 dpkg-www (2.44) unstable; urgency=low * Fixed translator name in fr.po file. * Added Dutch translation. Thanks to Luk Claes. Closes: #250235. * Added Czech translation. Thanks to Jan Outrata. Closes: #259182. * Added Japanese translation. Thanks to Hideki Yamane. Closes: #267676. * Updated German translation. Thanks to Erik Schanze. Closes: #284372. * Added mime file for dpkg-www-installer. Closes: #243186. * In dpkg-www added --host option and DPKG_WWW_HOST environment variable. Closes: #269273. -- Massimo Dal Zotto Fri, 4 Feb 2005 13:18:04 +0100 dpkg-www (2.43) unstable; urgency=low * Switched to gettex-based debconf templates. Closes: #200120. -- Massimo Dal Zotto Mon, 29 Dec 2003 18:05:08 +0100 dpkg-www (2.42) unstable; urgency=low * In dpkg-www script use sensible-browser if installed and allow users to choose a specific browser with the DPKG_WWW_BROWSER variable. Updated dpkg-www mapage. -- Massimo Dal Zotto Tue, 15 Jul 2003 12:43:33 +0200 dpkg-www (2.41) unstable; urgency=low * Properly escaped the '&' in dwww man prefix. Closes: Bug#197802. -- Massimo Dal Zotto Tue, 17 Jun 2003 23:12:10 +0200 dpkg-www (2.40) unstable; urgency=low * In input form added checkbox to limit search to installed packages. * Changed dpkg-www-installer to restart self in a xterm if stdin is not a tty. Needed for use with mozilla which seems unable to pass the -x switch to helper application. * Removed dpkg-www-browser helper application. -- Massimo Dal Zotto Fri, 23 May 2003 10:20:44 +0200 dpkg-www (2.39) unstable; urgency=low * In dpkg script search man2html both in /usr/lib/cgi-bin/man and /usr/lib/cgi-bin for compatibility with man2html 1.5k-1 and later. * Removed dependency on awk. * Added missing manpages. * Added menu icon. * Changed Standards-Version to 3.5.8. -- Massimo Dal Zotto Wed, 12 Mar 2003 11:23:10 +0100 dpkg-www (2.38) unstable; urgency=low * In postinst script redirected message to stderr since stdout is used by debconf. Closes: Bug#181041. -- Massimo Dal Zotto Tue, 11 Mar 2003 23:10:11 +0100 dpkg-www (2.37) unstable; urgency=low * During postinst update httpd.conf instead of access.conf. Closes: Bug#167155. * In dpkg-www script added sensible-browser to lists of known browsers. -- Massimo Dal Zotto Tue, 26 Nov 2002 12:23:22 +0100 dpkg-www (2.36) unstable; urgency=low * Added x-www-browser to the list of X browsers. Closes: Bug#162514. -- Massimo Dal Zotto Fri, 27 Sep 2002 22:28:24 +0200 dpkg-www (2.35) unstable; urgency=low * Fixed syntax error in printInputForm. -- Massimo Dal Zotto Sat, 7 Sep 2002 19:17:12 +0200 dpkg-www (2.34) unstable; urgency=low * Updated link to maintainer packages overview. * Updated dz's home page url in the bottom line. -- Massimo Dal Zotto Wed, 4 Sep 2002 21:34:41 +0200 dpkg-www (2.33) unstable; urgency=low * In dpkg-www script added --help and --stdout options. Updated man page. -- Massimo Dal Zotto Tue, 13 Aug 2002 14:26:47 +0200 dpkg-www (2.32) frozen unstable; urgency=high * In fileFilter() added /usr/share/gnome/html/ to doc dirs regexp. -- Massimo Dal Zotto Fri, 7 Jun 2002 18:35:17 +0200 dpkg-www (2.31) frozen unstable; urgency=high * In package info page added link to Igor Genibel's maintainer packages overview and printed latest available version in bold. -- Massimo Dal Zotto Wed, 15 May 2002 01:00:52 +0200 dpkg-www (2.30) frozen unstable; urgency=low * Changed Build-Depends control field to Build-Depends-Indep. Updated Standards-Version to 3.5.2. -- Massimo Dal Zotto Mon, 6 May 2002 17:00:24 +0200 dpkg-www (2.29) unstable; urgency=low * In packageFilter() added workaround for apt-cache missing spaces in Depends field. * Added hardcoded task descriptions in case tasksel is not installed. Suggests package tasksel. * Added support for HTML body color. * Handle package links in Enhances field. -- Massimo Dal Zotto Tue, 16 Apr 2002 10:49:12 +0200 dpkg-www (2.28) unstable; urgency=low * Added russian templates file. Closes: Bug#136931. * Added french templates file. Closes: Bug#137052. * Added italian templates file. -- Massimo Dal Zotto Wed, 6 Mar 2002 23:23:45 +0100 dpkg-www (2.27) unstable; urgency=low * In queryPackageByField() added special filed `recent' to list recently installed packages. Updated the html help page. -- Massimo Dal Zotto Thu, 3 Jan 2002 22:10:59 +0100 dpkg-www (2.26) unstable; urgency=low * Added german description to templates file. Closes: Bug#126179. -- Massimo Dal Zotto Sun, 23 Dec 2001 14:34:43 +0100 dpkg-www (2.25) unstable; urgency=low * Added debconf template for updating apache configfiles. Closes: Bug#121395. * Added the CHECK_PACKAGE_VERSION configuration option. * Code speed-ups, for slow machines. -- Massimo Dal Zotto Thu, 29 Nov 2001 10:32:48 +0100 dpkg-www (2.24) unstable; urgency=low * In dpkg cgi script added code to escape html output. -- Massimo Dal Zotto Wed, 21 Nov 2001 09:55:42 +0100 dpkg-www (2.23) unstable; urgency=low * In fileFilter() fixed \\& in dwww url. Closes: Bug#114688. * Fixed description of FORCE_SSH_PASSWD in dpkg-www(8) man page. * In listSections() added sections descriptions. * Added undocumented dpkg-www-browser hack. -- Massimo Dal Zotto Sun, 7 Oct 2001 19:39:01 +0200 dpkg-www (2.22) unstable; urgency=low * Added code for listing available sections and tasks. * In fileFilter() add links for documents in /usr/share/RFC. Any non-standard doc path should also be added to DWWW_DOCPATH in the /usr/sbin/dwww-convert script. -- Massimo Dal Zotto Tue, 18 Sep 2001 12:25:07 +0200 dpkg-www (2.21) unstable; urgency=low * In package info page link to Debian BTS after "Maintainer:" field. Replaced package name after "Package:" with link to debian package page. -- Massimo Dal Zotto Wed, 29 Aug 2001 22:49:37 +0200 dpkg-www (2.20) unstable; urgency=low * In package info page moved the link to Debian BTS after the package version. The link is now generated by packageFilter(). Replaced package section with link to package section list. * Fixed typo in Depends field (nawk -> mawk). -- Massimo Dal Zotto Fri, 24 Aug 2001 23:34:50 +0200 dpkg-www (2.19) unstable; urgency=low * In fileFilter() added version info for non-installed packages. * Remove dependencies on dpkg, bash and textutils. -- Massimo Dal Zotto Wed, 25 Jul 2001 09:10:27 +0200 dpkg-www (2.18) unstable; urgency=low * In package info page added link to Debian BTS page for the package as suggested by Adrian von Bidder. Closes: Bug#100143. * Added option INSTALL_BUTTON=top to have the buttons at the top, before the file list. * Disabled SHOW_LOCAL_FILES if HTTP user agent is Mozilla/5 since it seems it refuses to load local files from web pages, probably for security reasons. -- Massimo Dal Zotto Sat, 9 Jun 2001 15:47:41 +0200 dpkg-www (2.17) unstable; urgency=low * Added support for man2html in manpage conversion. Updated also dpkg-www.conf and the dpkg-www(8) man page. Closes: Bug#92301. -- Massimo Dal Zotto Sat, 31 Mar 2001 17:10:00 +0200 dpkg-www (2.16) unstable; urgency=low * Added missing doublequotes to sanity check tests. Added missing backslashes to addButton functions. -- Massimo Dal Zotto Tue, 6 Mar 2001 15:50:00 +0100 dpkg-www (2.15) unstable; urgency=low * In dpkg script added the `Upgrade' and `Remove' buttons in package info. Added also latest version information if a new version is available. * Updated the dpkg-www-installer script to handle remove requests. * Updated dpkg-www.conf, help page and dpkg-www(8) man page. * In dpkg script fixed typo in the sanity check code. * In fileFilter() fixed regexps to handle embedded $ and + in filenames. -- Massimo Dal Zotto Thu, 11 Jan 2001 19:37:27 +0100 dpkg-www (2.14) unstable; urgency=low * In dpkg-www-installer added a missing backslash in ssh command and forced ssh passwd prompt even if an ssh-agent holds the private key. Updated also the default config file and the dpkg-www(8) man page. -- Massimo Dal Zotto Mon, 11 Dec 2000 23:03:36 +0100 dpkg-www (2.13) unstable; urgency=low * In queryOwners() redirected dpkg error messages to /dev/null so that they don't go into the httpd logs. * Added an `Install' button example in the help page. -- Massimo Dal Zotto Sat, 9 Dec 2000 15:27:15 +0100 dpkg-www (2.12) unstable; urgency=low * In queryOwners() handle filenames with embedded spaces and non-ascii characters. Handle also files owned by multiple packages in Contents.gz files. * In doQuery() removed checkInput before queryOwners(). Now queryOwners accepts any input. -- Massimo Dal Zotto Wed, 6 Dec 2000 12:41:50 +0100 dpkg-www (2.11) unstable; urgency=low * In dpkg-www script added url encoding of input args. Updated also the dpkg-www man page. * In queryPackageByField() use `apt-cache show' if grep-dctrl is not installed and control field is not specified. * Changed input checks. Now queryPackageByField() accepts any input. * Added the KEEP_INPUT config variable. * Fixed synopsis in dpkg man page. * Added dpkg and apt dependencies. * Updated maintainer email address. -- Massimo Dal Zotto Thu, 30 Nov 2000 11:21:30 +0100 dpkg-www (2.10) unstable; urgency=low * In listPackageDocumentation() handle also document_id != filename, for example dpkg-internals in /usr/share/doc-base/dpkg-doc. * Updated man page and default config file. -- Massimo Dal Zotto Mon, 27 Nov 2000 19:06:57 +0100 dpkg-www (2.9) unstable; urgency=low * Added query by field. -- Massimo Dal Zotto Mon, 27 Nov 2000 15:15:56 +0100 dpkg-www (2.8) unstable; urgency=low * Fixed bug in listPackage() (unknownPackage instead of listUnknownPackage). * Added the LIST_UNAVAILABLE option to remove unvailable packages from the package list. * Added more examples in the help page. -- Massimo Dal Zotto Tue, 14 Nov 2000 09:33:11 +0100 dpkg-www (2.7) unstable; urgency=low * Added APT::Cache::AllVersions=0 to apt-cache to avoid duplicate packages with obsolete versions. -- Massimo Dal Zotto Fri, 10 Nov 2000 15:37:50 +0100 dpkg-www (2.6) unstable; urgency=low * Use apt-cache to get package info for non-installed packages. * In help page added HREF's for example queries. * If the query is " " print only the input form. * Added Debian menu entry. -- Massimo Dal Zotto Mon, 23 Oct 2000 12:05:16 +0200 dpkg-www (2.5) unstable; urgency=low * In addInstallButton() don't translate `+' to %2B (i.e. swish++). * In dpkg-www-installer fixed check on package names (must allow `.'). -- Massimo Dal Zotto Thu, 19 Oct 2000 17:11:13 +0200 dpkg-www (2.4) unstable; urgency=low * Replaced text '(? for help)' with help button. * Added some examples to the help page. * Fixed wrong check on number of packages in dpkg-www-installer. * Updated the man pages. -- Massimo Dal Zotto Sun, 1 Oct 2000 19:26:08 +0200 dpkg-www (2.3) unstable; urgency=low * Added search into Contents-*.gz for not installed files. * Added check for shell metacharacter in input args. * Fixed typo in printError(), was print instead of echo. -- Massimo Dal Zotto Sat, 23 Sep 2000 12:20:48 +0200 dpkg-www (2.2) unstable; urgency=low * In listFilter() handled case of required packages not found. * Added the dpkg-www(8) man page. * Added link to manpage in installation request error message. -- Massimo Dal Zotto Fri, 22 Sep 2000 17:49:16 +0200 dpkg-www (2.1) unstable; urgency=low * In listFilter() update descriptions from /var/lib/dpkg/available for packages with no description available (not installed). * Added noglob option to avoid shell pathname expansion on package glob expressions. * In listPackageDocumentation() added hack for packages which use the $package variable in the install-docs pathnames. Very ugly but I found no other way to solve it. -- Massimo Dal Zotto Sat, 2 Sep 2000 11:59:18 +0200 dpkg-www (2.0) unstable; urgency=low * Code cleanup and reorganization. * Unified the dpkg and dpkg-install cgi scripts. * Filtered the output of dlocate -S to remove non relevant matches. * Rewritten the dpkg-www-installer helper script. Changed the format of the installation request document sent to the browser. * Added links to package documents registered with install-docs. -- Massimo Dal Zotto Sat, 26 Aug 2000 16:03:24 +0200 dpkg-www (1.15) frozen unstable; urgency=low * Added experimental support for package installation (disabled by default because it requires also configuration of user's netscape browser). -- Massimo Dal Zotto Tue, 1 Aug 2000 20:39:38 +0200 dpkg-www (1.14) frozen unstable; urgency=low * Fixed bug in pkgFilter() which was printing the header line even if no matching packages were found. * Fixed fileFilter to handle info files in /usr/share/info/. * Added info2www dependency. -- Massimo Dal Zotto Tue, 1 Aug 2000 13:23:28 +0200 dpkg-www (1.13) frozen unstable; urgency=low * Adjust automatically the width of package name and version fields. Closes bug #54842. * Added code to detect if dlocate is installed and use it instead of dpkg. Closes bug #55124. * Closes bug #53746. Actually the bug was fixed in version 1.10 but never marked as closed by the sponsor uploader. * Added `Suggests:' field in debian/control. * In dpkg-www script added automatic search of an installed browser and replaced netscape-remote with netscape. The command has been moved to /usr/bin since it can be executed also outside X. -- Massimo Dal Zotto Wed, 12 Jul 2000 16:26:10 +0200 dpkg-www (1.12) frozen unstable; urgency=low * Added special case for gnome doc which is under /usr/share/gnome instead of /usr/share/doc. -- Massimo Dal Zotto Wed, 28 Jun 2000 11:44:41 +0200 dpkg-www (1.11-1) frozen unstable; urgency=low * Sponsor Upload. -- Paolo Didonè Thu, 2 Mar 2000 17:34:58 +0100 dpkg-www (1.11) frozen unstable; urgency=low * Added the dpkg-www command and relative manpage. -- Massimo Dal Zotto Thu, 2 Mar 2000 17:34:58 +0100 dpkg-www (1.10) unstable; urgency=low * Changed gawk to awk in statusFilter(). * Restored package architecture to all. -- Massimo Dal Zotto Fri, 31 Dec 1999 14:23:43 +0100 dpkg-www (1.9-1) unstable; urgency=low * Sponsor Upload. -- Paolo Didonè Tue, 28 Dec 1999 13:13:13 +0100 dpkg-www (1.9) unstable; urgency=low * Allow browsing local doc files from remote hosts. -- Massimo Dal Zotto Tue, 7 Dec 1999 10:03:52 +0100 dpkg-www (1.8) unstable; urgency=low * Fixed a typo in the html help message. -- Massimo Dal Zotto Mon, 22 Nov 1999 10:21:45 +0100 dpkg-www (1.7) unstable; urgency=low * Removed diversions of dwww-convert and dwww-find which are not really needed by this package and don't belong to it. -- Massimo Dal Zotto Wed, 10 Nov 1999 13:09:51 +0100 dpkg-www (1.6) unstable; urgency=low * Added support for wildcard queries. This can also be used to list all available packages. * Use dpkg --print-avail to show packages not installed. * In fileFilter, handle also files in /usr/share/doc/. -- Massimo Dal Zotto Tue, 9 Nov 1999 14:49:48 +0100 dpkg-www (1.5) unstable; urgency=low * Fixed html bug when dpkg -l lists version . * Added support for virtual packages. * Added some output hacks for lynx. -- Massimo Dal Zotto Sun, 7 Nov 1999 17:15:15 +0100 dpkg-www (1.4) unstable; urgency=low * Replaced the tag with an input form if perl is available. * Added help command. * Rewritten the listPackage code for package not found. * Show package status also for non installed packages. -- Massimo Dal Zotto Fri, 5 Nov 1999 15:22:37 +0100 dpkg-www (1.3) unstable; urgency=low * Fixed bug in the search of owners of a diverted files. -- Massimo Dal Zotto Wed, 3 Nov 1999 16:17:08 +0100 dpkg-www (1.2) unstable; urgency=low * Added email and copyright info to html output. -- Massimo Dal Zotto Sat, 2 Oct 1999 11:37:25 +0200 dpkg-www (1.1) unstable; urgency=low * Initial Release. * Changed dwww-convert and dwww-find to handle dpkg output. -- Massimo Dal Zotto Mon, 2 Aug 1999 17:37:25 +0200 Local variables: mode: debian-changelog End: dpkg-www-2.54+nmu1/debian/compat0000644000232200023220000000000211020062032016657 0ustar pbuilderpbuilder4 dpkg-www-2.54+nmu1/debian/menu0000644000232200023220000000046610201450415016364 0ustar pbuilderpbuilder?package(dpkg-www):needs="text" section="Help"\ title="Debian Package Browser" command="/usr/bin/dpkg-www ' '"\ icon="/usr/share/pixmaps/dpkg-www.xpm" ?package(dpkg-www):needs="x11" section="Help"\ title="Debian Package Browser" command="/usr/bin/dpkg-www ' '"\ icon="/usr/share/pixmaps/dpkg-www.xpm" dpkg-www-2.54+nmu1/debian/README.Debian0000644000232200023220000000273110506214462017543 0ustar pbuilderpbuilderdpkg-www for Debian ------------------- Web based Debian package browser. With this cgi program you can browse Debian packages using a WEB browser. You can easily follow package dependencies and browse package documentation with a mouse click. If you have properly configured the package you can also query which packages own a non-installed file or have a certain value in a control field. You can even install or remove packages from your browser if this feature is enabled in the site configuration file. WARNING! Allowing access to /cgi-bin/dpkg from any foreign host could allow a malicious external user to know your installed packages and try possible security exploits. You should therefore disable access to dpkg-www from foreign hosts. With apache you should add a file with the following instructions into apache conf.d directory: # Disable execution of dpkg from remote hosts order deny,allow deny from all allow from localhost allow from .your.domain The dpkg-www installation script will automatically install a default configuration file in /etc/{apache,apache2}/conf.d. If you are using a different httpd server you should make the appropriate changes in the proper httpd config file. Enabling the WEB installation feature could potentially introduce security holes in your system and your network. Use at yout own risk! -- Massimo Dal Zotto Tue Sep 26 14:11:49 CEST 2006 dpkg-www-2.54+nmu1/debian/rules0000755000232200023220000000355111020062345016554 0ustar pbuilderpbuilder#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This is the debhelper compatibility version to use. #export DH_COMPAT=4 CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir # Add here commands to compile the package. $(MAKE) touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. $(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/dpkg-www. $(MAKE) install DESTDIR=$(CURDIR)/debian/dpkg-www # Build architecture-independent files here. binary-indep: build install dh_testdir dh_testroot # dh_installdebconf dh_installdocs # dh_installexamples dh_installmenu # dh_installlogrotate # dh_installemacsen # dh_installpam dh_installmime # dh_installinit # dh_installcron dh_installman for f in dpkg-www-installer; do \ ln -s dpkg-www.8.gz \ $(CURDIR)/debian/dpkg-www/usr/share/man/man8/$$f.8.gz; \ done # dh_installinfo # dh_undocumented dh_installchangelogs # dh_link # dh_strip dh_compress dh_fixperms # dh_makeshlibs dh_installdeb # dh_perl # dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb # Build architecture-dependent files here. binary-arch: build install # We have nothing to do by default. binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure dpkg-www-2.54+nmu1/Makefile0000644000232200023220000000314710737413362015730 0ustar pbuilderpbuilder# Makefile PKGNAME = $(shell head -1 debian/changelog | sed 's/ .*//') VERSION = $(shell head -1 debian/changelog | sed 's/.*(//;s/).*//;s/-.*//') PKGFILE = $(PKGNAME)_$(VERSION)_all.deb CHANGES = $(PKGNAME)_$(VERSION)_$(shell dpkg --print-architecture).changes all: # Update program version from changelog if ! grep -q "^PROG_VERSION=$(VERSION)$$" src/dpkg; then \ sed '/^PROG_VERSION=/s/^.*$$/PROG_VERSION=$(VERSION)/' \ < src/dpkg > src/dpkg.new; \ mv -f src/dpkg.new src/dpkg; \ chmod 755 src/dpkg; \ fi install: @ mkdir -p $(DESTDIR)/usr/lib/cgi-bin @ mkdir -p $(DESTDIR)/usr/bin @ mkdir -p $(DESTDIR)/usr/share/man/man1 @ mkdir -p $(DESTDIR)/etc/apache/conf.d @ mkdir -p $(DESTDIR)/etc/apache2/conf.d cp -p src/dpkg $(DESTDIR)/usr/lib/cgi-bin/ cp -p src/dpkg-www $(DESTDIR)/usr/bin/ cp -p src/dpkg-www-installer $(DESTDIR)/usr/sbin/ cp -p src/dpkg-www.xpm $(DESTDIR)/usr/share/pixmaps/ cp -p src/dpkg-www.1 $(DESTDIR)/usr/share/man/man1/ cp -p src/dpkg-www.8 $(DESTDIR)/usr/share/man/man8/ cp -p src/dpkg-www.conf $(DESTDIR)/etc/ cp -p src/apache.conf $(DESTDIR)/etc/apache/conf.d/dpkg-www cp -p src/apache.conf $(DESTDIR)/etc/apache2/conf.d/dpkg-www clean: rm -f `find . -name \*~` distclean: clean diff: @diff -u src/dpkg /usr/lib/cgi-bin/dpkg package: dpkg-buildpackage -rfakeroot dist: dpkg-buildpackage -rfakeroot deb: dpkg-buildpackage -rfakeroot -us -uc debclean: fakeroot ./debian/rules clean debinst: cd .. && sudo dpkg -i $(PKGFILE) lintian: cd .. && lintian -i $(PKGFILE) upload: cd .. && grep -q 'PGP SIGNED MESSAGE' $(CHANGES) && dupload $(CHANGES) # end of file