コード例 #1
0
ファイル: repositories.py プロジェクト: httpdss/deam
 def update(self):
     """
     Main function for repository update
     """
     #go to app hidden directory
     #execute update command inside app directory
     #grab which is the current version
     oldhash = Popen(['git', '--git-dir=' + os.path.join(self.__get_hidden_dir(), '.git'), '--no-pager', 'log', '--pretty=format:%H', '-1'], stdout = PIPE).communicate()[0]
     #git --no-pager log --pretty=format:%H -1
     Popen(['git', '--git-dir=' + os.path.join(self.__get_hidden_dir(), '.git'), 'pull'], stdout = PIPE).communicate()[0]
     #diff old hash againt HEAD
     #copy the desired subfolder from hidden to the app directory
     output = Popen(['git', '--git-dir=' + os.path.join(self.__get_hidden_dir(), '.git'), '--no-pager', 'diff', oldhash, 'HEAD'], stdout = PIPE).communicate()[0]
     output_to_file(output, self.name)
コード例 #2
0
ファイル: repositories.py プロジェクト: httpdss/deam
 def update(self):
     """
     Main function for repository update
     """
     #go to app hidden directory
     #execute update command inside app directory
     revision = Popen(['svn', 'info', self.__get_hidden_dir()], \
                      stdout = PIPE).communicate()[0]
     oldrev = self.get_revision(revision)
     #TODO: could this be a call to subprocess.call ?
     Popen(['svn', 'update', self.__get_hidden_dir()], \
           stdout = PIPE).communicate()[0]
     #copy the desired subfolder from hidden to the app directory
     revision = Popen(['svn', 'info', self.__get_hidden_dir()], \
                      stdout = PIPE).communicate()[0]
     newrev = self.get_revision(revision)
     rev_range = oldrev + ':' + newrev
     output = Popen(['svn', 'diff', self.__get_hidden_dir(), \
                     '-r', rev_range, self.directory], \
                     stdout = PIPE).communicate()[0]
     output_to_file(output, self.name)
コード例 #3
0
ファイル: repositories.py プロジェクト: httpdss/deam
 def update(self):
     urlretrieve(self.url, join(self.location, self.filename + '.tmp'))
     #strip_rn(join(self.location, self.filename + '.tmp'))
     #strip_rn(join(self.location, self.filename))
     output = Popen(['diff', '-u', join(self.location, self.filename), join(self.location, self.filename + '.tmp')], stdout = PIPE).communicate()[0]
     output_to_file(output, self.name)