mirror of
				https://github.com/fspc/dswim.git
				synced 2025-10-31 00:15:35 -04:00 
			
		
		
		
	Cleaned this up, and has better STDERR informational output.
This commit is contained in:
		
							parent
							
								
									81bd493ce3
								
							
						
					
					
						commit
						ec35f37da4
					
				| @ -83,6 +83,14 @@ sub ramdisk { | ||||
|          $size = (stat("$where/$not$contentsindex$arch$dist.deb.gz"))[7]; | ||||
|           push(@files,"$where/$not$contentsindex$arch$dist.deb.gz"); | ||||
|   } | ||||
|    elsif ( $commands->{"n"} ) { | ||||
|        print STDERR "swim: not-installed search databases do not exist\n"; | ||||
|        return "not-installed search non-existent"; | ||||
|    } | ||||
|    elsif ( !$commands->{"searchfile"} ) { | ||||
|        print STDERR "swim: use --seaarchfile for installed system\n"; | ||||
|        return "searchfile installed"; | ||||
|    } | ||||
|    | ||||
|   if ($commands->{"searchfile"}) { | ||||
|     # stat caused some weirdisms based on the boolean logic | ||||
| @ -117,7 +125,7 @@ sub ramdisk { | ||||
|  # it will be assumed that ext2 is used, and hopefully there isn't a mount | ||||
|  # of the exact same name..hence dramdisk should be unusual | ||||
|   my $number; | ||||
|   if (defined @storage) { | ||||
|   if ( @storage) { | ||||
|     @storage = sort {$a cmp $b} @storage; | ||||
|     $storage[$#storage] =~ s/\D//g; | ||||
|     $number = $storage[$#storage] + 1; | ||||
| @ -158,7 +166,8 @@ sub ramdisk { | ||||
|         my($device,$mount) = split(/\s/,$_,2); | ||||
|           if ($mount =~ /dramdisk/) { | ||||
|           system "$umount", "$device"; | ||||
|           exit; | ||||
| 	  print STDERR "swim: ramdisk is off\n"; | ||||
|           return "ramdiskoff"; | ||||
|           } | ||||
|         $storage[$count] = $device; | ||||
|         $count++; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user