From kde-commits Tue May 15 22:55:44 2012 From: Allen Winter Date: Tue, 15 May 2012 22:55:44 +0000 To: kde-commits Subject: KDE/kdesdk/scripts Message-Id: <20120515225544.44C6CAC76E () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=133712270104620 SVN commit 1295084 by winterz: attempt to determine a real error from Git versus the situation where the specified branch doesn't exist. For new repos, older versioned branches won't exist. M +19 -3 kde-checkout-list.pl --- trunk/KDE/kdesdk/scripts/kde-checkout-list.pl #1295083:1295084 @@ -31,7 +31,7 @@ use LWP::Simple; # used to fetch the xml db my($Prog) = 'kde-checkout-list.pl'; -my($Version) = '0.92'; +my($Version) = '0.93'; my($help) = ''; my($version) = ''; @@ -153,13 +153,29 @@ } $ret = &runCommand( $command ); if ($ret) { + #check if there is a branch by this name in the repo. If not, then no error. + my($ohno) = 1; + if (-d "$subdir/.git" && $branch) { + $ret = &runCommand( "cd $subdir && git checkout $kdebranch" ); + if ($ret) { + $ohno = 0; + } + } + printf "REMOVING CLONE DUE TO GIT FAILURE\n"; runCommand("rm -rf $subdir"); - printf "REMOVING CLONE DUE TO GIT FAILURE\n"; - exit 1 if ($quitOnError); + if ($ohno) { + if ($quitOnError) { + printf "Exiting due to quit-on-error option\n"; + } else { + printf "Continuing anyway\n" } + } else { + printf "FYI: $subdir does not have a branch called $kdebranch. Continuing normally\n" } } } + } +} # wipe out old checkouts, if requested if ( $doPrune ) {