+Mon Jun 12 16:35:26 CEST 2000 Wichert Akkerman <wakkerma@debian.org>
+
+ * configure.in: generate doc/sv/Makefile as well
+ * main/filesdb.c: fix logic when reading statusoverride-file
+ * scripts/.cvsignore: add all the perl scripts
+ * scripts/dpkg-divert.pl:
+ + turn $admindir into $dpkglibdir, which the Makefile will handle
+ + fix glob->regexp logic for --list
+ * scripts/Makefile.in:
+ + replace one `sed' with `$(SED)'
+ + add dpkg-statoverride
+ * scripts/dpkg-statoverride.pl: new util to manage statoverrides
+ * debian/rules: move Swedish manpages into the package as well
+
Fri Jun 9 15:52:28 CEST 2000 Wichert Akkerman <wakkerma@debian.org>
* Merge things from the potato branch:
optlib/Makefile
doc/Makefile
doc/ja/Makefile
+doc/sv/Makefile
scripts/Makefile
main/Makefile
dselect/Makefile
set -e ; for i in ChangeLog THANKS TODO copyright ; do \
mv $(TMP)/usr/share/doc/dpkg/$$i $(TMP_DPKG)/usr/share/doc/dpkg/ ; \
done
- set -e ; for i in "" ja ; do \
+ set -e ; for i in "" ja sv ; do \
install -d -m 755 -o root -g root $(TMP_DPKG)/usr/share/man/$$i/man1 ; \
for m in md5sum.1 dpkg-deb.1 ; do \
if [ -f $(TMP)/usr/share/man/$$i/man1/$$m ] ; then \
dpkg-parsechangelog ; do \
mv $(TMP)/usr/bin/$$i $(TMP_DPKG_DEV)/usr/bin/ ; \
done
- set -e ; for i in "" ja ; do \
+ set -e ; for i in "" ja sv ; do \
install -d -m 755 -o root -g root $(TMP_DPKG_DEV)/usr/share/man/$$i/man1 ; \
for m in dpkg-name.1 dpkg-source.1 822-date.1 dpkg-architecture.1 \
dpkg-buildpackage.1 dpkg-distaddfile.1 dpkg-genchanges.1 \
* archives.c - actions that process archive files, mainly unpack
*
* Copyright (C) 1994,1995 Ian Jackson <iwj10@cus.cam.ac.uk>
+ * Copyright (C) 2000 Wichert Akkerman <wakkerma@debian.org>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* filesdb.c - management of database of files installed on system
*
* Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
+ * Copyright (C) 2000 Wichert Akkerman <wakkerma@debian.org>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
if (!file) {
if (errno != ENOENT) ohshite(_("failed to open statoverride file"));
if (!statoverridefile) { onerr_abort--; return; }
- } else if (statoverridefile) {
- if (fstat(fileno(statoverridefile),&stab1))
- ohshite(_("failed to fstat previous statoverride file"));
+ } else {
if (fstat(fileno(file),&stab2))
ohshite(_("failed to fstat statoverride file"));
- if (stab1.st_dev == stab2.st_dev && stab1.st_ino == stab2.st_ino) {
- fclose(file); onerr_abort--; return;
+ if (statoverridefile) {
+ if (fstat(fileno(statoverridefile),&stab1))
+ ohshite(_("failed to fstat previous statoverride file"));
+ if (stab1.st_dev == stab2.st_dev && stab1.st_ino == stab2.st_ino) {
+ fclose(file); onerr_abort--; return;
+ }
}
}
if (statoverridefile) fclose(statoverridefile);
push_cleanup(cu_closefile,ehflag_bombout, 0,0,1,(void*)file);
- loaded_list = nfmalloc(stab1.st_size);
- loaded_list_end = loaded_list + stab1.st_size;
+ loaded_list = nfmalloc(stab2.st_size);
+ loaded_list_end = loaded_list + stab2.st_size;
readden=0;
- while (readden<stab1.st_size) {
+ while (readden<stab2.st_size) {
bytes = read(fileno(file),
- loaded_list + readden, stab1.st_size - readden);
+ loaded_list + readden, stab2.st_size - readden);
if (bytes < 0) {
if (errno == EINTR) continue;
ohshite("unable to read statoverride file `%.250s'",vb.buf);
msgid ""
msgstr ""
"Project-Id-Version: dpkg 1.6.13\n"
-"POT-Creation-Date: 2000-06-09 16:31+0200\n"
+"POT-Creation-Date: 2000-06-12 16:12+0200\n"
"PO-Revision-Date: 2000-04-21 14:11+02:00\n"
"Last-Translator: Petr Cech <cech@debian.org>\n"
"Language-Team: Czech <cs@li.org>\n"
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-06-09 16:31+0200\n"
+"POT-Creation-Date: 2000-06-12 14:26+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-06-09 16:31+0200\n"
+"POT-Creation-Date: 2000-06-12 16:12+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid ""
msgstr ""
"Project-Id-Version: Debian dpkg 1.6.13\n"
-"POT-Creation-Date: 2000-06-09 16:31+0200\n"
+"POT-Creation-Date: 2000-06-12 16:12+0200\n"
"PO-Revision-Date: 2000-04-23 23:50+0200\n"
"Last-Translator: Santiago Vila <sanvila@debian.org>\n"
"Language-Team: Spanish <debian-l10n-spanish@lists.debian.org>\n"
msgid ""
msgstr ""
"Project-Id-Version: Debian dpkg 1.6.13\n"
-"POT-Creation-Date: 2000-06-09 16:31+0200\n"
+"POT-Creation-Date: 2000-06-12 16:12+0200\n"
"PO-Revision-Date: 2000-04-29 00:48+02:00\n"
"Last-Translator: Jérôme Marant <jerome.marant@free.fr>\n"
"Language-Team: French\n"
msgid ""
msgstr ""
"Project-Id-Version: dpkg 1.6.13\n"
-"POT-Creation-Date: 2000-06-09 16:31+0200\n"
+"POT-Creation-Date: 2000-06-12 16:12+0200\n"
"PO-Revision-Date: 2000-05-24 01:19+02:00\n"
"Last-Translator: Lele Gaifax <lele@seldati.it>\n"
"Language-Team: italian <li@li.org>\n"
msgid ""
msgstr ""
"Project-Id-Version: 1.6.7\n"
-"POT-Creation-Date: 2000-06-09 16:31+0200\n"
+"POT-Creation-Date: 2000-06-12 16:12+0200\n"
"PO-Revision-Date: 2000-03-04 14:39+09:00\n"
"Last-Translator: Keita Maehara <maehara@debian.org>\n"
"Language-Team: Debian Japanease List <debian-japanese@lists.debian.org>\n"
msgid ""
msgstr ""
"Project-Id-Version: dpkg 1.6.12\n"
-"POT-Creation-Date: 2000-06-09 16:31+0200\n"
+"POT-Creation-Date: 2000-06-12 16:12+0200\n"
"PO-Revision-Date: 2000-04-19 16:44+0100\n"
"Last-Translator: Piotr Roszatycki <dexter@debian.org>\n"
"Language-Team: Polish\n"
msgid ""
msgstr ""
"Project-Id-Version: dpkg 1.6.5\n"
-"POT-Creation-Date: 2000-06-09 16:31+0200\n"
+"POT-Creation-Date: 2000-06-12 16:12+0200\n"
"PO-Revision-Date: $Date$\n"
"Last-Translator: Michael Sobolev <mss@transas.com>\n"
"Language-Team: ru <debian-russian@lists.debian.org>\n"
msgid ""
msgstr ""
"Project-Id-Version: dpkg 1.6.12\n"
-"POT-Creation-Date: 2000-06-09 16:31+0200\n"
+"POT-Creation-Date: 2000-06-12 16:12+0200\n"
"PO-Revision-Date: 2000-05-16 20:28+0200\n"
"Last-Translator: Peter Karlsson <peter@softwolves.pp.se>\n"
"MIME-Version: 1.0\n"
Makefile.in
elisp-comp
+822-date
+cl-debian
+cleanup-info
+controllib
+dpkg-architecture
+dpkg-distaddfile
+dpkg-divert
+dpkg-genchanges
+dpkg-gencontrol
+dpkg-parsechangelog
+dpkg-scanpackages
+dpkg-scansources
+dpkg-shlibdeps
+dpkg-source
+dpkg-statoverride
+install-info
+update-alternatives
+update-rc.d
dpkg-scanpackages dpkg-scansources dpkg-architecture
SBIN_SCRIPTS = update-rc.d update-alternatives install-info \
- dpkg-divert cleanup-info
+ dpkg-divert dpkg-statoverride cleanup-info
MAN1PAGES = dpkg-name.1 dpkg-source.1 822-date.1 dpkg-architecture.1
MAN8PAGES = update-rc.d.8 update-alternatives.8 install-info.8 \
$(mkinstalldirs) $(DESTDIR)/$(parsechangelogdir)
set -e ; for i in $(CHANGELOG_PARSERS) ; do \
if test -f $$i ; then d= ; else d="$(srcdir)/" ; fi ; \
- rn=`echo $$i | sed -e 's/^cl-//'` ; \
+ rn=`echo $$i | $(SED) -e 's/^cl-//'` ; \
$(INSTALL_SCRIPT) $$d$$i $(DESTDIR)/$(parsechangelogdir)/$$rn ; \
done
$(mkinstalldirs) $(DESTDIR)/$(dpkglibdir)
# Sorry about this, but the errno-part of POSIX.pm isn't in perl-*-base
$version= '1.0.11'; # This line modified by Makefile
+$dpkglibdir= "."; # This line modified by Makefile
+
sub showversion {
print("Debian GNU/Linux dpkg-divert $version.\n") || &quit("failed to write version: $!");
}
sub usage {
&showversion;
- print(STDOUT <<END)
-Copyright (C) 1995 Ian Jackson. This is free software; see the GNU General
-Public Licence version 2 or later for copying conditions. There is NO warranty.
+ print(STDERR <<END)
+"Debian dpkg-divert $version.
+Copyright (C) 1995 Ian Jackson.
+Copyright (C) 2000 Wichert Akkerman
+
+This is free software; see the GNU General Public Licence version 2 or later
+for copying conditions. There is NO warranty.
Usage:
|| &quit("failed to write usage: $!");
}
-$admindir= '/var/lib/dpkg';
$testmode= 0;
$dorename= 0;
$verbose= 1;
$divertto =~ m/\n/ && &badusage("package may not contain newlines");
} elsif (m/^--admindir$/) {
@ARGV || &badusage("--admindir needs a directory argument");
- $admindir= shift(@ARGV);
+ $dpkglibdir= shift(@ARGV);
} else {
&badusage("unknown option \`$_'");
}
$mode='add' unless $mode;
-open(O,"$admindir/diversions") || &quit("cannot open diversions: $!");
+open(O,"$dpkglibdir/diversions") || &quit("cannot open diversions: $!");
while(<O>) {
s/\n$//; push(@contest,$_);
$_=<O>; s/\n$// || &badfmt("missing altname");
s/\\\*/.*/g;
push(@list,"^$_\$");
}
- $pat= join('$|^',@list);
+ $pat= join('|',@list);
for ($i=0; $i<=$#contest; $i++) {
next unless ($contest[$i] =~ m/$pat/o ||
$altname[$i] =~ m/$pat/o ||
sub save {
return if $testmode;
- open(N,"> $admindir/diversions-new") || &quit("create diversions-new: $!");
- chmod 0644, "$admindir/diversions-new";
+ open(N,"> $dpkglibdir/diversions-new") || &quit("create diversions-new: $!");
+ chmod 0644, "$dpkglibdir/diversions-new";
for ($i=0; $i<=$#contest; $i++) {
print(N "$contest[$i]\n$altname[$i]\n$package[$i]\n")
|| &quit("write diversions-new: $!");
}
close(N) || &quit("close diversions-new: $!");
- unlink("$admindir/diversions-old") ||
+ unlink("$dpkglibdir/diversions-old") ||
$! == &ENOENT || &quit("remove old diversions-old: $!");
- link("$admindir/diversions","$admindir/diversions-old") ||
+ link("$dpkglibdir/diversions","$dpkglibdir/diversions-old") ||
$! == &ENOENT || &quit("create new diversions-old: $!");
- rename("$admindir/diversions-new","$admindir/diversions")
+ rename("$dpkglibdir/diversions-new","$dpkglibdir/diversions")
|| &quit("install new diversions: $!");
}
sub quit { print STDERR "dpkg-divert: @_\n"; exit(2); }
sub badusage { print STDERR "dpkg-divert: @_\n\n"; print("You need --help.\n"); exit(2); }
-sub badfmt { &quit("internal error: $admindir/diversions corrupt: $_[0]"); }
+sub badfmt { &quit("internal error: $dpkglibdir/diversions corrupt: $_[0]"); }
--- /dev/null
+#! /usr/bin/perl
+
+$dpkglibdir= "/var/lib/dpkg"; # This line modified by Makefile
+$version= '1.3.0'; # This line modified by Makefile
+
+$verbose= 1;
+$force= 0;
+$doupdate= 0;
+$mode= "";
+
+sub UsageVersion {
+ print STDERR <<EOF || &quit("failed to write usage: $!");
+"Debian dpkg-statoverride $version.
+Copyright (C) 2000 Wichert Akkerman.
+
+This is free software; see the GNU General Public Licence version 2 or later
+for copying conditions. There is NO warranty.
+
+Usage:
+
+ dpkg-statoverride [options] --add <owner> <group> <mode> <file>
+ dpkg-statoverride [options] --remove <file>
+ dpkg-statoverride [options] --list [<glob-pattern>]
+
+Options:
+ --update immediately update file permissions
+ --force force an action even if a sanity check fails
+ --quiet quiet operation, minimal output
+ --help print this help screenm and exit
+ --admindir <directory> set the directory with the statoverride file
+EOF
+}
+
+sub CheckModeConflict {
+ return unless $mode;
+ &badusage("two modes specified: $_ and --$mode");
+}
+
+while (@ARGV) {
+ $_=shift(@ARGV);
+ last if m/^--$/;
+ if (!m/^-/) {
+ unshift(@ARGV,$_); last;
+ } elsif (m/^--help$/) {
+ &UsageVersion; exit(0);
+ } elsif (m/^--update$/) {
+ $doupdate=1;
+ } elsif (m/^--quiet$/) {
+ $verbose=1;
+ } elsif (m/^--force$/) {
+ $force=1;
+ } elsif (m/^--admindir$/) {
+ @ARGV || &badusage("--admindir needs a directory argument");
+ $dpkglibdir= shift(@ARGV);
+ } elsif (m/^--add$/) {
+ &CheckModeConflict;
+ $mode= 'add';
+ } elsif (m/^--remove$/) {
+ &CheckModeConflict;
+ $mode= 'remove';
+ } elsif (m/^--list$/) {
+ &CheckModeConflict;
+ $mode= 'list';
+ } else {
+ &badusage("unknown option \`$_'");
+ }
+}
+
+$dowrite=0;
+
+&badusage("no mode specified") unless $mode;
+&ReadOverrides;
+
+if ($mode eq "add") {
+ @ARGV==4 || &badusage("--add needs four arguments");
+ $user=$ARGV[0];
+ ($user =~ m/^#[0-9]*/ or (($tmp)=getpwnam($user))) || &badusage("illegal user $user");
+ $group=$ARGV[1];
+ ($group =~ m/^#[0-9]*/ or (($tmp)=getgrnam($group))) || &badusage("illegal group $group");
+ $mode= $ARGV[2];
+ (($mode<0) or ($mode>07777)) && &badusage("illegal mode $mode");
+ $file= $ARGV[3];
+ $file =~ m/\n/ && &badusage("file may not contain newlines");
+
+ if (defined $user{$file}) {
+ print STDERR "An override for \"$file\" already exists, ";
+ if ($doforce) {
+ print STDERR "but --force specified so lets ignore it.\n";
+ } else {
+ print STDERR "aborting\n";
+ exit(3);
+ }
+ }
+ $user{$file}=$user;
+ $group{$file}=$group;
+ $mode{$file}=$mode;
+ $dowrite=1;
+} elsif ($mode eq "remove") {
+ @ARGV==1 || &badusage("--remove needs four arguments");
+ $file=$ARGV[0];
+ if (not defined $user{$file}) {
+ print "No override present.";
+ exit(0);
+ }
+ delete $user{$file};
+ delete $group{$file};
+ delete $mode{$file};
+ $dowrite=1;
+} elsif ($mode eq "list") {
+ my (@list,@ilist,$pattern,$file);
+
+ @ilist= @ARGV ? @ARGV : ('*');
+ while (defined($_=shift(@ilist))) {
+ s/\W/\\$&/g;
+ s/\\\?/./g;
+ s/\\\*/.*/g;
+ push(@list,"^$_\$");
+ }
+ $pat= join('|',@list);
+ for $file (keys %owner) {
+ next unless ($file =~ m/$pat/o);
+ print "$owner{$file} $group{$file} $mode{$file} $file\n";
+ }
+}
+
+&WriteOverrides if ($dowrite);
+
+exit(0);
+
+sub ReadOverrides {
+ open(SO,"$dpkglibdir/statoverride") || &quit("cannot open statoverride: $!");
+ while (<SO>) {
+ my ($owner,$group,$mode,$file);
+ chomp;
+
+ ($owner,$group,$mode,$file)=split(' ', $_, 4);
+ die "Multiple overrides for \"$file\", aborting"
+ if defined $owner{$file};
+ $owner{$file}=$owner;
+ $group{$file}=$group;
+ $mode{$file}=$mode;
+ }
+ close(SO);
+}
+
+
+sub WriteOverrides {
+ my ($file);
+
+ open(SO,"$dpkglibdir/statoverride-new") || &quit("cannot open new statoverride file: $!");
+ foreach $file (keys %owner) {
+ print SO "$owner{$file} $group{$file} $mode{$file} $file\n";
+ }
+ close(SO);
+ chmod(0644, "$dpkglibdir/statoverride-new");
+ unlink("$dpkglibdir/statoverride-old") ||
+ $! == &ENOENT || &quit("error removing statoverride-old: $!");
+ link("$dpkglibdir/statoverride","$dpkglibdir/statoverride-old") ||
+ $! == &ENOENT || &quit("error creating new statoverride-old: $!");
+ rename("$dpkglibdir/statoverride-new","$dpkglibdir/statoverride")
+ || &quit("error installing new statoverride: $!");
+}
+
+
+sub quit { print STDERR "dpkg-statoverride: @_\n"; exit(2); }
+sub badusage { print STDERR "dpkg-statoverride: @_\n\n"; print("You need --help.\n"); exit(2); }