From 183a7b8d1982fab62689fdf68df84b546171a699 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 23 Apr 2018 16:25:14 +0900 Subject: [PATCH] Imported Upstream version 3.15 Change-Id: I6fbd9bbbe040418f0959eea6e804f14f8b92668a Signed-off-by: DongHun Kwak --- Makefile | 30 ++++++++++---------- debian/changelog | 24 ++++++++++++++++ debian/control | 2 +- hostname.1 | 13 ++------- hostname.1.fr | 85 -------------------------------------------------------- hostname.c | 22 ++++++--------- 6 files changed, 53 insertions(+), 123 deletions(-) delete mode 100644 hostname.1.fr diff --git a/Makefile b/Makefile index a4855f8..4aa664b 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,9 @@ CFLAGS+=-O2 -Wall # uncomment the following line if you want to install to a different base dir. #BASEDIR=/mnt/test +BINDIR:=/bin +MANDIR:=/usr/share/man + OBJS=hostname.o hostname: $(OBJS) @@ -13,20 +16,19 @@ hostname: $(OBJS) ln -fs hostname nisdomainname install: hostname - install -d ${BASEDIR}/usr/share/man/man1 - install -o root -g root -m 0644 hostname.1 ${BASEDIR}/usr/share/man/man1 - ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/dnsdomainname.1 - ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/domainname.1 - ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/ypdomainname.1 - ln -fs hostname.1 ${BASEDIR}/usr/share/man/man1/nisdomainname.1 - #install -o root -g root -m 0644 hostname.1.fr ${BASEDIR}/usr/share/man/fr/man1/hostname.1 - - install -d ${BASEDIR}/bin - install -o root -g root -m 0755 hostname ${BASEDIR}/bin - ln -f hostname ${BASEDIR}/bin/dnsdomainname - ln -f hostname ${BASEDIR}/bin/domainname - ln -f hostname ${BASEDIR}/bin/nisdomainname - ln -f hostname ${BASEDIR}/bin/ypdomainname + install -d ${BASEDIR}$(MANDIR)/man1 + install -o root -g root -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1 + ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/dnsdomainname.1 + ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/domainname.1 + ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/ypdomainname.1 + ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/nisdomainname.1 + + install -d ${BASEDIR}$(BINDIR) + install -o root -g root -m 0755 hostname ${BASEDIR}$(BINDIR) + ln -fs hostname ${BASEDIR}$(BINDIR)/dnsdomainname + ln -fs hostname ${BASEDIR}$(BINDIR)/domainname + ln -fs hostname ${BASEDIR}$(BINDIR)/nisdomainname + ln -fs hostname ${BASEDIR}$(BINDIR)/ypdomainname clean: -rm -f $(OBJS) hostname dnsdomainname domainname nisdomainname ypdomainname diff --git a/debian/changelog b/debian/changelog index abe86c4..2cd375d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +hostname (3.15) unstable; urgency=low + + * Applied patch to make it possible to install binaries and man pages into + custom directories. + Thanks to Jiri Popelka (Closes: #726484) + * Tried to clarify manpage. (Closes: #718393) + * Removed hostname.1.fr with was outdated and not kept in sync. + + -- Michael Meskes Sun, 03 Nov 2013 15:27:04 +0100 + +hostname (3.14) unstable; urgency=low + + * Symlink binaries instead of hardlinking them. (Closes: #718400) + + -- Michael Meskes Fri, 06 Sep 2013 12:06:19 +0200 + +hostname (3.13) unstable; urgency=low + + * Finally completely remove verbose option. + Thanks to Jiri Popelka (Closes: #703974) + * Bumped Standards-Version to 3.9.4, no changes needed. + + -- Michael Meskes Tue, 18 Jun 2013 11:51:37 +0200 + hostname (3.12) unstable; urgency=low * Rewrote parts of the manpage. diff --git a/debian/control b/debian/control index bee7036..5533a75 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: admin Priority: required Maintainer: Debian Hostname Team Uploaders: Michael Meskes -Standards-Version: 3.9.3 +Standards-Version: 3.9.4 Build-Depends: debhelper (>= 5) Package: hostname diff --git a/hostname.1 b/hostname.1 index 48aed71..38c0a35 100644 --- a/hostname.1 +++ b/hostname.1 @@ -14,7 +14,6 @@ dnsdomainname \- show the system's DNS domain name .SH SYNOPSIS .B hostname -.RB [ \-v ] .RB [ \-a|\-\-alias ] .RB [ \-d|\-\-domain ] .RB [ \-f|\-\-fqdn|\-\-long ] @@ -25,13 +24,11 @@ dnsdomainname \- show the system's DNS domain name .RB [ \-y|\-\-yp|\-\-nis ] .br .B hostname -.RB [ \-v ] .RB [ \-b|\-\-boot ] .RB [ \-F|\-\-file\ filename ] .RB [ hostname ] .br .B hostname -.RB [ \-v ] .RB [ \-h|\-\-help ] .RB [ \-V|\-\-version ] .PP @@ -48,7 +45,6 @@ dnsdomainname \- show the system's DNS domain name .RB [ \-F\ file ] .PP .B dnsdomainname -.RB [ \-v ] .SH DESCRIPTION .B Hostname @@ -174,7 +170,7 @@ and should not be used anymore. Displays all FQDNs of the machine. This option enumerates all configured network addresses on all configured network interfaces, and translates them to DNS domain names. Addresses that cannot be translated (i.e. because -they do not have an appropriate reverse DNS entry) are skipped. Note that +they do not have an appropriate reverse IP entry) are skipped. Note that different addresses may resolve to the same name, therefore the output may contain duplicate entries. Do not make any assumptions about the order of the output. @@ -200,9 +196,9 @@ short host name and the DNS domain name. Unless you are using bind or NIS for host lookups you can change the FQDN and the DNS domain name (which is part of the FQDN) in the \fI/etc/hosts\fR file. See the warnings in section .B "THE FQDN" -above, and avoid using this option; use +above und use .BR "hostname \-\-all-fqdns" -instead. +instead wherever possible. .TP .I "\-F, \-\-file filename" Read the host name from the specified file. Comments (lines starting with @@ -224,9 +220,6 @@ order of the output. .I "\-s, \-\-short" Display the short host name. This is the host name cut at the first dot. .TP -.I "\-v, \-\-verbose" -Be verbose and tell what's going on. -.TP .I "\-V, \-\-version" Print version information on standard output and exit successfully. .TP diff --git a/hostname.1.fr b/hostname.1.fr deleted file mode 100644 index da31f87..0000000 --- a/hostname.1.fr +++ /dev/null @@ -1,85 +0,0 @@ -.TH HOSTNAME 1 "28 July 1994" "net-tools" "Linux Programmer's Manual" -.SH NOM -hostname \- affiche ou définit le nom d'hôte du système -.br -dnsdomainname \- affiche le nom de domaine du système -.SH SYNOPSIS -.B hostname -.RB [ \-d ] -.RB [ \-\-domain ] -.RB [ \-F\ nom_de_fichier ] -.RB [ \-\-file\ nom_de_fichier ] -.RB [ \-f ] -.RB [ \-\-fqdn ] -.RB [ \-h ] -.RB [ \-\-help ] -.RB [ \-\-long ] -.RB [ \-s ] -.RB [ \-\-short ] -.RB [ \-v ] -.RB [ \-\-version ] -.RB [ nom ] -.br -.B dnsdomainname -.SH DESCRIPTION -.B Hostname -est le programme utilisé soit pour définir le nom d'hôte, soit -pour visualiser le nom d'hôte ou de domaine du système. Ce nom est -utilisé par différents programmes réseaux pour identifier la machine. -.LP -Appelé sans argument, le programme affiche le nom courant, tel que -définit à l'aide de la commande -.B hostname. -Vous pouvez changer le format de sortie pour afficher soit la forme -courte, soit la forme longue du nom d'hôte (FQDN). Appelé avec un -argument, le programme définit la valeur du nom d'hôte à la -valeur fournie. C'est généralement fait une seule fois, au -démarrage du système, par le script de configuration -.I /etc/rc.d/rc.inet1. -.LP -Notez que seul le super-utilisateur peut changer le nom d'hôte. -.LP -Si c'est le programme -.B dnsdomainname -qui est appelé, il affichera le nom de domaine DNS. Vous ne pouvez pas -changer le nom de domaine DNS avec -.B dnsdomainname -(voir après). -.SH OPTIONS -.TP -.I "\-a, \-\-alias" -Display the alias name of the host (if used). -.TP -.I "\-d, \-\-domain" -Affiche le nom de domaine DNS. N'utilisez pas la commande -.B domainname -pour récupérer le nom de domaine DNS parce qu'elle affichera en fait -le nom de domaine NIS et non pas le non DNS. -.TP -.I "\-F, \-\-file nom_de_fichier" -Lit le nom d'hôte dans le fichier spécifié. Les commentaires -(lignes commençant avec un `#') sont ignorés. -.TP -.I "\-f, \-\-fqdn, \-\-long" -Affiche le nom complet FQDN (Fully Qualified Domain Name). Un FQDN consite -en un nom d'hôte court et un nom de domaine DNS. Sauf si vous -utilisez "bind" ou NIS pour la recherche des hôtes vous pouvez changer -le FQDN et le nom de domaine DNS (qui fait partie du FQDN) dans le fichier \fI/etc/hosts\fR. -.TP -.I "\-h, \-\-help" -Affiche un message d'utilisation sur la sortie standard et termine. -.TP -.I "\-i, \-\-ip-address" -Display the IP address(es) of the host. -.TP -.I "\-s, \-\-short" -Affiche le nom d'hôte en format court. -.TP -.I "\-v, \-\-version" -Affiche les informations sur la version sur la sortie standard et termine. -.SH FICHIERS -.B /etc/hosts -.SH AUTHOR -Peter Tobias, -.SH TRADUCTION -Jean Michel VANSTEENE (vansteen@frcl.bull.fr) diff --git a/hostname.c b/hostname.c index 5373bc8..167e918 100644 --- a/hostname.c +++ b/hostname.c @@ -45,7 +45,7 @@ #include #include -#define VERSION "3.12" +#define VERSION "3.15" enum type_t { DEFAULT, DNS, FQDN, SHORT, ALIAS, IP, NIS, NIS_DEF, ALL_FQDNS, ALL_IPS }; @@ -146,16 +146,16 @@ void usage(FILE *stream) { fprintf(stream, - "Usage: hostname [-v] [-b] {hostname|-F file} set host name (from file)\n" - " hostname [-v] [-a|-A|-d|-f|-i|-I|-s|-y] display formatted name\n" - " hostname [-v] display host name\n" + "Usage: hostname [-b] {hostname|-F file} set host name (from file)\n" + " hostname [-a|-A|-d|-f|-i|-I|-s|-y] display formatted name\n" + " hostname display host name\n" "\n" - " {yp,nis,}domainname [-v] {nisdomain|-F file} set NIS domain name (from file)\n" - " {yp,nis,}domainname [-v] display NIS domain name\n" + " {yp,nis,}domainname {nisdomain|-F file} set NIS domain name (from file)\n" + " {yp,nis,}domainname display NIS domain name\n" "\n" - " dnsdomainname [-v] display dns domain name\n" + " dnsdomainname display dns domain name\n" "\n" - " hostname -V|--version|-h|--help print info and exit\n" + " hostname -V|--version|-h|--help print info and exit\n" "\n" "Program name:\n" " {yp,nis,}domainname=hostname -y\n" @@ -447,7 +447,6 @@ main(int argc, char **argv) {"long", no_argument, 0, 'f'}, {"short", no_argument, 0, 's'}, {"version", no_argument, 0, 'V'}, - {"verbose", no_argument, 0, 'v'}, {"alias", no_argument, 0, 'a'}, {"ip-address", no_argument, 0, 'i'}, {"all-ip-addresses", no_argument, 0, 'I'}, @@ -467,7 +466,7 @@ main(int argc, char **argv) else if (!strcmp(progname, "nisdomainname")) type = NIS_DEF; - while((o = getopt_long(argc, argv, "aAdfbF:h?iIsVvy", long_options, NULL)) != -1) + while((o = getopt_long(argc, argv, "aAdfbF:h?iIsVy", long_options, NULL)) != -1) switch (o) { case 'd': type = DNS; @@ -499,9 +498,6 @@ main(int argc, char **argv) case 'F': file = optarg; break; - case 'v': - /* Does not do anything. */ - break; case 'V': printf("hostname %s\n", VERSION); return 0; -- 2.7.4