Bug#572108: modifying files from another package

2010-04-14 Thread Hideki Yamane
Hi,

On Mon, 1 Mar 2010 22:54:39 +0100
Gerfried Fuchs rho...@deb.at wrote:
  Please try though to settle for ther former suggestion of coordinating
 updates through volatile, and use the dpkg-divert approach only as last
 ressort. Also, what are your suggestions to fix the issue in stable?

 Yes, dpkg-divert is smart way. I've tried to fix this with attached patch.
 Could you check it, please?


-- 
Regards,

 Hideki Yamane henrich @ debian.or.jp/iijmio-mail.jp
 http://wiki.debian.org/HidekiYamane
diff -Nru tz-brasil-0.10/debian/changelog tz-brasil-0.10+nmu1/debian/changelog
--- tz-brasil-0.10/debian/changelog	2008-04-23 20:57:09.0 +0900
+++ tz-brasil-0.10+nmu1/debian/changelog	2010-04-14 20:58:45.0 +0900
@@ -1,3 +1,21 @@
+tz-brasil (0.10+nmu1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/preinst,postrm
+use dpkg-divert to avoid modifying files from another package 
+(Closes: #572108) 
+  * use dpkg-source v3.0 format
+  * debian/control
+- Bump up Standards-Version: 3.8.4
+- set Build-Depends: debhelper (= 5.0.0)
+- add Depends: {misc:Depends}
+- set Depends: bsd-mailx from mailx
+  * set debian/compat to 5
+  * debian/postinst
+- fix command-with-path-in-maintainer-script
+
+ -- Hideki Yamane (Debian-JP) henr...@debian.or.jp  Wed, 14 Apr 2010 20:58:29 +0900
+
 tz-brasil (0.10) unstable; urgency=low
 
   * removed +x permissions from conf-file in postinst. thanks to Nelson A
diff -Nru tz-brasil-0.10/debian/compat tz-brasil-0.10+nmu1/debian/compat
--- tz-brasil-0.10/debian/compat	2008-04-21 08:21:40.0 +0900
+++ tz-brasil-0.10+nmu1/debian/compat	2010-04-14 20:53:28.0 +0900
@@ -1 +1 @@
-4
+5
diff -Nru tz-brasil-0.10/debian/control tz-brasil-0.10+nmu1/debian/control
--- tz-brasil-0.10/debian/control	2008-04-21 08:22:25.0 +0900
+++ tz-brasil-0.10+nmu1/debian/control	2010-04-14 20:57:06.0 +0900
@@ -2,12 +2,12 @@
 Section: admin
 Priority: optional
 Maintainer: Pedro Zorzenon Neto p...@debian.org
-Build-Depends: debhelper ( 3.0.0)
-Standards-Version: 3.7.3
+Build-Depends: debhelper (= 5.0.0)
+Standards-Version: 3.8.4
 
 Package: tz-brasil
 Architecture: all
-Depends: wget, fping, mailx
+Depends: wget, fping, bsd-mailx, ${misc:Depends}
 Recommends: cron
 Description: timezone autoconfiguration for Brazil
  This package is intended for use in Brazil only. It automatically
diff -Nru tz-brasil-0.10/debian/postinst tz-brasil-0.10+nmu1/debian/postinst
--- tz-brasil-0.10/debian/postinst	2008-04-23 21:01:03.0 +0900
+++ tz-brasil-0.10+nmu1/debian/postinst	2010-04-14 20:54:55.0 +0900
@@ -54,7 +54,7 @@
 	set -e
 	if [ $R = 0 ]; then
 	echo ok. updating tz-brasil database
-	/usr/sbin/tz-brasil || true
+	tz-brasil || true
 	else
 	echo internet is not available.
 	echo  * will update tz-brasil database later, when you are online
@@ -67,7 +67,7 @@
 	echo 
 	
 	echo Running tz-brasil-restart...
-	/usr/sbin/tz-brasil-restart
+	tz-brasil-restart
 	;;
 
 abort-upgrade|abort-remove|abort-deconfigure)
diff -Nru tz-brasil-0.10/debian/postrm tz-brasil-0.10+nmu1/debian/postrm
--- tz-brasil-0.10/debian/postrm	1970-01-01 09:00:00.0 +0900
+++ tz-brasil-0.10+nmu1/debian/postrm	2010-04-14 21:31:12.0 +0900
@@ -0,0 +1,69 @@
+#!/bin/sh
+# postrm script for tz-brazil
+#
+# see: dh_installdeb(1)
+
+set -e
+
+PKGNAME=tz-brazil
+CITYLIST=\
+  /usr/share/zoneinfo/America/Araguaina\
+  /usr/share/zoneinfo/America/Bahia\
+  /usr/share/zoneinfo/America/Belem\
+  /usr/share/zoneinfo/America/Boa_Vista\
+  /usr/share/zoneinfo/America/Campo_Grande \
+  /usr/share/zoneinfo/America/Cuiaba   \
+  /usr/share/zoneinfo/America/Eirunepe \
+  /usr/share/zoneinfo/America/Fortaleza\
+  /usr/share/zoneinfo/America/Maceio   \
+  /usr/share/zoneinfo/America/Manaus   \
+  /usr/share/zoneinfo/America/Noronha  \
+  /usr/share/zoneinfo/America/Porto_Acre   \
+  /usr/share/zoneinfo/America/Porto_Velho  \
+  /usr/share/zoneinfo/America/Recife   \
+  /usr/share/zoneinfo/America/Rio_Branco   \
+  /usr/share/zoneinfo/America/Santarem \
+  /usr/share/zoneinfo/America/Sao_Paulo\
+  /usr/share/zoneinfo/Brazil/Acre  \
+  /usr/share/zoneinfo/Brazil/DeNoronha \
+  /usr/share/zoneinfo/Brazil/East  \
+  /usr/share/zoneinfo/Brazil/West 
+
+# summary of how this script can be called:
+#* postrm `remove'
+#* postrm `purge'
+#* old-postrm `upgrade' new-version
+#* new-postrm `failed-upgrade' old-version
+#* new-postrm `abort-install'
+#* new-postrm `abort-install' old-version
+#* new-postrm `abort-upgrade' old-version
+#* disappearer's-postrm `disappear' overwriter
+#  overwriter-version
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case $1 in
+purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+

Bug#572108: modifying files from another package

2010-04-14 Thread Gerfried Fuchs
Hi!

* Hideki Yamane henr...@debian.or.jp [2010-04-14 14:56:15 CEST]:
 On Mon, 1 Mar 2010 22:54:39 +0100
 Gerfried Fuchs rho...@deb.at wrote:
   Please try though to settle for ther former suggestion of coordinating
  updates through volatile, and use the dpkg-divert approach only as last
  ressort. Also, what are your suggestions to fix the issue in stable?
 
  Yes, dpkg-divert is smart way. I've tried to fix this with attached patch.
  Could you check it, please?

 I'm still not convinced that this is the best option, my use the
dpkg-divert approach only as last ressort statement still stands.

 Said that, I would rather do in the postrm something like:

#v+
for CITY in $(dpkg-divert --list | grep ' by tz-brasil$' | awk '{print $3}'); 
do 
  dpkg-divert --package tz-brasil --rename --remove $CITY
done
#v-

 That way you won't have any files left and no need to duplicate the
citylist in both maintainer scripts in case it would need to get
changed. It has though one small issue: Won't work with spaces in
filenames - but I doubt that those happen in tzdata (yeah, I know it -
famous last words and such).

 Also, curious, why move the set -e to after defining the variables? :)
And I personally don't consider it good style to convert a package's
source format in an NMU - please try to avoid such things.

 Thanks,
Rhonda



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#572108: modifying files from another package

2010-03-01 Thread Holger Levsen
Package: tz-brasil
Version: 0.10
Severity: serious
User: debian...@lists.debian.org
Usertags: piuparts piuparts.d.o

Hi, 

during a test with piuparts I noticed your package modifies files from another 
package in /usr. This is so wrong, I'm not even bothered to look up the part 
of policy this violates ;-P

From the attached log (scroll to the bottom...):

0m14.0s ERROR: FAIL: After purging files have been modified:
  /usr/share/zoneinfo/America/Araguaina  owned by: tzdata
  /usr/share/zoneinfo/America/Bahia  owned by: tzdata
  /usr/share/zoneinfo/America/Belem  owned by: tzdata
  /usr/share/zoneinfo/America/Boa_Vista  owned by: tzdata
  /usr/share/zoneinfo/America/Campo_Grande   owned by: tzdata
  /usr/share/zoneinfo/America/Cuiaba owned by: tzdata
  /usr/share/zoneinfo/America/Eirunepe   owned by: tzdata
  /usr/share/zoneinfo/America/Fortaleza  owned by: tzdata
  /usr/share/zoneinfo/America/Maceio owned by: tzdata
  /usr/share/zoneinfo/America/Manaus owned by: tzdata
  /usr/share/zoneinfo/America/Noronhaowned by: tzdata
  /usr/share/zoneinfo/America/Porto_Acre owned by: tzdata
  /usr/share/zoneinfo/America/Porto_Velhoowned by: tzdata
  /usr/share/zoneinfo/America/Recife owned by: tzdata
  /usr/share/zoneinfo/America/Rio_Branco owned by: tzdata
  /usr/share/zoneinfo/America/Santarem   owned by: tzdata
  /usr/share/zoneinfo/America/Sao_Paulo  owned by: tzdata
  /usr/share/zoneinfo/Brazil/Acreowned by: tzdata
  /usr/share/zoneinfo/Brazil/DeNoronha   owned by: tzdata
  /usr/share/zoneinfo/Brazil/Eastowned by: tzdata
  /usr/share/zoneinfo/Brazil/Westowned by: tzdata

I think you should conflict with and replace tzdata (as in package 
relationships).


regards,
Holger
Start: 2010-02-25 13:39:50 UTC

Package: tz-brasil
Priority: optional
Section: admin
Installed-Size: 164
Maintainer: Pedro Zorzenon Neto p...@debian.org
Architecture: all
Version: 0.10
Depends: fping, mailx, wget
Recommends: cron
Filename: pool/main/t/tz-brasil/tz-brasil_0.10_all.deb
Size: 18310
MD5sum: c3298521ae53b1b3224f965ffe8ce149
SHA1: dab8c7906570f735ef9ba53a48fb8aff6f77f9d6
SHA256: 969ffb60859c937b326b75afed9a44cec6d208baf5cd1cea39a25c7f23ac3de3
Description: timezone autoconfiguration for Brazil
 This package is intended for use in Brazil only. It automatically
 configures the clock according to Brazilian rules. You can
 adapt this package to work in your country too, if you also
 have problems with clock offsets and daylight saving clock offsets.
 .
 This package tries to fetch a timezone file periodically from a
 server that is supposed to have it updated as soon as the day that
 the timezone will be changed is known.
Tag: admin::configuring, culture::brazilian, interface::commandline, role::program, scope::utility, use::configuring, use::timekeeping

Executing: sudo /org/piuparts.debian.org/sbin/piuparts --warn-symlinks --warn-on-others --warn-on-leftovers-after-purge --scriptsdir /etc/piuparts/scripts/ --tmpdir /org/piuparts.debian.org/tmp -ad squeeze -b squeeze.tar.gz --mirror http://piatti.debian.org/debian/ tz-brasil
Guessed: debian
0m0.0s INFO: --
0m0.0s INFO: To quickly glance what went wrong, scroll down to the bottom of this logfile.
0m0.0s INFO: FAQ available at http://wiki.debian.org/piuparts/FAQ
0m0.0s INFO: --
0m0.0s INFO: piuparts version 0.39~201002251129 starting up.
0m0.0s INFO: Command line arguments: /org/piuparts.debian.org/sbin/piuparts --warn-symlinks --warn-on-others --warn-on-leftovers-after-purge --scriptsdir /etc/piuparts/scripts/ --tmpdir /org/piuparts.debian.org/tmp -ad squeeze -b squeeze.tar.gz --mirror http://piatti.debian.org/debian/ tz-brasil
0m0.0s INFO: Running on: Linux piatti 2.6.32.9-dsa-amd64 #1 SMP Tue Feb 23 18:40:58 CET 2010 x86_64
0m0.0s DEBUG: Created temporary directory /org/piuparts.debian.org/tmp/tmpIAdcpX
0m0.0s DEBUG: Unpacking squeeze.tar.gz into /org/piuparts.debian.org/tmp/tmpIAdcpX
0m0.0s DEBUG: Starting command: ['tar', '-C', '/org/piuparts.debian.org/tmp/tmpIAdcpX', '-zxf', 'squeeze.tar.gz']
0m2.9s DEBUG: Command ok: ['tar', '-C', '/org/piuparts.debian.org/tmp/tmpIAdcpX', '-zxf', 'squeeze.tar.gz']
0m2.9s DEBUG: Created policy-rc.d and chmodded it.
0m2.9s DEBUG: Starting command: ['chroot', '/org/piuparts.debian.org/tmp/tmpIAdcpX', 'apt-get', 'update']
0m4.7s DUMP: 
  Get:1 http://piatti.debian.org squeeze Release.gpg [835B]
  Get:2 http://piatti.debian.org squeeze Release [89.5kB]
  Ign http://piatti.debian.org squeeze/main Packages/DiffIndex
  Ign http://piatti.debian.org squeeze/contrib Packages/DiffIndex
  Ign http://piatti.debian.org squeeze/non-free Packages/DiffIndex
  Ign http://piatti.debian.org squeeze/main Packages
  Ign http://piatti.debian.org squeeze/contrib Packages
  Ign http://piatti.debian.org squeeze/non-free Packages
  Get:3 

Bug#572108: modifying files from another package

2010-03-01 Thread Pedro Zorzenon Neto
Hello Holger,

  I don't know how to handle this. Do you have any suggestion? This is
what occours:

  Brazil is very unstable regarging daylight-saving-time (DST) start
date and end date. Up to 2009 [1], the dates of changing clock were
reported by government sometimes around 10 days before when it begins.

  In Debian stable, tzdata package handle timezone informations, and
since a change in brazilian date of starting the DST is not a security
issue, that can not be generated another package for debian stable, and
brazilian users will have a misconfigured clock.

  So I did tz-brasil package, that tries to fetch periodically the
timezone information from a server [2], and then runs the command zic
the timezone compiler. The compiler then modifies the files that you saw.

  Which whould be a good alternative for handling timezones in countries
that are not well-organized and we have no information, except a few
days before the change will occour?

  Also, in Brazil, we have some states that change DST, and others that
do not have DST. Some years, a state decided to change to DST after
others... That is why I take care of all the brazilian zones in my
tzfile [2] and did this package.

  If this could be considered a good reason for upgrading a new tzdata
package to stable, we can remove tz-brasil package from debian. So
Brazilian admins would only have to remember to apt-get update/upgrade
periodically.

  I have a non-uploaded version of tz-brasil, which I also check which
processes has a start-timestamp older than the timestamp of file
/etc/localtime. If they are older, then cron sends a warn to root, to
restart that process, or it won't know about the new timezone rules.

  Do you have any opinion?

[1] in 2010 the government changed the rules for DST. Now it is supposed
to be known in advance, but the rule has a relation with carnival date,
and carnival data may change...

[2] http://people.debian.org/~pzn/tz.zic

Em 01-03-2010 12:53, Holger Levsen escreveu:
 Package: tz-brasil
 Version: 0.10
 Severity: serious
 User: debian...@lists.debian.org
 Usertags: piuparts piuparts.d.o
 
 Hi, 
 
 during a test with piuparts I noticed your package modifies files from 
 another 
 package in /usr. This is so wrong, I'm not even bothered to look up the part 
 of policy this violates ;-P
 
 From the attached log (scroll to the bottom...):
 
 0m14.0s ERROR: FAIL: After purging files have been modified:
   /usr/share/zoneinfo/America/Araguainaowned by: tzdata
   /usr/share/zoneinfo/America/Bahiaowned by: tzdata
   /usr/share/zoneinfo/America/Belemowned by: tzdata
   /usr/share/zoneinfo/America/Boa_Vistaowned by: tzdata
   /usr/share/zoneinfo/America/Campo_Grande owned by: tzdata
   /usr/share/zoneinfo/America/Cuiaba   owned by: tzdata
   /usr/share/zoneinfo/America/Eirunepe owned by: tzdata
   /usr/share/zoneinfo/America/Fortalezaowned by: tzdata
   /usr/share/zoneinfo/America/Maceio   owned by: tzdata
   /usr/share/zoneinfo/America/Manaus   owned by: tzdata
   /usr/share/zoneinfo/America/Noronha  owned by: tzdata
   /usr/share/zoneinfo/America/Porto_Acre   owned by: tzdata
   /usr/share/zoneinfo/America/Porto_Velho  owned by: tzdata
   /usr/share/zoneinfo/America/Recife   owned by: tzdata
   /usr/share/zoneinfo/America/Rio_Branco   owned by: tzdata
   /usr/share/zoneinfo/America/Santarem owned by: tzdata
   /usr/share/zoneinfo/America/Sao_Pauloowned by: tzdata
   /usr/share/zoneinfo/Brazil/Acre  owned by: tzdata
   /usr/share/zoneinfo/Brazil/DeNoronha owned by: tzdata
   /usr/share/zoneinfo/Brazil/East  owned by: tzdata
   /usr/share/zoneinfo/Brazil/West  owned by: tzdata
 
 I think you should conflict with and replace tzdata (as in package 
 relationships).
 
 
 regards,
   Holger



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#572108: modifying files from another package

2010-03-01 Thread Holger Levsen
Hi Pedro,

On Montag, 1. März 2010, Pedro Zorzenon Neto wrote:
   I don't know how to handle this. Do you have any suggestion? This is
 what occours:

   Brazil is very unstable regarging daylight-saving-time (DST) start
 date and end date. Up to 2009 [1], the dates of changing clock were
 reported by government sometimes around 10 days before when it begins.

I'm (and was) aware of that... :)

 Em 01-03-2010 12:53, Holger Levsen escreveu:
  I think you should conflict with and replace tzdata (as in package
  relationships).

^^ that is my suggestion. Add a Conflicts: tz-data header, a Provides: 
tz-data header and a Replaces: tz-data header. You can probably leave one 
out, but I always forget which. Consult policy :-)


cheers,
Holger

P.S.: As this package could be useful outside of Brazil, maybe rename it to 
tz-client (or such) as well?


signature.asc
Description: This is a digitally signed message part.


Bug#572108: modifying files from another package

2010-03-01 Thread Pedro Zorzenon Neto
Em 01-03-2010 14:18, Holger Levsen escreveu:
 I think you should conflict with and replace tzdata (as in package
 relationships).
 
 ^^ that is my suggestion. Add a Conflicts: tz-data header, a Provides: 
 tz-data header and a Replaces: tz-data header. You can probably leave one 
 out, but I always forget which. Consult policy :-)

To conflict with tzdata, I should handle all country timezones, because
it tzdata is uninstalled, the system won't have references to other
timezones.

Imagine a server where users set different customization of timezone.

I see no simple solution now... but I'll think about and there will be a
simpler solution.




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#572108: modifying files from another package

2010-03-01 Thread Holger Levsen
Hi Pedro,

On Montag, 1. März 2010, Pedro Zorzenon Neto wrote:
 To conflict with tzdata, I should handle all country timezones, because
 it tzdata is uninstalled, the system won't have references to other
 timezones.

Yes, that would be better. I thought it would handle all timezones...

 Imagine a server where users set different customization of timezone.
 I see no simple solution now... but I'll think about and there will be a
 simpler solution.

Great, thanks already.


cheers,
Holger



signature.asc
Description: This is a digitally signed message part.


Bug#572108: modifying files from another package

2010-03-01 Thread Gerfried Fuchs
Hi!

* Holger Levsen hol...@layer-acht.org [2010-03-01 18:18:24 CET]:
 On Montag, 1. März 2010, Pedro Zorzenon Neto wrote:
  Em 01-03-2010 12:53, Holger Levsen escreveu:
   I think you should conflict with and replace tzdata (as in package
   relationships).
 
 ^^ that is my suggestion. Add a Conflicts: tz-data header, a Provides: 
 tz-data header and a Replaces: tz-data header. You can probably leave one 
 out, but I always forget which. Consult policy :-)

 This is the wrong approach. conflicts  replaces is only for moving
files from one package to another. Given that tzdata (without the dash)
won't drop the file this will cause serious troubles on next upgrade of
tzdata.

 Two suggestions: tzdata is offered through volatile because of exactly
this issues. Have you tried to check with the tzdata maintainers to get
your data into there? IMHO that would be the cleanest solution.

 Another way, if you really believe that you want to do it on the
outside would be to use dpkg-divert, move the files from tzdata that you
want to replace aside and get your versions of those files into place.
Please make sure that after removing your package the original files of
tzdata get moved back  again.

 Please try though to settle for ther former suggestion of coordinating
updates through volatile, and use the dpkg-divert approach only as last
ressort. Also, what are your suggestions to fix the issue in stable?

 Have fun!
Rhonda



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org