Skip to content
Snippets Groups Projects
Select Git revision
  • d66e7bb7cf435d7bf13505540ebeb9b02bb4210a
  • master default protected
  • android-7.1.2_r28_klist
  • oreo-mr1-iot-release
  • sdk-release
  • pie-cts-dev
  • pie-cts-release
  • pie-vts-release
  • nougat-iot-release
  • pie-gsi
  • pie-platform-release
  • pie-r2-release
  • pie-r2-s1-release
  • pie-release
  • pie-dev
  • oreo-m4-s4-release
  • o-mr1-iot-preview-8
  • oreo-m2-s2-release
  • oreo-m2-s1-release
  • oreo-m6-s2-release
  • oreo-m6-s3-release
  • android-o-mr1-iot-release-1.0.4
  • android-9.0.0_r8
  • android-9.0.0_r7
  • android-9.0.0_r6
  • android-9.0.0_r5
  • android-8.1.0_r46
  • android-8.1.0_r45
  • android-n-iot-release-smart-display-r2
  • android-vts-8.1_r5
  • android-cts-8.1_r8
  • android-cts-8.0_r12
  • android-cts-7.1_r20
  • android-cts-7.0_r24
  • android-cts-6.0_r31
  • android-o-mr1-iot-release-1.0.3
  • android-cts-9.0_r1
  • android-8.1.0_r43
  • android-8.1.0_r42
  • android-n-iot-release-smart-display
  • android-p-preview-5
41 results

Android.bp

Blame
  • git-mv.perl 4.58 KiB
    #!/usr/bin/perl
    #
    # Copyright 2005, Ryan Anderson <ryan@michonline.com>
    #                 Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
    #
    # This file is licensed under the GPL v2, or a later version
    # at the discretion of Linus Torvalds.
    
    
    use warnings;
    use strict;
    use Getopt::Std;
    
    sub usage() {
    	print <<EOT;
    $0 [-f] [-n] <source> <dest>
    $0 [-f] [-k] [-n] <source> ... <dest directory>
    
    In the first form, source must exist and be either a file,
    symlink or directory, dest must not exist. It renames source to dest.
    In the second form, the last argument has to be an existing
    directory; the given sources will be moved into this directory.
    
    Updates the git cache to reflect the change.
    Use "git commit" to make the change permanently.
    
    Options:
      -f   Force renaming/moving, even if target exists
      -k   Continue on error by skipping
           not-existing or not revision-controlled source
      -n   Do nothing; show what would happen
    EOT
    	exit(1);
    }
    
    # Sanity checks:
    my $GIT_DIR = $ENV{'GIT_DIR'} || ".git";
    
    unless ( -d $GIT_DIR && -d $GIT_DIR . "/objects" && 
    	-d $GIT_DIR . "/objects/" && -d $GIT_DIR . "/refs") {
        print "Git repository not found.";
        usage();
    }
    
    
    our ($opt_n, $opt_f, $opt_h, $opt_k, $opt_v);
    getopts("hnfkv") || usage;
    usage() if $opt_h;
    @ARGV >= 1 or usage;
    
    my (@srcArgs, @dstArgs, @srcs, @dsts);
    my ($src, $dst, $base, $dstDir);
    
    my $argCount = scalar @ARGV;
    if (-d $ARGV[$argCount-1]) {
    	$dstDir = $ARGV[$argCount-1];
    	# remove any trailing slash
    	$dstDir =~ s/\/$//;
    	@srcArgs = @ARGV[0..$argCount-2];
    	
    	foreach $src (@srcArgs) {
    		$base = $src;
    		$base =~ s/^.*\///;
    		$dst = "$dstDir/". $base;
    		push @dstArgs, $dst;
    	}
    }
    else {
        if ($argCount != 2) {
    	print "Error: moving to directory '"