[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#685354: unblock: sendfile/2.1b.20080616-5.1



retitle 685354 unblock: sendfile/2.1b.20080616-5.2
thanks

Hi,

On Fri, Aug 24, 2012 at 05:47:05PM +0100, Adam D. Barratt wrote:
> Hmmmm, okay.  With the changelog update for the new dependencies, please
> go ahead.

Andreas uploaded sendfile 2.1b.20080616-5.2. The debdiff against wheezy is
attached.

Thanks for the review and the upload.


Cheers,

Ivo

diff -u sendfile-2.1b.20080616/debian/control sendfile-2.1b.20080616/debian/control
--- sendfile-2.1b.20080616/debian/control
+++ sendfile-2.1b.20080616/debian/control
@@ -9,7 +9,7 @@
 Section: net
 Priority: optional
 Architecture: any
-Depends: ${shlibs:Depends}, openbsd-inetd | inet-superserver, perl | perl5
+Depends: ${shlibs:Depends}, openbsd-inetd | inet-superserver, perl | perl5, update-inetd, libdpkg-perl
 Suggests: pgp-i
 Description: Simple Asynchronous File Transfer
  Sendfile is an asynchronous file transfer service for the Internet,
diff -u sendfile-2.1b.20080616/debian/postinst sendfile-2.1b.20080616/debian/postinst
--- sendfile-2.1b.20080616/debian/postinst
+++ sendfile-2.1b.20080616/debian/postinst
@@ -2,20 +2,7 @@
 # post install script for the Debian GNU/Linux sendfile package
 
 require DebianNet;
-
-# First modify the services file
-
-open(SERVICES, "/etc/services");
-    @services=<SERVICES>;
-close(SERVICES);
-
-if (! grep(/^saft.*/, @services)) {
-   push (@services, "saft		487/tcp			# simple asynchronous file transfer\n");
-   open(SERVICES, ">/etc/services.new");
-   print SERVICES @services;
-   close (SERVICES);
-   system ("mv -f /etc/services.new /etc/services");
-}
+use Dpkg::Version;
 
 # Now modify the inetd.conf file
 
@@ -29,30 +16,38 @@
 }
 undef(@inetd);
 
-for $profile (('/etc/profile')) {
-    open(PROFILE, "$profile");
-    @profile=<PROFILE>;
-    close(PROFILE);
-
-    open(PROFILE, ">$profile");
-    printf PROFILE "%s", join ('', grep (!/^.*check-sendfile/, @profile));
-    close (PROFILE);
+# cleanup edits from versions before 2.1b.20080616-5.2
+# this can be removed after wheezy
+if (($ARGV[1] ne "") &&
+	(version_compare($ARGV[1],"2.1b.20080616-5.2") < 0)) {
+	
+	# remove line added by old version of sendfile
+	my $profile = '/etc/profile';
+	if (-e $profile) {
+		open(PROFILE, "$profile");
+		@profile=<PROFILE>;
+		close(PROFILE);
+
+		open(PROFILE, ">$profile");
+		printf PROFILE "%s", join ('', grep (!/^.*check-sendfile/, @profile));
+		close (PROFILE);
+	}
+
+	# delete /etc/services with only 1 line created by previous versions of
+	# sendfile
+	my $services = "/etc/services";
+	if (-e $services) {
+		open(SERVICES, $services);
+		my @srv = <SERVICES>;
+		close(SERVICES);
+		my $srv = join('',@srv);
+		my $oldsrv = "saft		487/tcp			# simple asynchronous file transfer\n";
+		if ($srv eq $oldsrv) {
+			unlink $services;
+		}
+	}
 }
 
-for $profile (('/etc/csh.login')) {
-    open(PROFILE, "$profile");
-    @profile=<PROFILE>;
-    close(PROFILE);
-
-    if (grep(/^.*check-sendfile/, @profile)) {
-	open(PROFILE, ">$profile");
-	printf PROFILE "%s", join ('', grep (!/^.*check-sendfile/, @profile));
-	close(PROFILE);
-    }
-}
-
-system "/etc/init.d/netbase reload";
-
 if ($ARGV[0] eq 'configure') {
     if (defined $ARGV[1] && $ARGV[1] =~ /2\.1b(-[67]|\.20080311-|\.20080616-1)/) {
 	system "chmod 644 /etc/logrotate.d/sendfile";
diff -u sendfile-2.1b.20080616/debian/postrm sendfile-2.1b.20080616/debian/postrm
--- sendfile-2.1b.20080616/debian/postrm
+++ sendfile-2.1b.20080616/debian/postrm
@@ -3,15 +3,6 @@
 
 set -e
 
-if [ "$1" = "remove" ]
-then
-    for profile in /etc/profile /etc/csh.login
-    do
-	grep -v 'check-sendfile' $profile > $profile.new || true
-	mv -f $profile.new $profile
-    done
-fi
-
 if [ "$1" = "purge" ]
 then
   rm -rf /var/log/sendfile >/dev/null
diff -u sendfile-2.1b.20080616/debian/changelog sendfile-2.1b.20080616/debian/changelog
--- sendfile-2.1b.20080616/debian/changelog
+++ sendfile-2.1b.20080616/debian/changelog
@@ -1,3 +1,24 @@
+sendfile (2.1b.20080616-5.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Don't edit /etc/services, /etc/profile and /etc/csh.login
+  * Cleanup edits to those files from previous versions
+    Closes: #685631
+  * Depend on update-inetd because the postinst script requires the perl
+    module DebianNet
+  * Depend on libdpkg-perl for version checks in postinst script
+
+ -- Ivo De Decker <ivo.dedecker@ugent.be>  Sat, 25 Aug 2012 11:03:41 +0200
+
+sendfile (2.1b.20080616-5.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Remove all files on purge.  Thanks for the patch to
+    Andreas Beckmann <debian@abeckmann.de>
+    Closes: #668721
+
+ -- Andreas Tille <tille@debian.org>  Thu, 09 Aug 2012 15:03:55 +0200
+
 sendfile (2.1b.20080616-5) unstable; urgency=low
 
   * Add new config file /etc/profile.d/sendfile and remove old line from

Reply to: