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 Kernel

 
 
LinkBack Thread Tools
 
Old 11-09-2009, 08:31 PM
Sebastian Andrzej Siewior
 
Default postinst: get rid of reverse symlinks handling

maximilian suggested to grab an axe and rip the reverse symlinks handling out.
The man page for kernel-img.conf has no reference to it anymore.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
---
debian/rules.real | 1 -
debian/templates/temp.image.plain/postinst | 60 +--------------------------
debian/templates/temp.image.plain/postrm | 3 -
debian/templates/temp.image.plain/preinst | 3 -
debian/templates/temp.image.plain/prerm | 3 -
5 files changed, 3 insertions(+), 67 deletions(-)

diff --git a/debian/rules.real b/debian/rules.real
index 66bc700..056efee 100644
--- a/debian/rules.real
+++ b/debian/rules.real
@@ -396,7 +396,6 @@ install-image_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_plain_templ ates:
-e 's/=V/$(REAL_VERSION)/g'
-e 's/=M//g'
-e 's/=MD//g'
- -e 's/=R//g'
-e 's/=S//g'
$$i > $(PACKAGE_DIR)/DEBIAN/$$(basename $$i);
done
diff --git a/debian/templates/temp.image.plain/postinst b/debian/templates/temp.image.plain/postinst
index 2ac4a0b..1ae393a 100755
--- a/debian/templates/temp.image.plain/postinst
+++ b/debian/templates/temp.image.plain/postinst
@@ -29,7 +29,6 @@ $|=1;
my $version = "=V";
my $link_in_boot = "=IB"; # Should be empty, mostly
my $no_symlink = "=S"; # Should be empty, mostly
-my $reverse_symlink = "=R"; # Should be empty, mostly
my $do_symlink = "Yes"; # target machine defined
my $do_boot_enable = "Yes"; # target machine defined
my $do_bootloader = "Yes"; # target machine defined
@@ -103,7 +102,6 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC" ) {

$do_symlink = "" if /do_symlinkss*=s*(no|false|0)s*$/ig;
$no_symlink = "" if /no_symlinkss*=s*(no|false|0)s*$/ig;
- $reverse_symlink = "" if /reverse_symlinks*=s*(no|false|0)s*$/ig;
$link_in_boot = "" if /link_in_boots*=s*(no|false|0)s*$/ig;
$do_boot_enable = ' if /do_boot_enables*=s*(no|false|0)s*$/ig;
$relative_links = ' if /relative_links s*=s*(no|false|0)s*$/ig;
@@ -118,7 +116,6 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC" ) {

$do_symlink = "Yes" if /do_symlinkss*=s*(yes|true|1)s*$/ig;
$no_symlink = "Yes" if /no_symlinkss*=s*(yes|true|1)s*$/ig;
- $reverse_symlink = "Yes" if /reverse_symlinkss*=s*(yes|true|1)s*$/ig;
$link_in_boot = "Yes" if /link_in_boots*=s*(yes|true|1)s*$/ig;
$do_boot_enable = "Yes" if /do_boot_enables*=s*(yes|true|1)s*$/ig;
$do_bootloader = "Yes" if /do_bootloaders*=s*(yes|true|1)s*$/ig;
@@ -342,12 +339,10 @@ sub move_p {
warn "Move?: kimage=$kimage, image_dest=$image_dest,
" .
" image_name=$image_name, src_dir=$src_dir" if $DEBUG;

- if ($no_symlink || $reverse_symlink) {
+ if ($no_symlink) {
# we do not want links, yet we have a symbolic link here!
warn "found a symbolic link in " . $image_dest . "$kimage
" .
"even though no_symlink is defined
" if $no_symlink;
- warn "found a symbolic link in " . $image_dest . "$kimage
" .
- "even though reverse_symlink is defined
" if $reverse_symlink;
# make sure we change this state of affairs
$force_move = 1;
return $force_move;
@@ -503,14 +498,6 @@ sub handle_missing_link {
. $image_dest . "$kimage .
");
}
}
- elsif ($reverse_symlink) {
- my $ret = system("mv -f " . $realimageloc . "$image_name "
- . "$kimage");
- if ($ret) {
- die("Failed to move " . $realimageloc . "$image_name to "
- . $image_dest . "$kimage .
");
- }
- }
else {
if (! $have_conffile) {
my $ret;
@@ -538,12 +525,6 @@ sub handle_missing_link {
my $Name = "$image_name";
my $Link_Dest = "$kimage";

- if ($reverse_symlink) {
- $Old = $image_dest;
- $New = $realimageloc;
- $Name = "$kimage";
- $Link_Dest = $realimageloc . "$image_name";
- }
if (test_relative ('Old Dir' => $Old,
'New Dir' => $New,
'Test File' => $Name)) {
@@ -560,7 +541,7 @@ sub handle_missing_link {
}

# This routine handles the rest of the cases, where the user has requested
-# non-traditional handling, like using cp, or reverse symlinks, or hard links.
+# non-traditional handling, like using cp or hard links.
sub handle_non_symlinks {
my $kimage = $_[0]; # Name of the symbolic link
my $image_dest = $_[1]; # The directory the links goes into
@@ -591,41 +572,6 @@ sub handle_non_symlinks {
##,####
# case Two
#`####
- elsif ($reverse_symlink) { # Maybe /$image_dest is on a dos system?
- my $ret = system("mv -f " . $realimageloc . "$image_name "
- . $image_dest . "$kimage");
- if ($ret) {
- if (-e "$kimage.$$") {
- rename("$kimage.$$", "$kimage");
- }
- die("Failed to move " . $realimageloc . "$image_name to "
- . $image_dest . "$kimage .
");
- }
- my $Old = $image_dest;
- if (test_relative ('Old Dir' => $Old, 'New Dir' => $realimageloc,
- 'Test File' => "$kimage")) {
- $Old =~ s|^/*||o;
- }
- # Special case is they are in the same dir
- my $rel_path = spath('Old' => "$Old", 'New' => "$realimageloc" );
- $Old ="" if $rel_path =~ m/^s*$/o;
-
- if ($use_hard_links =~ m/YES/i) {
- if (! link($Old . "$kimage", $realimageloc . "$image_name")) {
- warn "Could not hard link " . $image_dest .
- "$kimage to $image_name :$!";
- }
- }
- else {
- if (! symlink($Old . "$kimage", $realimageloc . "$image_name")) {
- warn "Could not symlink " . $image_dest .
- "$kimage to $image_name :$!";
- }
- }
- }
- ##,####
- # case Three
- #`####
elsif ($use_hard_links =~ m/YES/i ) {
# Ok then. this ought to be a hard link, and hence fair game
# don't clobber $kimage.old quite yet
@@ -647,7 +593,7 @@ sub handle_non_symlinks {
}
}
##,####
- # case Four
+ # case Three
#`####
else {
# We just use cp
diff --git a/debian/templates/temp.image.plain/postrm b/debian/templates/temp.image.plain/postrm
index a2ab2c8..3a12d7b 100755
--- a/debian/templates/temp.image.plain/postrm
+++ b/debian/templates/temp.image.plain/postrm
@@ -38,7 +38,6 @@ $|=1;
my $version = "=V";
my $link_in_boot = "=IB"; # Should be empty, mostly
my $no_symlink = "=S"; # Should be empty, mostly
-my $reverse_symlink = "=R"; # Should be empty, mostly
my $do_symlink = "Yes"; # target machine defined
my $do_boot_enable = "Yes"; # target machine defined
my $do_bootloader = "Yes"; # target machine defined
@@ -104,7 +103,6 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC" ) {

$do_symlink = "" if /do_symlinkss*=s*(no|false|0)s*$/ig;
$no_symlink = "" if /no_symlinkss*=s*(no|false|0)s*$/ig;
- $reverse_symlink = "" if /reverse_symlinkss*=s*(no|false|0)s*$/ig;
$link_in_boot = "" if /link_in_boots*=s*(no|false|0)s*$/ig;
$do_boot_enable = ' if /do_boot_enables*=s*(no|false|0)s*$/ig;
$relative_links = ' if /relative_links s*=s*(no|false|0)s*$/ig;
@@ -118,7 +116,6 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC" ) {

$do_symlink = "Yes" if /do_symlinkss*=s*(yes|true|1)s*$/ig;
$no_symlink = "Yes" if /no_symlinkss*=s*(yes|true|1)s*$/ig;
- $reverse_symlink = "Yes" if /reverse_symlinkss*=s*(yes|true|1)s*$/ig;
$link_in_boot = "Yes" if /link_in_boots*=s*(yes|true|1)s*$/ig;
$do_boot_enable = "Yes" if /do_boot_enables*=s*(yes|true|1)s*$/ig;
$do_bootloader = "Yes" if /do_bootloaders*=s*(yes|true|1)s*$/ig;
diff --git a/debian/templates/temp.image.plain/preinst b/debian/templates/temp.image.plain/preinst
index 3a36b46..075300b 100755
--- a/debian/templates/temp.image.plain/preinst
+++ b/debian/templates/temp.image.plain/preinst
@@ -27,7 +27,6 @@ $|=1;
my $version = "=V";
my $link_in_boot = "=IB"; # Should be empty, mostly
my $no_symlink = "=S"; # Should be empty, mostly
-my $reverse_symlink = "=R"; # Should be empty, mostly
my $do_symlink = "Yes"; # target machine defined
my $kimage = "=K"; # Should be empty, mostly
my $image_dir = "=D"; # where the image is located
@@ -79,7 +78,6 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC" ) {

$do_symlink = "" if /do_symlinkss*=s*(no|false|0)s*$/ig;
$no_symlink = "" if /no_symlinkss*=s*(no|false|0)s*$/ig;
- $reverse_symlink = "" if /reverse_symlinkss*=s*(no|false|0)s*$/ig;
$link_in_boot = "" if /link_in_boots*=s*(no|false|0)s*$/ig;
$relative_links = ' if /relative_links s*=s*(no|false|0)s*$/ig;
$use_hard_links = ' if /use_hard_linkss*=s*(no|false|0)s*$/ig;
@@ -91,7 +89,6 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC" ) {

$do_symlink = "Yes" if /do_symlinkss*=s*(yes|true|1)s*$/ig;
$no_symlink = "Yes" if /no_symlinkss*=s*(yes|true|1)s*$/ig;
- $reverse_symlink = "Yes" if /reverse_symlinkss*=s*(yes|true|1)s*$/ig;
$link_in_boot = "Yes" if /link_in_boots*=s*(yes|true|1)s*$/ig;
$relative_links = "Yes" if /relative_linkss*=s*(yes|true|1)s*$/ig;
$use_hard_links = "Yes" if /use_hard_linkss*=s*(yes|true|1)s*$/ig;
diff --git a/debian/templates/temp.image.plain/prerm b/debian/templates/temp.image.plain/prerm
index c80f389..5a0491e 100755
--- a/debian/templates/temp.image.plain/prerm
+++ b/debian/templates/temp.image.plain/prerm
@@ -26,7 +26,6 @@ $|=1;
my $version = "=V";
my $link_in_boot = "=IB"; # Should be empty, mostly
my $no_symlink = "=S"; # Should be empty, mostly
-my $reverse_symlink = "=R"; # Should be empty, mostly
my $do_symlinks = "Yes"; # target machine defined
my $do_boot_enable = "Yes"; # target machine defined
my $do_bootloader = "Yes"; # target machine defined
@@ -103,7 +102,6 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC" ) {

$do_symlink = "" if /do_symlinkss*=s*(no|false|0)s*$/ig;
$no_symlink = "" if /no_symlinkss*=s*(no|false|0)s*$/ig;
- $reverse_symlink = "" if /reverse_symlinkss*=s*(no|false|0)s*$/ig;
$link_in_boot = "" if /link_in_boots*=s*(no|false|0)s*$/ig;
$do_boot_enable = ' if /do_boot_enables*=s*(no|false|0)s*$/ig;
$relative_links = ' if /relative_links s*=s*(no|false|0)s*$/ig;
@@ -119,7 +117,6 @@ if (-r "$CONF_LOC" && -f "$CONF_LOC" ) {

$do_symlink = "Yes" if /do_symlinkss*=s*(yes|true|1)s*$/ig;
$no_symlink = "Yes" if /no_symlinkss*=s*(yes|true|1)s*$/ig;
- $reverse_symlink = "Yes" if /reverse_symlinkss*=s*(yes|true|1)s*$/ig;
$link_in_boot = "Yes" if /link_in_boots*=s*(yes|true|1)s*$/ig;
$do_boot_enable = "Yes" if /do_boot_enables*=s*(yes|true|1)s*$/ig;
$do_bootloader = "Yes" if /do_bootloaders*=s*(yes|true|1)s*$/ig;
--
1.6.5.2


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 11-10-2009, 08:06 AM
maximilian attems
 
Default postinst: get rid of reverse symlinks handling

On Mon, 09 Nov 2009, Sebastian Andrzej Siewior wrote:

> maximilian suggested to grab an axe and rip the reverse symlinks handling out.
> The man page for kernel-img.conf has no reference to it anymore.
>
> Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>

thanks a lot, applied.


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 04:57 PM.

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