Remove unused mainainance scripts. These were necessary when 1.6-ext was still on the SVN-server but are completely useless on git/hg
This commit is contained in:
parent
11ab9eebd8
commit
5e5c8a8afc
3 changed files with 0 additions and 241 deletions
|
@ -1,101 +0,0 @@
|
|||
#! /usr/bin/python
|
||||
|
||||
# debugmode=True
|
||||
debugmode=False
|
||||
|
||||
from os import listdir,path,system
|
||||
from popen2 import popen4
|
||||
import sys
|
||||
|
||||
def svnCommand(cmd):
|
||||
if debugmode:
|
||||
print "SVN:",cmd
|
||||
else:
|
||||
system("svn "+cmd)
|
||||
|
||||
def rmEmpty(d):
|
||||
if not path.isdir(d):
|
||||
return False
|
||||
else:
|
||||
isEmpty=True
|
||||
for f in listdir(d):
|
||||
if f==".svn":
|
||||
isEmpty=False
|
||||
elif not rmEmpty(path.join(d,f)):
|
||||
isEmpty=False
|
||||
if isEmpty:
|
||||
print "Removing ",d,"because it is empty"
|
||||
if not debugmode:
|
||||
system("rmdir "+d)
|
||||
return isEmpty
|
||||
|
||||
start=sys.argv[1]
|
||||
|
||||
rmEmpty(start)
|
||||
|
||||
rein,raus=popen4("svn status "+start)
|
||||
lines=rein.readlines()
|
||||
rein.close()
|
||||
raus.close()
|
||||
|
||||
modified=0
|
||||
added=0
|
||||
removed=0
|
||||
conflicting=0
|
||||
replaced=0
|
||||
|
||||
for l in lines:
|
||||
status=l[0]
|
||||
pstatus=l[1]
|
||||
name=l[7:-1]
|
||||
if status=="?":
|
||||
print "Adding",name
|
||||
svnCommand("add "+name)
|
||||
elif status=="!":
|
||||
print "Removing",name
|
||||
svnCommand("delete "+name)
|
||||
elif status=="M":
|
||||
modified+=1
|
||||
elif status=="A":
|
||||
added+=1
|
||||
elif status=="D":
|
||||
removed+=1
|
||||
elif status=="C":
|
||||
conflicting+=1
|
||||
elif status=="R":
|
||||
replaced+=1
|
||||
elif status=="~":
|
||||
print "Problem with",name
|
||||
|
||||
print
|
||||
print "Modified files:",modified
|
||||
print "Added files:",added
|
||||
print "Removed files:",removed
|
||||
print "Conflicting files:",conflicting
|
||||
print "Replaced files:",replaced
|
||||
print
|
||||
|
||||
def checkEmptyDirs(current):
|
||||
nrOfContents=0
|
||||
|
||||
for f in listdir(current):
|
||||
if f==".svn":
|
||||
continue
|
||||
|
||||
pfad=path.join(current,f)
|
||||
|
||||
if path.isdir(pfad):
|
||||
if checkEmptyDirs(pfad):
|
||||
nrOfContents+=1
|
||||
else:
|
||||
nrOfContents+=1
|
||||
|
||||
if nrOfContents==0:
|
||||
print "Removing",current
|
||||
svnCommand("remove "+current)
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
checkEmptyDirs(start)
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
#! /usr/bin/python
|
||||
|
||||
import sys,re
|
||||
from os import path
|
||||
from subprocess import Popen,PIPE,call
|
||||
import tarfile
|
||||
|
||||
if len(sys.argv)!=2:
|
||||
print "Error: SVN-Url is needed"
|
||||
sys.exit(-1)
|
||||
|
||||
url=sys.argv[1]
|
||||
|
||||
name=path.basename(url[:-1])
|
||||
|
||||
p=Popen(["svn","info",url],stdin=PIPE, stdout=PIPE, close_fds=True)
|
||||
|
||||
(child_stdout, child_stdin) = (p.stdout, p.stdin)
|
||||
|
||||
revision=-1
|
||||
|
||||
for l in child_stdout.readlines():
|
||||
m=re.compile("Last Changed Rev: (.+)").match(l)
|
||||
if m!=None:
|
||||
revision=int(m.group(1))
|
||||
|
||||
if revision<0:
|
||||
print "Invalid URL or stuff"
|
||||
sys.exit(-1)
|
||||
|
||||
fullname="%s.r%d" % (name,revision)
|
||||
l
|
||||
print "Generating",fullname
|
||||
|
||||
retcode=call(["svn","export",url,fullname])
|
||||
if retcode!=0:
|
||||
print "Problem. Returncode",retcode
|
||||
sys.exit(-1)
|
||||
|
||||
print "Tarring ...."
|
||||
tar=tarfile.open(fullname+".tgz","w:gz")
|
||||
tar.add(fullname,arcname=name)
|
||||
tar.close()
|
||||
print "Removing directory"
|
||||
retcode=call(["rm","-rf",fullname])
|
||||
print "Finished"
|
|
@ -1,94 +0,0 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
# this script adds a set of SVN-properties to files and directories under
|
||||
# a directory that is specified on the command line
|
||||
|
||||
from popen2 import popen2
|
||||
import sys
|
||||
import string
|
||||
import glob
|
||||
from os import path,listdir
|
||||
|
||||
svnCommand="svn"
|
||||
isSVK=False
|
||||
|
||||
def runSvn(cmd):
|
||||
raus,rein=popen2(svnCommand+" "+cmd)
|
||||
result=raus.readlines()
|
||||
rein.close()
|
||||
raus.close()
|
||||
return result
|
||||
|
||||
def getProperty(fName,property):
|
||||
raw=runSvn("propget %s %s" % (property,fName))
|
||||
return string.join(raw)
|
||||
|
||||
def setProperty(fName,property,value):
|
||||
runSvn("propset %s \"%s\" %s" % (property,value,fName))
|
||||
|
||||
def addToListProperty(fName,property,value):
|
||||
tmp=getProperty(fName,property)
|
||||
lst=map(string.strip,string.split(tmp))
|
||||
if not value in lst:
|
||||
lst.append(value)
|
||||
else:
|
||||
return False
|
||||
val=string.join(lst,"\n")
|
||||
setProperty(fName,property,val)
|
||||
return True
|
||||
|
||||
def addKeyword(fName,keyword):
|
||||
return addToListProperty(fName,"svn:keywords",keyword)
|
||||
|
||||
def addIgnore(fName,keyword):
|
||||
return addToListProperty(fName,"svn:ignore",keyword)
|
||||
|
||||
def recursivlyDoToFiles(directory,fileFilter,function,isDir=False,testSvn=True):
|
||||
if testSvn and not isSVK:
|
||||
if not path.exists(path.join(directory,".svn")):
|
||||
return
|
||||
|
||||
for f in glob.glob(path.join(directory,fileFilter)):
|
||||
if not path.isfile(f) and not path.isdir(f):
|
||||
continue
|
||||
|
||||
if (isDir and path.isfile(f)) or (not isDir and path.isdir(f)):
|
||||
continue
|
||||
|
||||
if isDir and testSvn and not isSVK:
|
||||
if not path.exists(path.join(f,".svn")):
|
||||
continue
|
||||
|
||||
if function(f):
|
||||
print "....",f
|
||||
|
||||
for f in listdir(directory):
|
||||
if f not in [".svn","lnInclude"]:
|
||||
tmp=path.join(directory,f)
|
||||
if path.isdir(tmp):
|
||||
recursivlyDoToFiles(tmp,fileFilter,function,isDir=isDir,testSvn=testSvn)
|
||||
|
||||
if not path.exists(path.join(sys.argv[1],".svn")):
|
||||
svnCommand="svk"
|
||||
isSVK=True
|
||||
|
||||
print "\nAdding Id-keyword to Python-files"
|
||||
recursivlyDoToFiles(sys.argv[1],"*.py",lambda x:addKeyword(x,"Id"))
|
||||
|
||||
print "\nAdding Id-keyword to C++-files"
|
||||
recursivlyDoToFiles(sys.argv[1],"*.C",lambda x:addKeyword(x,"Id"))
|
||||
|
||||
print "\nAdding Id-keyword to C++-headers"
|
||||
recursivlyDoToFiles(sys.argv[1],"*.H",lambda x:addKeyword(x,"Id"))
|
||||
|
||||
print "\nAdding *Opt to ignore-list for Make-directories"
|
||||
recursivlyDoToFiles(sys.argv[1],"Make",lambda x:addIgnore(x,"*Opt"),isDir=True)
|
||||
|
||||
print "\nAdding *Debug to ignore-list for Make-directories"
|
||||
recursivlyDoToFiles(sys.argv[1],"Make",lambda x:addIgnore(x,"*Debug"),isDir=True)
|
||||
|
||||
print "\nAdding lnInclude to ignore-list for all directories"
|
||||
recursivlyDoToFiles(sys.argv[1],"*",lambda x:addIgnore(x,"lnInclude"),isDir=True)
|
||||
|
||||
print "\nAdding *.dep to ignore-list for all directories"
|
||||
recursivlyDoToFiles(sys.argv[1],"*",lambda x:addIgnore(x,"*.dep"),isDir=True)
|
Reference in a new issue