cleanup obsolete code in policycheck
authorLin Yang <lin.a.yang@intel.com>
Thu, 7 Feb 2013 02:33:35 +0000 (10:33 +0800)
committerLin Yang <lin.a.yang@intel.com>
Thu, 28 Feb 2013 08:00:35 +0000 (16:00 +0800)
Change-Id: Ie93928b509d00d4e885569851571127d0d5f6f09
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
job_policycheck.py

index 6f13f17..9eabca6 100755 (executable)
@@ -107,22 +107,6 @@ if __name__ == '__main__':
     packagingdir = utils.parse_link('%s/%s' % (prjdir, 'packaging'))
     print('packaging dir is %s/%s' % (prjdir, packagingdir))
 
-    '''
-    # Only when there is tag submit/*, it's for submit
-    needsr = False
-    print('\n------------------------\nCheck whether contain submit tag')
-    if GERRIT_BRANCH == 'master':
-        branch = 'trunk'
-    else:
-        branch = GERRIT_BRANCH
-    tag = mygit.describe('--exact-match --match "submit/%s/*"' % branch, GERRIT_PATCHSET_REVISION)
-    if tag:
-        print 'submit tag : %s, on branch %s'  % (tag, GERRIT_BRANCH)
-        needsr = True
-    print('submitted to obs: %s' % needsr)
-    '''
-
-    #newpkg = False
     missedspec = []
     checkspecmsg = ''
     speclist = []
@@ -167,21 +151,6 @@ if __name__ == '__main__':
         except Exception, err:
             print '%s' % err
 
-        '''
-        if not obs_stg_prj or needsr:
-            print('check obs target: %s' % obs_dest_prj)
-            obstarget.append(obs_dest_prj)
-            if os.path.exists(specfile):
-                try:
-                    spec = gbp.rpm.parse_spec(specfile)
-                except exception,exc:
-                    mesger.error('%s' % exc)
-                    end(1)
-                obsprj = obspkg.ObsProject(obs_dest_prj, apiurl = OBS_API_URL, oscrc = OBS_OSCRC_PATH)
-                if check_obs_newpkg(obsprj, spec.name):
-                    newpkg = True
-        '''
-
         if specfile not in speclist:
             speclist.append(specfile)
             print('\n---------------------------------\nrpmlint check %s' % specfile)
@@ -194,15 +163,6 @@ if __name__ == '__main__':
                 checkspecmsg += '\n\n'
             checkspecmsg += msg
 
-    '''
-    elif not obstarget:
-        checkobsmsg = '[IMPORTANT NOTICE]: This change will not be submitted to OBS. If want to trigger submission to OBS, please use gbs submit, which will create an annotated tag submit/$(tizen_version)/$(date -u +%F.%H%M%S) on this commit and push to gerrit.'
-    else:
-        checkobsmsg = '[IMPORTANT NOTICE]: '
-        if newpkg:
-            checkobsmsg += '[New Package] '
-        checkobsmsg += 'This change will be submitted to OBS %s project!!!' % ' '.join(obstarget)
-    '''
     if missedspec:
         checkspecmsg += '\n\n[ERROR]: Can not find %s under packaging directory!' % ' '.join(missedspec)