summaryrefslogtreecommitdiff
path: root/dh_installchangelogs
diff options
context:
space:
mode:
authorjoey <joey>1999-08-17 04:57:23 +0000
committerjoey <joey>1999-08-17 04:57:23 +0000
commit03d1a2e0c10456c65fbf36e1f38619803f4f2bfd (patch)
treee9ffa139a600309f9452db1337dedfb438d53734 /dh_installchangelogs
parent0a47c6cde2c9bca0f650b8731bb9fd11a7797f9e (diff)
downloaddebhelper-03d1a2e0c10456c65fbf36e1f38619803f4f2bfd.tar.gz
r110: Initial Import
Diffstat (limited to 'dh_installchangelogs')
-rwxr-xr-xdh_installchangelogs58
1 files changed, 32 insertions, 26 deletions
diff --git a/dh_installchangelogs b/dh_installchangelogs
index 15a42c09..0024fc10 100755
--- a/dh_installchangelogs
+++ b/dh_installchangelogs
@@ -1,4 +1,4 @@
-#!/bin/sh -e
+#!/usr/bin/perl -w
#
# Installs debian/changelog. If another filename is passed to it, installs
# that file as the upstream changelog.
@@ -7,35 +7,41 @@
# if so, the debian changelog is just installed as "changelog", and it is an
# error to specify an upstream changelog on the command line.
-PATH=debian:$PATH:/usr/lib/debhelper
-. dh_lib
+BEGIN { push @INC, "debian", "/usr/lib/debhelper" }
+use Dh_Lib;
+init();
-UPSTREAM=$1
+$upstream=shift;
-if isnative && [ "$UPSTREAM" ]; then
- error "Cannot specify an upstream changelog for a native debian package."
-fi
+if (isnative($dh{MAINPACKAGE}) && defined $upstream) {
+ error("Cannot specify an upstream changelog for a native debian package.");
+}
-if isnative; then
- CHANGELOG_NAME=changelog
-else
- CHANGELOG_NAME=changelog.Debian
-fi
+if (isnative($dh{MAINPACKAGE})) {
+ $changelog_name='changelog';
+}
+else {
+ $changelog_name='changelog.Debian';
+}
-for PACKAGE in $DH_DOPACKAGES; do
- TMP=`tmpdir $PACKAGE`
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ $TMP=tmpdir($PACKAGE);
+ $changelog=pkgfile($PACKAGE,"changelog");
- changelog=`pkgfile $PACKAGE changelog`
- if [ ! "$changelog" ]; then
- changelog=debian/changelog
- fi
+ if (!$changelog) {
+ $changelog="debian/changelog";
+ }
- if [ ! -d $TMP/usr/doc/$PACKAGE ]; then
- doit "install -d $TMP/usr/doc/$PACKAGE"
- fi
- doit "install -p -m644 $changelog $TMP/usr/doc/$PACKAGE/$CHANGELOG_NAME"
+ if (! -e $changelog) {
+ error("could not find changelog $changelog");
+ }
- if [ "$UPSTREAM" ]; then
- doit "install -p -m644 $UPSTREAM $TMP/usr/doc/$PACKAGE/changelog"
- fi
-done
+ if (! -d "$TMP/usr/doc/$PACKAGE") {
+ doit("install","-d","$TMP/usr/doc/$PACKAGE");
+ }
+ doit("install","-p","-m644",$changelog,"$TMP/usr/doc/$PACKAGE/$changelog_name");
+
+ if ($upstream) {
+ doit("install","-p","-m644",$upstream,"$TMP/usr/doc/$PACKAGE/changelog");
+ }
+}