Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test single letter increment of tag to fix build. #870

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions bundles/org.eclipse.swt/buildSWT.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,19 +291,27 @@
</exec>
<script language="javascript">
<![CDATA[
tags = project.getProperty("tags");
swt_version = project.getProperty("swt_version");
if (!tags.match(swt_version)) {
project.setProperty("swt_new_tag", swt_version);
} else {
for (i=97; i<123; i++) {
t = swt_version + String.fromCharCode(i);
if (!tags.match(t)) {
project.setProperty("swt_new_tag", t);
break;
}
}
}
tags = project.getProperty("tags");
swt_version = project.getProperty("swt_version");
if (!tags.match(swt_version)) {
project.setProperty("swt_new_tag", swt_version);
} else {
var found = false;
var suffix = 'a';
while (!found) {
var t = swt_version + suffix;
if (!tags.match(t)) {
project.setProperty("swt_new_tag", t);
found = true;
} else {
if (suffix === 'z') {
suffix = 'a'; // Reset to 'a' after 'z'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In existing code, if we've reached the case of 'z', it is most likely that the case of 'a' (i=97) and all other letters already reported that the suffix is already used.
You would basically want to write an algorithm that iterates through the sequences a..z,aa...az, ba...bz, ..., za...zz, aaa...aaz, aba...abz, ..., aza,...,azz, baa...baz and so on. It's a lot of smartness to put in a build scripts, particularly if we don't really need the tags.
Maybe just a timestamp suffix would be enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does github support numbers in suffixes ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Git and GitHub don't have a concept of suffix, it's just some characters in the tag name; and yes, they do support numbers as characters in tag names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would'nt have this problem if the v4963r3 part of the tags were sure to be updated before 26 commits,
What mechanism updates this part or the tag ?

} else {
suffix = String.fromCharCode(suffix.charCodeAt(0) + 1);
}
}
}
}
]]>
</script>
<fail message="Unable to determine new tag">
Expand Down
Loading