mirror of
				https://github.com/fspc/dswim.git
				synced 2025-10-31 08:25:35 -04:00 
			
		
		
		
	Respects non-root.
This commit is contained in:
		
							parent
							
								
									6e02dd8da4
								
							
						
					
					
						commit
						0dc3e1e2af
					
				
							
								
								
									
										52
									
								
								bin/fastswim
									
									
									
									
									
								
							
							
						
						
									
										52
									
								
								bin/fastswim
									
									
									
									
									
								
							| @ -3,33 +3,40 @@ | |||||||
| require 5.004; | require 5.004; | ||||||
| use strict; | use strict; | ||||||
| 
 | 
 | ||||||
| ################################################################################ | ############################################################################ | ||||||
| #    Package administration and research tool for Debian                       # | # | ||||||
| #    Copyright (C) 1999-2000 Jonathan D. Rosenbaum                             # | #    Package administration and research tool for Debian                        | ||||||
| #                                                                              # | # | ||||||
| #    This program is free software; you can redistribute it and/or modify      # | #    Copyright (C) 1999-2000 Jonathan D. Rosenbaum  | ||||||
| #    it under the terms of the GNU General Public License as published by      # | # | ||||||
| #    the Free Software Foundation; either version 2 of the License, or         # | #                                                                              | ||||||
| #    (at your option) any later version.                                       # | # | ||||||
| #                                                                              # | #    This program is free software; you can redistribute it and/or modify  | ||||||
| #    This program is distributed in the hope that it will be useful,           # | # | ||||||
| #    but WITHOUT ANY WARRANTY; without even the implied warranty of            # | #    it under the terms of the GNU General Public License as published by      | ||||||
| #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             # | #    the Free Software Foundation; either version 2 of the License, or         | ||||||
| #    GNU General Public License for more details.                              # | #    (at your option) any later version.                                        | ||||||
| #                                                                              # | #                                                                               | ||||||
| #    You should have received a copy of the GNU General Public License         # | #    This program is distributed in the hope that it will be useful,          | ||||||
| #    along with this program; if not, write to the Free Software               # | #    but WITHOUT ANY WARRANTY; without even the implied warranty of             | ||||||
| #    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.# | #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              | ||||||
| ################################################################################ | #    GNU General Public License for more details.                               | ||||||
|  | #                                                                             | ||||||
|  | #    You should have received a copy of the GNU General Public License         | ||||||
|  | #    along with this program; if not, write to the Free Software               | ||||||
|  | #    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,  | ||||||
|  | #    USA | ||||||
|  | # | ||||||
|  | ############################################################################# | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| # Because it is a better to write to disk, rather than trying to do | # Because it is a better to write to disk, rather than trying to do | ||||||
| # everthing in memory, and then it's good to close the process which | # everthing in memory, and then it's good to close the process which | ||||||
| # accomplished this.  I am sure there are better ways. | # accomplished this.  I am sure there are better ways. | ||||||
| 
 | 
 | ||||||
| # Anyways if you want to test fastswim do something like this:                   | # Anyways if you want to test fastswim do something like this: | ||||||
| # fastswim --transfer /var/lib/dpkg/info /tmp /var/lib/dpkg and create a         | # fastswim --transfer /var/lib/dpkg/info /tmp /var/lib/dpkg and create a  | ||||||
| # transfer.deb file beforehand in /tmp which has the packagename_version         | # transfer.deb file beforehand in /tmp which has the packagename_version   | ||||||
| # one to a line.  | # one to a line.  | ||||||
| 
 | 
 | ||||||
| my @ppackage; | my @ppackage; | ||||||
| @ -40,6 +47,7 @@ my $temp; | |||||||
| my %HL; | my %HL; | ||||||
| my @name; | my @name; | ||||||
| my %version; | my %version; | ||||||
|  | my $home = $ENV{'HOME'} . "/"; | ||||||
| 
 | 
 | ||||||
| #$| = 1; | #$| = 1; | ||||||
| #$#name = 2000; | #$#name = 2000; | ||||||
| @ -107,7 +115,7 @@ my %version; | |||||||
|              # humm let's rebuild the offending backup list, this |              # humm let's rebuild the offending backup list, this | ||||||
|              # is important for --db. |              # is important for --db. | ||||||
|              unshift(@redolist,"/.");  |              unshift(@redolist,"/.");  | ||||||
|              open(REDOLIST, ">$ARGV[1]/backup/$thingy.bk.bk") |              open(REDOLIST, ">$home$ARGV[1]/backup/$thingy.bk.bk") | ||||||
|              or warn "needed to edit $thingy because it lacked /., |              or warn "needed to edit $thingy because it lacked /., | ||||||
|                       but could not open up a backup file\n"; |                       but could not open up a backup file\n"; | ||||||
|                my $rd; |                my $rd; | ||||||
|  | |||||||
							
								
								
									
										46
									
								
								bin/imswim
									
									
									
									
									
								
							
							
						
						
									
										46
									
								
								bin/imswim
									
									
									
									
									
								
							| @ -3,24 +3,31 @@ | |||||||
| require 5.004; | require 5.004; | ||||||
| use strict; | use strict; | ||||||
| 
 | 
 | ||||||
| ################################################################################ | ############################################################################ | ||||||
| #    Package administration and research tool for Debian                       # | # | ||||||
| #    Copyright (C) 1999-2000 Jonathan D. Rosenbaum                             # | #    Package administration and research tool for Debian                        | ||||||
| #                                                                              # | # | ||||||
| #    This program is free software; you can redistribute it and/or modify      # | #    Copyright (C) 1999-2000 Jonathan D. Rosenbaum  | ||||||
| #    it under the terms of the GNU General Public License as published by      # | # | ||||||
| #    the Free Software Foundation; either version 2 of the License, or         # | #                                                                              | ||||||
| #    (at your option) any later version.                                       # | # | ||||||
| #                                                                              # | #    This program is free software; you can redistribute it and/or modify  | ||||||
| #    This program is distributed in the hope that it will be useful,           # | # | ||||||
| #    but WITHOUT ANY WARRANTY; without even the implied warranty of            # | #    it under the terms of the GNU General Public License as published by      | ||||||
| #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             # | #    the Free Software Foundation; either version 2 of the License, or         | ||||||
| #    GNU General Public License for more details.                              # | #    (at your option) any later version.                                        | ||||||
| #                                                                              # | #                                                                               | ||||||
| #    You should have received a copy of the GNU General Public License         # | #    This program is distributed in the hope that it will be useful,          | ||||||
| #    along with this program; if not, write to the Free Software               # | #    but WITHOUT ANY WARRANTY; without even the implied warranty of             | ||||||
| #    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.# | #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              | ||||||
| ################################################################################ | #    GNU General Public License for more details.                               | ||||||
|  | #                                                                             | ||||||
|  | #    You should have received a copy of the GNU General Public License         | ||||||
|  | #    along with this program; if not, write to the Free Software               | ||||||
|  | #    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,  | ||||||
|  | #    USA | ||||||
|  | # | ||||||
|  | ############################################################################# | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| =pod | =pod | ||||||
| @ -41,6 +48,7 @@ line. | |||||||
| 
 | 
 | ||||||
| =cut | =cut | ||||||
| 
 | 
 | ||||||
|  |     my $home = $ENV{'HOME'} . "/"; | ||||||
| 
 | 
 | ||||||
|    if ($#ARGV == -1) {                                                           |    if ($#ARGV == -1) {                                                           | ||||||
|      print "swim: imswim requires arguments, see program for instructions\n";                                                                       |      print "swim: imswim requires arguments, see program for instructions\n";                                                                       | ||||||
| @ -76,7 +84,7 @@ line. | |||||||
|              # humm let's rebuild the offending backup list, this                |              # humm let's rebuild the offending backup list, this                | ||||||
|              # is important for --db.                                            |              # is important for --db.                                            | ||||||
|              unshift(@redolist,"/.");                                            |              unshift(@redolist,"/.");                                            | ||||||
|              open(REDOLIST, ">$ARGV[0]/backup/$the[0].list.bk.bk")         |              open(REDOLIST, ">$home$ARGV[0]/backup/$the[0].list.bk.bk")         | ||||||
|              or warn "needed to edit $the[0].list because it lacked /.,               |              or warn "needed to edit $the[0].list because it lacked /.,               | ||||||
|                       but could not open up a backup file\n";                    |                       but could not open up a backup file\n";                    | ||||||
|                my $rd;                                                           |                my $rd;                                                           | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user