From 4052469d007d17112b0fdf8814c92c77414a1398 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 16 Jan 2010 22:21:39 +0000 Subject: [PATCH] * improved create_project_files.pl to automatically add the created qt-creator project files to svn:ignore git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35107 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- 3rdparty/qtcreator/create_project_files.pl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/3rdparty/qtcreator/create_project_files.pl b/3rdparty/qtcreator/create_project_files.pl index 501079b594..afdd626a11 100644 --- a/3rdparty/qtcreator/create_project_files.pl +++ b/3rdparty/qtcreator/create_project_files.pl @@ -7,6 +7,8 @@ use strict; This simple script traverses the haiku sources and creates (incomplete) *.pro files in order to make the haiku sources available within the qt-creator IDE. +Additionally, it will add those files to svn:ignore of their parent directory +(unless already contained there). =cut @@ -81,4 +83,24 @@ sub writeProFile "SOURCES = ".join(" \\\n\t", sort @{$info->{sources}})."\n"; } close $proFileFH; + + updateSvnIgnore($proFile); +} + +sub updateSvnIgnore +{ + my $proFile = shift; + + my ($filename, $parentDir) = fileparse($proFile); + + my $svnIgnore = qx{svn propget --strict svn:ignore $parentDir}; + if (!grep { $_ eq $filename } split "\n", $svnIgnore) { + chomp $svnIgnore; + $svnIgnore .= "\n" unless !$svnIgnore; + $svnIgnore .= "$filename\n"; + open(my $propsetFH, "|svn propset svn:ignore --file - $parentDir") + or die "unable to open pipe to 'svn propset'"; + print $propsetFH $svnIgnore; + close($propsetFH); + } }