if force_native or is_native_pkg(repo, args) or args.no_patch_export:
argv.append('--git-native=on')
else:
- argv.append('--git-native=off')
# Check if the revision seems to be of an orphan development branch
- is_orphan = False
export_commitish = 'HEAD' if commit == 'WC.UNTRACKED' else commit
try:
repo.get_merge_base(export_commitish, upstream_branch)
except GitRepositoryError:
- is_orphan = True
- # Development branch in orphan packaging model is identified in the conf
- orphan_packaging = configmgr.get('packaging_branch', 'orphan-devel')
-
- if not is_orphan:
+ log.warn("No common ancestor between export commit and upstream, "
+ "enable native packaging mode")
+ argv.append('--git-native=on')
+ else:
+ argv.append('--git-native=off')
+ # Development branch in orphan packaging model is identified in the conf
+ orphan_packaging = configmgr.get('packaging_branch', 'orphan-devel')
argv.extend(["--git-patch-export",
"--git-patch-export-compress=100k",
"--git-patch-export-squash-until=%s" %
export_rev = orphan_packaging
argv.extend(["--git-patch-export-rev=%s" % commit])
- if repo.has_branch("pristine-tar"):
- argv.extend(["--git-pristine-tar"])
+ if repo.has_branch("pristine-tar"):
+ argv.extend(["--git-pristine-tar"])
argv.append("--git-export=%s" % export_rev)
return SafeConfigParser._read(self, fptr, fname)
- def _set_into_file(self, section, option, value, replace_opt=None):
+ def _set_into_file(self, section, option, value, replace_opt=None, comment=None):
"""Set the value in the file contents
Parsing logic and lot of the code was copied directly from the
cursect = None # None, or a str
optname = None
new_line = '%s = %s\n' % (option, value)
+ new_lineno = None
new_line_written = False
last_section_line = None
+ # add line break for comment
+ if comment is not None:
+ if not comment.endswith('\n'):
+ comment += '\n'
lineno = -1
for lineno in range(len(self._flines)):
(optname == option or optname == replace_opt):
if not new_line_written:
self._flines[lineno] = new_line
+ new_lineno = lineno
new_line_written = True
else:
# Just remove all matching lines, if we've
# Insert new key
if not new_line_written:
if last_section_line is not None:
- self._flines.insert(last_section_line + 1, new_line)
+ if comment is not None:
+ self._flines.insert(last_section_line + 1, comment)
+ self._flines.insert(last_section_line + 2, new_line)
+ else:
+ self._flines.insert(last_section_line + 1, new_line)
else:
if lineno >= 0:
self._flines.insert(lineno + 1, '\n')
self._flines.insert(lineno + 2, '[%s]\n' % section)
- self._flines.insert(lineno + 3, new_line)
+ if comment is not None:
+ self._flines.insert(lineno + 3, comment)
+ self._flines.insert(lineno + 4, new_line)
+ else:
+ self._flines.insert(lineno + 3, new_line)
+ else:
+ if comment is not None and new_lineno is not None:
+ self._flines.insert(new_lineno, comment)
- def set_into_file(self, section, option, value, replace_opt=None):
+ def set_into_file(self, section, option, value, replace_opt=None, comment=None):
"""When set new value, need to update the readin file lines,
which can be saved back to file later.
"""
# If the code reach here, it means the section and key are ok
try:
- self._set_into_file(section, option, value, replace_opt)
+ self._set_into_file(section, option, value, replace_opt, comment)
except Exception as err:
# This really shouldn't happen, we've already once parsed the file
# contents successfully.
#user =
#CAUTION: please use the key name "passwd" to reset plaintext password
#passwd =
-obs = obs.tizen
#Comma separated list of repositories
-repos = repo.tizen_latest
-#repos = repo.tizen_main, repo.tizen_base
+repos = repo.tizen_base, repo.tizen_unified
#Build config for gbs build
+#Specify build conf for a specific profile by using shell-style variable references
#buildconf = <patch/to/build-config-file>
#Comma separated list of additional packages be excluded building
#exclude_packages = libtool,gettext
-[obs.tizen]
-#OBS API URL pointing to a remote OBS.
-url = https://api.tizen.org
-#Optional user and password, set if differ from profile's user and password
-#user =
-#passwd =
-
#Repo section example
-[repo.tizen_latest]
-#Build against repo's URL
-url = http://download.tizen.org/releases/daily/trunk/ivi/latest/
-#Optional user and password, set if differ from profile's user and password
+[repo.tizen_base]
+#Stable release version of tizen base repo
+url = http://download.tizen.org/releases/milestone/TIZEN/Tizen/Tizen-Base/latest/repos/standard/packages/
+#Latest snapshots version of tizen base repo
+#url = http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Base/latest/repos/standard/packages/
#user =
#passwd =
-#Individual repo is also supported
-#[repo.tizen_base]
-#url = http://download.tizen.org/releases/daily/trunk/ivi/latest/repos/base/ia32/packages/
-#[repo.tizen_main]
-#url = http://download.tizen.org/releases/daily/trunk/ivi/latest/repos/ivi/ia32/packages/
+[repo.tizen_unified]
+#Stable release version of tizen unified repo
+url = http://download.tizen.org/releases/milestone/TIZEN/Tizen/Tizen-Unified/latest/repos/standard/packages/
+#Latest snapshots version of tizen unified repo
+#url = http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/repos/standard/packages/
+
+[repo.my_local]
+#local repo must be an absolute path
+#url = <Full_Path_of_Local_Repository>
'''
# make the manager class as singleton
def _check_passwd(self):
'convert passwd item to passwdx and then update origin conf files'
dirty = set()
-
+ comment = "# WARNING: passwordx can be decoded, don't expose gbs.conf to the outside"
all_sections = set()
for layer in self._cfgparsers:
for sec in layer.sections():