/[soft]/mga-gnome/trunk/mga-gnome
ViewVC logotype

Diff of /mga-gnome/trunk/mga-gnome

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3568 by ovitters, Mon Mar 19 14:26:13 2012 UTC revision 3647 by ovitters, Wed Mar 21 16:14:34 2012 UTC
# Line 338  class SpecFile(object): Line 338  class SpecFile(object):
338              subprocess.check_call(['bm', '-p', '--nodeps'], cwd=self.cwd)              subprocess.check_call(['bm', '-p', '--nodeps'], cwd=self.cwd)
339          except subprocess.CalledProcessError:          except subprocess.CalledProcessError:
340              logfile = os.path.join(os.path.dirname(self.path), 'log.%s' % os.path.splitext(os.path.basename(self.path))[0])              logfile = os.path.join(os.path.dirname(self.path), 'log.%s' % os.path.splitext(os.path.basename(self.path))[0])
341              if os.path.exists(logfile)              if os.path.exists(logfile):
342                  subprocess.call(['tail', '-n', '15', logfile])                  subprocess.call(['tail', '-n', '15', logfile])
343              return False              return False
344    
# Line 673  def cmd_package_new_version(options, par Line 673  def cmd_package_new_version(options, par
673              sys.stderr(1)              sys.stderr(1)
674    
675          for filename in sources:          for filename in sources:
676              if not is_valid_hash(os.path.join(cwd, "SOURCES", filename), options.algo, options.hexdigest):              path = os.path.join(cwd, "SOURCES", filename)
677                if not is_valid_hash(path, options.algo, options.hexdigest):
678                  print >>sys.stderr, "ERROR: Hash file failed check for %s!" % path                  print >>sys.stderr, "ERROR: Hash file failed check for %s!" % path
679                  print >>sys.stderr, "ERROR: Reverting changes!"                  print >>sys.stderr, "ERROR: Reverting changes!"
680                  subprocess.call(['svn', 'revert', '-R', cwd], cwd=cwd)                  subprocess.call(['svn', 'revert', '-R', cwd], cwd=cwd)
# Line 685  def cmd_package_new_version(options, par Line 686  def cmd_package_new_version(options, par
686              # checkin changes              # checkin changes
687              subprocess.check_call(['mgarepo', 'ci', '-m', 'new version %s' % options.version], cwd=cwd)              subprocess.check_call(['mgarepo', 'ci', '-m', 'new version %s' % options.version], cwd=cwd)
688              # and submit              # and submit
689              subprocess.check_call(['mgarepo', 'submit'], cwd=cwd)              # XXX HACK NOT TO AUTO SUBMIT ATM
690                if options.hexdigest is None:
691                    subprocess.check_call(['mgarepo', 'submit'], cwd=cwd)
692          except subprocess.CalledProcessError:          except subprocess.CalledProcessError:
693              sys.exit(1)              sys.exit(1)
694    
695  def cmd_parse_ftp_release_list(options, parser):  def cmd_parse_ftp_release_list(options, parser):
696      def _send_reply_mail(contents, orig_msg, to, error=False):      def _send_reply_mail(contents, orig_msg, to, packages=[], error=False):
697          """Send an reply email"""          """Send an reply email"""
698          contents.seek(0)          contents.seek(0)
699          msg = MIMEText(contents.read(), _charset='utf-8')          msg = MIMEText(contents.read(), _charset='utf-8')
700    
701          if error:          if error:
702              # XXX - ugly              # XXX - ugly
703              contents.seek(0)              contents.seek(0)
704              lastline = contents.read().rstrip().splitlines()[-1]              lastline = contents.read().rstrip().splitlines()[-1]
705              # Remove things like "ERROR: " and so on from the last line              # Remove things like "ERROR: " and so on from the last line
706              lastline = re.sub(r'^(?:[^ :]+:\s+)+', '', lastline)              lastline = re.sub(r'^(?:[^ :]+:\s+)+', '', lastline)
707                # Remove things like "   - " (youri output from mgarepo submit)
708                lastline = re.sub(r'^\s+-\s+', '', lastline)
709              subjecterror = " (ERROR: %s)" % lastline if lastline else " (ERROR)"              subjecterror = " (ERROR: %s)" % lastline if lastline else " (ERROR)"
710          else:          else:
711              subjecterror = ""              subjecterror = ""
712          msg['Subject'] = "Re: %s%s" % (orig_msg['Subject'], subjecterror)  
713            if packages:
714                subject = "%s %s%s" % (", ".join(packages), orig_msg['X-Module-Version'], subjecterror)
715            else:
716                subject = "Re: %s%s" % (orig_msg['Subject'], subjecterror)
717    
718            msg['Subject'] = subject
719          msg['To'] = to          msg['To'] = to
720          msg["In-Reply-To"] = orig_msg["Message-ID"]          msg["In-Reply-To"] = orig_msg["Message-ID"]
721          msg["References"] = orig_msg["Message-ID"]          msg["References"] = orig_msg["Message-ID"]
# Line 765  def cmd_parse_ftp_release_list(options, Line 777  def cmd_parse_ftp_release_list(options,
777          if subprocess.call(cmd, stdout=stdout, stderr=stderr):          if subprocess.call(cmd, stdout=stdout, stderr=stderr):
778              error = True              error = True
779    
780      if options.mail: _send_reply_mail(stdout, msg, options.mail, error=error)      if options.mail: _send_reply_mail(stdout, msg, options.mail, packages=packages, error=error)
781    
782  def main():  def main():
783      description = """Mageia GNOME commands."""      description = """Mageia GNOME commands."""

Legend:
Removed from v.3568  
changed lines
  Added in v.3647

  ViewVC Help
Powered by ViewVC 1.1.30