emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
blob 47d439be9d7883dc16d46377b6f1a7cf47107e43 1852 bytes (raw)
name: UTILITIES/set-version.pl 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
#!/usr/bin/perl
$version = $ARGV[0];

# if no further option is present then default to "all"
if (not $ARGV[1]) {
  $all = 1;
}

# parse option "--org.texi [<optional_file>]"
# (only simple parsing since no more than one option supported yet)
if ($ARGV[1] eq "--org.texi") {
  $org_texi_opt = 1;
  if ($ARGV[2]) {
    $org_texi_file = "$ARGV[2]";
  }
}

die "No version given" unless $version=~/\S/;
$date = `date "+%B %Y"`; chomp $date;
$year = `date "+%Y"` ; chomp $year;

print STDERR "Changing version to \"$version\" and date to \"$date\" in the following files:\n" ;

if ($all) {
  print STDERR join("\n",glob("lisp/*.el")),"\n";
  $cmd = qq{s/^(;; Version:)\\s+(\\S+)[ \t]*\$/\$1 $version/;s/^(\\(defconst org-version )"(\\S+)"/\$1"$version"/};
  $c1 = "perl -pi -e '$cmd' lisp/*.el";
  system($c1);
}

if ($all or $org_texi_opt) {
  if (not "$org_texi_file") {
    $org_texi_file = "doc/org.texi";
  }
  print STDERR "$org_texi_file\n";
  $cmd = qq{s/^(\\\@set VERSION)\\s+(\\S+)[ \t]*\$/\$1 $version/;s/^(\\\@set DATE)\\s+(.*)\$/\$1 $date/;};
  $c1 = "perl -pi -e '$cmd' '$org_texi_file'";
  system($c1);
}

if ($all) {
  print STDERR "doc/orgguide.texi\n";
  $cmd = qq{s/^(\\\@set VERSION)\\s+(\\S+)[ \t]*\$/\$1 $version/;s/^(\\\@set DATE)\\s+(.*)\$/\$1 $date/;};
  $c1 = "perl -pi -e '$cmd' doc/orgguide.texi";
  system($c1);
}

if ($all) {
  print STDERR "doc/orgcard.tex\n";
  $cmd = qq{s/^\\\\def\\\\orgversionnumber\\{\\S+\\}/\\\\def\\\\orgversionnumber{$version}/;s/\\\\def\\\\versionyear\\{\\S+\\}/\\\\def\\\\versionyear{$year}/;s/\\\\def\\\\year\\{\\S+\\}/\\\\def\\\\year{$year}/;};
  $c1 = "perl -pi -e '$cmd' doc/orgcard.tex";
  system($c1);
}

if ($all) {
  print STDERR "README_DIST\n";
  $cmd = qq{s/^(The version of this release is:)\\s+(\\S+)[ \t]*\$/\$1 $version/;};
  $c1 = "perl -pi -e '$cmd' README_DIST";
  system($c1);
}

debug log:

solving 47d439b ...
found 47d439b in https://yhetil.org/orgmode/BANLkTimg4xQsi6N5pY8DCrC9ufnq3=B_jQ@mail.gmail.com/ ||
	https://yhetil.org/orgmode/CALn3zog1LXMCY5nBu9vZy_3DyrEY4B5Gh3auW0A2yAiTqU=HxQ@mail.gmail.com/
found ed185ea in https://git.savannah.gnu.org/cgit/emacs/org-mode.git
preparing index
index prepared:
100755 ed185ea24e1f324758d7ff0826c19bce3bce8f3b	UTILITIES/set-version.pl

applying [1/1] https://yhetil.org/orgmode/BANLkTimg4xQsi6N5pY8DCrC9ufnq3=B_jQ@mail.gmail.com/
diff --git a/UTILITIES/set-version.pl b/UTILITIES/set-version.pl
index ed185ea..47d439b 100755

Checking patch UTILITIES/set-version.pl...
Applied patch UTILITIES/set-version.pl cleanly.

skipping https://yhetil.org/orgmode/CALn3zog1LXMCY5nBu9vZy_3DyrEY4B5Gh3auW0A2yAiTqU=HxQ@mail.gmail.com/ for 47d439b
index at:
100755 47d439be9d7883dc16d46377b6f1a7cf47107e43	UTILITIES/set-version.pl

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).