Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2012-03-21 17:15:29 (GMT)
committer Daniel Drake <dsd@laptop.org>2012-03-21 19:28:07 (GMT)
commit5dc8e8e81c17aa87f0dff82237bbfce8a5b11d8f (patch)
tree6ec1d999fb184761d629cb8d6a445098fe9c188d /lib
parentbc27437835ddf0c9cc339bd20129d2c524b10af9 (diff)
New build number naming scheme
As recently discussed on the devel list, we switch to a new naming scheme for builds, encompassing more details than before. See http://wiki.laptop.org/go/Release_Process#Version_numbering for more info. The name is now built from: 1. Fourth digit of the four-digit year corresponding to the Major Release 2. The release number within the current year 3. Three-digit zero-padded build number 4. An alphabetic 'deployment identifier', max 2 characters 5. A numeric code identifying the target laptop model.
Diffstat (limited to 'lib')
-rw-r--r--lib/ooblib.py15
-rw-r--r--lib/shlib.sh20
2 files changed, 31 insertions, 4 deletions
diff --git a/lib/ooblib.py b/lib/ooblib.py
index a746c94..d58ee8b 100644
--- a/lib/ooblib.py
+++ b/lib/ooblib.py
@@ -35,9 +35,20 @@ def read_buildnr():
return "0"
return open(buildnr_path, "r").readline().strip()
+def read_laptop_model_number():
+ path = os.path.join(intermediatesdir, 'laptop_model_number')
+ if not os.path.isfile(path):
+ return "0"
+ return open(path, "r").readline().strip()
+
def image_name():
- name_tmpl = read_config('global', 'image_name')
- return name_tmpl % int(read_buildnr())
+ major_ver = read_config('global', 'olpc_version_major')
+ minor_ver = read_config('global', 'olpc_version_minor')
+ cust_tag = read_config('global', 'customization_tag')
+ buildnr = int(read_buildnr())
+ modelnr = read_laptop_model_number()
+
+ return "%s%s%03d%s%s" % (major_ver, minor_ver, buildnr, cust_tag, modelnr)
def arch_matches(myarch, arch):
# figure out if a package under 'arch' is suitable for 'myarch'
diff --git a/lib/shlib.sh b/lib/shlib.sh
index 5075154..c984039 100644
--- a/lib/shlib.sh
+++ b/lib/shlib.sh
@@ -26,9 +26,25 @@ read_buildnr() {
fi
}
+read_laptop_model_number()
+{
+ local path=$intermediatesdir/laptop_model_number
+ if [[ -e $path ]]; then
+ echo "$(<$path)"
+ else
+ echo "0"
+ fi
+}
+
image_name() {
- local name_tmpl=$(read_config global image_name)
- printf $name_tmpl $(read_buildnr)
+ local major_ver=$(read_config global olpc_version_major)
+ local minor_ver=$(read_config global olpc_version_minor)
+ local cust_tag=$(read_config global customization_tag)
+ local buildnr=$(read_buildnr)
+ local modelnr=$(read_laptop_model_number)
+
+ buildnr=$(printf %03d "$buildnr")
+ echo "${major_ver: -1}${minor_ver}${buildnr}${cust_tag}${modelnr}"
}
# hard link a file, but fall-back on copy if a device boundary is being crossed