FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 06-27-2012, 07:33 PM
Helmut Grohne
 
Default proposed sgml-base 1.16+nmu4 fixing #676717 and #678902

Here is my next attempt to fixing #676717 and #678902.

I incorporated the parser Jakub Wilk proposed and tested it on a variety
of catalog files. See the discussion on #676717 for why update-catalog
is starting to parse catalog files.

In addition I added a Pre-Dependency on dpkg >= 1.16.4 to close #678902.
Which highlights that the fixed dpkg trigger bug #675613, #676061,
#676062, #676107, #676118, #676122 still shows up. As per policy section
7.2 I raise this Pre-Depends on -devel.

So the attached NMU is to fix all the known issues that have come up as
a result of fixing #88010. Comments welcome.

Please CC my in replies as I am not subscribed to -devel.

Helmut
diff -Nru sgml-base-1.26+nmu3/debian/changelog sgml-base-1.26+nmu4/debian/changelog
--- sgml-base-1.26+nmu3/debian/changelog 2012-05-28 21:11:52.000000000 +0200
+++ sgml-base-1.26+nmu4/debian/changelog 2012-06-27 21:04:29.000000000 +0200
@@ -1,3 +1,16 @@
+sgml-base (1.26+nmu4) unstable; urgency=low
+
+ * Non-maintainer upload.
+ * update-catalog --update-super ignores catalogs referencing non-existent
+ files. (Closes: #676717) Thanks to Jakub Wilk for contributing the parser.
+ * Remove warning about rebuilding packages as it may confuse users.
+ * Quieten update-catalog during trigger and postinst, to avoid warnings for
+ packages in "rc" state.
+ * Pre-Depend on dpkg >= 1.16.4 (Closes: #678902). Removed dependency on
+ dpkg >= 1.14.18. sgml-base highlights a bug in dpkg's trigger processing.
+
+ -- Helmut Grohne <helmut@subdivi.de> Thu, 21 Jun 2012 16:09:07 +0200
+
sgml-base (1.26+nmu3) unstable; urgency=low

* Non-maintainer upload.
diff -Nru sgml-base-1.26+nmu3/debian/control sgml-base-1.26+nmu4/debian/control
--- sgml-base-1.26+nmu3/debian/control 2012-05-28 13:58:23.000000000 +0200
+++ sgml-base-1.26+nmu4/debian/control 2012-06-27 20:38:49.000000000 +0200
@@ -11,7 +11,8 @@
Priority: optional
Architecture: all
Conflicts: sgml-data (<= 0.02), sgmltools-2 (<= 2.0.2-4)
-Depends: ${perlepends}, dpkg (>= 1.14.18)
+Depends: ${perlepends}
+Pre-Depends: dpkg (>= 1.16.4)
Suggests: sgml-base-doc
Description: SGML infrastructure and SGML catalog file support
This package creates the SGML infrastructure directories and provides
diff -Nru sgml-base-1.26+nmu3/debian/sgml-base.postinst sgml-base-1.26+nmu4/debian/sgml-base.postinst
--- sgml-base-1.26+nmu3/debian/sgml-base.postinst 2012-05-28 13:58:23.000000000 +0200
+++ sgml-base-1.26+nmu4/debian/sgml-base.postinst 2012-06-22 17:22:31.000000000 +0200
@@ -61,12 +61,12 @@
fi

## ------------------------------------------------------------------
- update-catalog --update-super
+ update-catalog --quiet --update-super
ln -sf /var/lib/sgml-base/supercatalog /etc/sgml/catalog
fi
if [ "$1" = "triggered" ]
then
- update-catalog --update-super
+ update-catalog --quiet --update-super
fi

## ----------------------------------------------------------------------
diff -Nru sgml-base-1.26+nmu3/tools/update-catalog sgml-base-1.26+nmu4/tools/update-catalog
--- sgml-base-1.26+nmu3/tools/update-catalog 2012-05-28 21:11:52.000000000 +0200
+++ sgml-base-1.26+nmu4/tools/update-catalog 2012-06-27 21:04:45.000000000 +0200
@@ -4,6 +4,7 @@
## ----------------------------------------------------------------------
## Copyright (c) 2001-2004 Ardo van Rangelrooij
## Copyright (c) 2012 Helmut Grohne
+## Copyright (c) 2012 Jakub Wilk
##
## This is free software; see the GNU General Public Licence version 2
## or later for copying conditions. There is NO warranty.
@@ -138,8 +139,6 @@
print "Invocation of dpkg-trigger failed with status $?.
";
print "Forcing update of the super catalog...
";
&update_super;
- } else {
- print "update-catalog: Please rebuild the package being set up with a version of debhelper fixing #477751.
";
}
}
elsif ( $add )
@@ -240,17 +239,71 @@
}

## ----------------------------------------------------------------------
+# Reference: https://www.oasis-open.org/specs/a401.htm
+sub check_catalog($)
+{
+ my($catalog)=shift;
+ my $base = $catalog;
+ $base =~ s,/[^/]+$,,;
+ my $catalog_tokens = qr{
+ ( (?: s+ | -- .*? --)+ # whitespace and comments
+ | ' .*? ' | " .*? " # literal
+ | S+ # other tokens
+ )
+ }sx;
+ unless(open(PKGCAT, "<", $catalog)) {
+ print "Warning: Ignoring unreadable catalog file `$catalog'.
"
+ unless $quiet;
+ return 0;
+ };
+ local $/;
+ my $contents = <PKGCAT>;
+ close PKGCAT;
+ my $prevtoken = 0;
+ while ($contents =~ m/$catalog_tokens/g) {
+ my $token = $1;
+ if ($prevtoken) {
+ next if $token =~ m/^s|^--/;
+ $token =~ s/^(['"])(.*)1$/$2/;
+ if($prevtoken eq 'base') {
+ $base = $token;
+ } elsif($prevtoken eq 'catalog') {
+ my $path;
+ if($token =~ m,^/,) {
+ $path = $token;
+ } else {
+ $path = "$base/$token";
+ }
+ if(not -f $path) {
+ print "Warning ignoring catalog `$catalog' which references non-existent catalogs. See man update-catalog for details.
"
+ unless $quiet;
+ return 0;
+ }
+ }
+ $prevtoken = 0;
+ } elsif ("L$token" eq 'catalog') {
+ $prevtoken = 'catalog';
+ } elsif ("L$token" eq 'base') {
+ $prevtoken = 'base';
+ }
+ }
+ return 1;
+}
+## ----------------------------------------------------------------------
sub update_super
{
my(@cats);
my($catdir)="/etc/sgml";
my($supercat)="/var/lib/sgml-base/supercatalog";
+ my $catfile;
opendir(CATDIR, $catdir)
or die "cannot open catalog directory $catdir: $!";
while( readdir CATDIR )
{
m/^[^.].*.cat$/ or next;
- push(@cats, $catdir . "/" . $_);
+ $catfile = $catdir . "/" . $_;
+ check_catalog($catfile) or next;
+ push(@cats, $catfile);
}
closedir(CATDIR)
or die "cannot close catalog directory $catdir: $!";
diff -Nru sgml-base-1.26+nmu3/tools/update-catalog.8 sgml-base-1.26+nmu4/tools/update-catalog.8
--- sgml-base-1.26+nmu3/tools/update-catalog.8 2012-05-28 13:58:23.000000000 +0200
+++ sgml-base-1.26+nmu4/tools/update-catalog.8 2012-06-27 21:07:21.000000000 +0200
@@ -45,6 +45,9 @@
extension or remove (or move) existing centralized catalogs and regenerate the super catalog using the
.B --update-super
option.
+See section
+.B SUPER CATALOG
+for details on the generation process.
."
." ----------------------------------------------------------------------
.SH OPTIONS
@@ -64,10 +67,10 @@
.B --update-super
Regenerates the SGML super catalog from the contents of the
.IR /etc/sgml
-directory including all files having a
-.B .cat
-extension.
-Files ending in .disabled or .old for instance are not considered.
+directory.
+See section
+.B SUPER CATALOG
+for details on the super catalog generation.
.TP
.B --quiet
Prevents the usual diagnostic output.
@@ -83,6 +86,26 @@
Display the usage information and exits.
."
." ----------------------------------------------------------------------
+.SH SUPER CATALOG
+The super-catalog located in
+.IR /etc/sgml/catalog
+cannot be directly modified.
+It is generated by the
+.IR update-catalog
+.IR --update-super
+command.
+The generation considers files in the
+.IR /etc/sgml
+directory that have a
+.B .cat
+extension.
+For instance files ending in .old or .disabled are not considered.
+Before adding a catalog to the super catalog it is parsed and verified in order to not corrupt the super catalog.
+All referenced catalogs are verified to actually exist.
+If the check fails, a message is printed and the complete catalog is ignored.
+This check ensures that a catalog from a package, which is removed but not purged, is removed from the super catalog.
+."
+." ----------------------------------------------------------------------
.SH AUTHOR
Ardo van Rangelrooij <ardo@debian.org>
."
 
Old 06-28-2012, 01:05 AM
Ian Jackson
 
Default proposed sgml-base 1.16+nmu4 fixing #676717 and #678902

Helmut Grohne writes ("proposed sgml-base 1.16+nmu4 fixing #676717 and #678902"):
> Here is my next attempt to fixing #676717 and #678902.
>
> I incorporated the parser Jakub Wilk proposed and tested it on a variety
> of catalog files. See the discussion on #676717 for why update-catalog
> is starting to parse catalog files.
>
> In addition I added a Pre-Dependency on dpkg >= 1.16.4 to close #678902.
> Which highlights that the fixed dpkg trigger bug #675613, #676061,
> #676062, #676107, #676118, #676122 still shows up. As per policy section
> 7.2 I raise this Pre-Depends on -devel.
>
> So the attached NMU is to fix all the known issues that have come up as
> a result of fixing #88010. Comments welcome.

I'm not convinced that a Pre-Depends is the best answer here. I think
a better answer would be for the new dpkg to activate all file
triggers when it first starts, and for sgml-base to simply use
Depends.

Ian.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20459.44532.500373.64776@chiark.greenend.org.uk">h ttp://lists.debian.org/20459.44532.500373.64776@chiark.greenend.org.uk
 
Old 06-28-2012, 07:38 AM
Helmut Grohne
 
Default proposed sgml-base 1.16+nmu4 fixing #676717 and #678902

Dear dpkg maintainers,

On Thu, Jun 28, 2012 at 02:05:56AM +0100, Ian Jackson wrote:
> I'm not convinced that a Pre-Depends is the best answer here. I think
> a better answer would be for the new dpkg to activate all file
> triggers when it first starts, and for sgml-base to simply use
> Depends.

Will you be able to provide a version of dpkg that invokes all triggers
in /etc when being upgraded from << 1.16.4 in time for wheezy?

See #678902 for why this is useful.

Helmut


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120628073824.GA10219@alf.mars">http://lists.debian.org/20120628073824.GA10219@alf.mars
 
Old 06-28-2012, 07:38 AM
Helmut Grohne
 
Default proposed sgml-base 1.16+nmu4 fixing #676717 and #678902

Dear dpkg maintainers,

On Thu, Jun 28, 2012 at 02:05:56AM +0100, Ian Jackson wrote:
> I'm not convinced that a Pre-Depends is the best answer here. I think
> a better answer would be for the new dpkg to activate all file
> triggers when it first starts, and for sgml-base to simply use
> Depends.

Will you be able to provide a version of dpkg that invokes all triggers
in /etc when being upgraded from << 1.16.4 in time for wheezy?

See #678902 for why this is useful.

Helmut


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120628073824.GA10219@alf.mars">http://lists.debian.org/20120628073824.GA10219@alf.mars
 

Thread Tools




All times are GMT. The time now is 09:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org