mirror of
				https://github.com/fspc/gbootroot.git
				synced 2025-11-03 16:05:34 -05:00 
			
		
		
		
	Now makes the diversions file .. this is cool.
This commit is contained in:
		
							parent
							
								
									a673116d7e
								
							
						
					
					
						commit
						5ff942d4fe
					
				@ -1,6 +1,6 @@
 | 
				
			|||||||
#!/usr/bin/perl
 | 
					#!/usr/bin/perl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#    make_debian from gBootRoot Copyright (C) 2000, 2001
 | 
					#    make_debian Copyright (C) 2001 from gBootRoot
 | 
				
			||||||
#    Lead Developer and Project Coordinator
 | 
					#    Lead Developer and Project Coordinator
 | 
				
			||||||
#    Jonathan Rosenbaum <freesource@users.sourceforge.net>
 | 
					#    Jonathan Rosenbaum <freesource@users.sourceforge.net>
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@ -151,6 +151,8 @@ close(MY_FILERC);
 | 
				
			|||||||
sub stuff {
 | 
					sub stuff {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$stuff = << "STUFF";
 | 
					$stuff = << "STUFF";
 | 
				
			||||||
 | 
					# Generated by make_debian.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# This template creates a complete Debian system which is more streamlined 
 | 
					# This template creates a complete Debian system which is more streamlined 
 | 
				
			||||||
# than the base.tgz used for normal installations.  Once everything is made, 
 | 
					# than the base.tgz used for normal installations.  Once everything is made, 
 | 
				
			||||||
# you can use user-mode-linux to tweak the system, as well as apt. 
 | 
					# you can use user-mode-linux to tweak the system, as well as apt. 
 | 
				
			||||||
@ -304,7 +306,8 @@ return $stuff;
 | 
				
			|||||||
# Conffiles would have to be handled both before and after Root Filesystem
 | 
					# Conffiles would have to be handled both before and after Root Filesystem
 | 
				
			||||||
# creation so that their md5sums could be accounted for in status.
 | 
					# creation so that their md5sums could be accounted for in status.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# And this finds all the scripts associated with a package in info/*.
 | 
					# And this finds all the scripts associated with a package in info/*,
 | 
				
			||||||
 | 
					# creates an empty available file, and creates the diversions file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sub status_info {
 | 
					sub status_info {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -331,12 +334,46 @@ close(NEW_STATUS);
 | 
				
			|||||||
close(STATUS);
 | 
					close(STATUS);
 | 
				
			||||||
$/ = "\n";
 | 
					$/ = "\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					my %dpkg_divert = [];
 | 
				
			||||||
 | 
					my $dpkg_divert = "dpkg-divert --list|";
 | 
				
			||||||
 | 
					open(DIVERT,"$dpkg_divert") 
 | 
				
			||||||
 | 
					    or die "Couldn't find the dpkg-divert command: $!\n";
 | 
				
			||||||
 | 
					while (<DIVERT>) {
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    my($original,$diversion,$package) = (split(" "))[2,4,6];
 | 
				
			||||||
 | 
					    chomp $package;
 | 
				
			||||||
 | 
					    if (!$dpkg_divert{$package}) { # Just add to the array
 | 
				
			||||||
 | 
						$dpkg_divert{$package} = [$original,$diversion];	
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else {
 | 
				
			||||||
 | 
						push @{ $dpkg_divert {$package} }, $original, $diversion;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					close(DIVERT);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					open(DIVERT,">$home_yard_replacements/var/lib/dpkg/diversions")
 | 
				
			||||||
 | 
					    or die "Couldn't open Replacements/var/lib/dpkg/diversions: $!\n";
 | 
				
			||||||
my @info;
 | 
					my @info;
 | 
				
			||||||
foreach my $rp (@required_packages) {
 | 
					foreach my $rp (@required_packages) {
 | 
				
			||||||
    $rp = (split(/_/,$rp))[0];
 | 
					    $rp = (split(/_/,$rp))[0];
 | 
				
			||||||
    # Get rid of the escapes from the previous invocation.
 | 
					    # Get rid of the escapes from the previous invocation.
 | 
				
			||||||
    $rp =~ s/\\//g if $rp =~ /\\+/g;
 | 
					    $rp =~ s/\\//g if $rp =~ /\\+/g;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    my $count = 0; my @divert;
 | 
				
			||||||
 | 
					    if ($dpkg_divert{$rp}) {
 | 
				
			||||||
 | 
					            foreach my $dv ( @{ $dpkg_divert{$rp} } ) {
 | 
				
			||||||
 | 
							push(@divert,$dv);
 | 
				
			||||||
 | 
							if ($count == 1) {
 | 
				
			||||||
 | 
							    print DIVERT "$divert[0]\n";
 | 
				
			||||||
 | 
							    print DIVERT "$divert[1]\n";
 | 
				
			||||||
 | 
							    print DIVERT "$rp\n";
 | 
				
			||||||
 | 
							    $count = -1; undef @divert;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							$count++;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Figure out info/*  .. this covers it for now.
 | 
					    # Figure out info/*  .. this covers it for now.
 | 
				
			||||||
    if (-f "$info/$rp.preinst") {
 | 
					    if (-f "$info/$rp.preinst") {
 | 
				
			||||||
	push(@info,"$info/$rp.preinst\n");
 | 
						push(@info,"$info/$rp.preinst\n");
 | 
				
			||||||
@ -366,6 +403,7 @@ foreach my $rp (@required_packages) {
 | 
				
			|||||||
	push(@info,"$info/$rp.config\n");        
 | 
						push(@info,"$info/$rp.config\n");        
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					close(DIVERT);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
return @info;
 | 
					return @info;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user