ooo-build r13399 - in trunk: . bin



Author: jannieuw
Date: Fri Jul 25 19:39:16 2008
New Revision: 13399
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13399&view=rev

Log:
2008-07-25  Jan Nieuwenhuizen  <janneke gnu org>

	* bin/gob (patch_get_branch): Also strip -localize and change
	order of stripping other suffixes.  Fixes aggregation of some
	patches into branches.
	(File.__init__): Ignore ./ prefix on file names.  Fixes
	patch dependencies for vcl-linking-randr.diff.
	(Command.git_export): Okay dev300-m25, it works!


Modified:
   trunk/ChangeLog
   trunk/bin/gob

Modified: trunk/bin/gob
==============================================================================
--- trunk/bin/gob	(original)
+++ trunk/bin/gob	Fri Jul 25 19:39:16 2008
@@ -139,14 +139,18 @@
     if re.search ('^(fix-linkoo|linkoo-)', base):
         return 'linkoo'
 
-    # Patches with a module suffix are aggregated into one branch
-    base = re.sub ('-(%(module_re)s)$' % locals (), '', base)
-
     # Remove workspace and milestone suffixes
     workspace = options.workspace
     milestone = options.milestone
     base = re.sub ('-%(workspace)s' % locals (), '', base)
     base = re.sub ('-m%(milestone)s' % locals (), '', base)
+
+    # Patches with a -localize suffix are aggregated into one branch
+    base = re.sub ('-localize$' % locals (), '', base)
+
+    # Patches with a module suffix are aggregated into one branch
+    base = re.sub ('-(%(module_re)s)$' % locals (), '', base)
+
     return base
 
 # Hard handy work for m19 gets quickly bit rotten
@@ -194,7 +198,7 @@
         self.ranges = None
         self.name = None
         if self.string.find ('\n+++ ') >= 0:
-            self.name = re.search ('\n[+]{3}\s+([^\s]+)', self.string).group (1)
+            self.name = re.search ('\n[+]{3}\s+([.]/)?([^\s]+)', self.string).group (2)
     def __repr__ (self):
         return '<File: %(name)s>' % self.__dict__
     def get_ranges (self):
@@ -425,18 +429,17 @@
             drink = Setup ().get ('DRINK', 'tea')
             print >> sys.stderr, 'Unpacking source tree - [ go and have some %(drink)s ] ...' % locals ()
             system ('cd bin && ./unpack')
-            self.system ('touch unpack')
         if not os.path.isdir (dir + '/.git'):
             create_gitignores (dir)
             drink = Setup ().get ('DRINK')
             print >> sys.stderr, 'Creating GIT archive - [ go and have some %(drink)s ] ...' % locals ()
-            self.system ('git init')
+            self.system ('git-init')
             svn_revision = get_svn_revision ()
             self.commit ('Initial svn:r%(svn_revision)s unpatched.' % locals ())
-            self.system ('git branch %(pristine)s' % self.__dict__)
-            self.system ('git tag gob-%(workspace)s-%(milestone)s %(pristine)s' % self.__dict__)
-            self.system ('git branch pristine')
-            self.system ('git gc')
+            self.system ('git-branch %(pristine)s' % self.__dict__)
+            self.system ('git-tag gob-%(workspace)s-%(milestone)s %(pristine)s' % self.__dict__)
+            self.system ('git-branch pristine')
+            self.system ('git-gc')
         if clean:
             if self.is_modified ():
                 self.system ('git reset --hard HEAD')
@@ -444,7 +447,7 @@
         if self.has_branch (self.patched):
             self.checkout (self.patched)
         else:
-            self.system ('git checkout -b %(patched)s pristine' % self.__dict__)
+            self.system ('git-checkout -b %(patched)s pristine' % self.__dict__)
         if self.has_branch (self.scratch):
             self.system ('git branch -D %(scratch)s' % self.__dict__)
     def pipe (self, command, raise_on_error=True):
@@ -455,11 +458,11 @@
         return system ('cd %(dir)s && %(command)s' % locals (), raise_on_error)
     def get_branches (self):
         return filter_out (operator.not_,
-                           self.pipe ('git branch')
+                           self.pipe ('git-branch')
                            .replace ('*', '')
                            .replace (' ', '').split ('\n'))
     def get_log (self, branch=''):
-        return self.pipe ('git log --pretty=oneline %(branch)s --' % locals ())
+        return self.pipe ('git-log --pretty=oneline %(branch)s --' % locals ())
     def current_commit (self, branch=''):
         s = self.get_log ('-1 ' + branch)
         return s[:s.index (' ')]
@@ -475,12 +478,12 @@
             self.commits = dict (map (grok_log_line, log.split ('\n')[:-2]))
         return self.commits.get (patch, None)
     def commit (self, message):
-        self.system ('git add .')
-        self.system ('git add -u .')
-        self.system ('''git commit -m '%(message)s' ''' % locals ())
+        self.system ('git-add .')
+        self.system ('git-add -u .')
+        self.system ('''git-commit -m '%(message)s' ''' % locals ())
     def is_modified (self):
         return re.sub ('# On branch.*\nnothing to commit \(working directory clean\)\n', '',
-                       self.pipe ('git status', raise_on_error=False))
+                       self.pipe ('git-status', raise_on_error=False))
     def assert_clean (self):
         dir = self.dir
         pending = self.is_modified ()
@@ -488,9 +491,9 @@
             raise GitFailed ('working directory unclean: %(dir)s\n%(pending)s' % locals ())
     def checkout (self, branch):
         if not self.is_on_branch (branch):
-            self.system ('git checkout %(branch)s' % locals ())
+            self.system ('git-checkout %(branch)s' % locals ())
     def get_current_branch (self):
-        return re.search ('(^|\n)\* (.+)', self.pipe ('git branch')).group (2)
+        return re.search ('(^|\n)\* (.+)', self.pipe ('git-branch')).group (2)
     def is_on_branch (self, branch):
         return branch == self.get_current_branch ()
     def has_branch (self, branch):
@@ -508,14 +511,14 @@
             dependencies = branch_get_dependencies_with_override (branches, patches, branch)
         if not self.has_branch (branch):
             base_depend = dependencies[0]
-            self.system ('git checkout -b %(branch)s %(base_depend)s' % locals ())
+            self.system ('git-checkout -b %(branch)s %(base_depend)s' % locals ())
             for dependency in dependencies[1:]:
-                self.system ('git rebase %(dependency)s' % locals ())
+                self.system ('git-rebase %(dependency)s' % locals ())
         else:
             self.checkout (branch)
         log = self.get_log (patched)
         commit = log[:log.index (' ')]
-        self.system ('git cherry-pick -x %(commit)s' % locals ())
+        self.system ('git-cherry-pick -x %(commit)s' % locals ())
     def before_ (self):
         self.assert_clean ()
         self.system ('git checkout -b %(scratch)s %(patched)s' % self.__dict__)
@@ -526,7 +529,7 @@
     def pick_patch (self, patch, commit):
         branch = patch_get_branch (patch)
         print >> sys.stderr, 'Picking patch[%(branch)s]:' % locals (), patch.name
-        self.system ('git cherry-pick -x %(commit)s' % locals ())
+        self.system ('git-cherry-pick -x %(commit)s' % locals ())
     def add_patch (self, branches, patches, patch):
         if patch.name in self.get_log ():
             print >> sys.stderr, 'patch already applied, skipping:', patch.name
@@ -712,15 +715,15 @@
     def git_export (self):
         '''export to GIT with branches'''
         if (not options.force
-            and (self.options.milestone not in ['19', '21']
+            and (self.options.milestone not in ['19', '21', '25']
                  or self.options.workspace != 'dev300')):
-            raise SystemFailed ('Export only supported for dev300-m19, dev300-m21.  Use --force to override')
+            raise SystemFailed ('Export only supported for dev300-m19,21,25.  Use --force to override')
         git = Git (self.options.build_dir, self.options.patched, clean=True)
         patches = self.get_patches ()
         branches = self.get_branches ()
         for patch in self.get_patches ():
             git.add_patch (branches, patches, patch)
-        git.system ('git gc')
+        git.system ('git-gc')
     def get_patches_for_distro (self, distro):
         patches = reduce (operator.add, map (lambda section: section.get_patches (), self.get_sections_for_distro (distro)))
         for patch in patches:
@@ -742,7 +745,7 @@
         git = Git (self.options.build_dir, self.options.patched)
         svn_revision = get_svn_revision ()
         git.commit ('Update to svn:r%(svn_revision)s patched.' % locals ())
-        git.system ('git rebase patched')
+        git.system ('git-rebase patched')
     def dependencies (self):
         '''list branch dependencies'''
         patches = self.get_patches ()
@@ -788,9 +791,9 @@
     def reset (self):
         '''reset - set GIT tree to pristine and remove all branches'''
         git = Git (self.options.build_dir, self.options.patched)
-        git.system ('git checkout -f %(patched)s' % git.__dict__)
-        git.system ('git reset --hard pristine')
-        git.system ('''git branch | grep -Ev '/|master|patched|pristine|upstream|%(patched)s' | xargs git branch -D''' % git.__dict__)
+        git.system ('git-checkout -f %(patched)s' % git.__dict__)
+        git.system ('git-reset --hard pristine')
+        git.system ('''git-branch | grep -Ev '/|master|patched|pristine|upstream|%(patched)s' | xargs git branch -D''' % git.__dict__)
     def patch_depend (self):
         '''patch-depend PATCH-1 PATCH-2 - show overlap between patches'''
         if len (self.options.arguments) != 2:
@@ -947,7 +950,6 @@
     options = set_option_defaults (parse_options ())
     apply_file = options.apply_dir + '/apply'
     apply = Apply (apply_file, options.workspace, options.milestone)
-    print options
     Command.__dict__[options.command] (Command (apply, options))
 
 if __name__ == '__main__':



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]