︙ | | |
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
+
+
+
+
+
+
+
+
+
+
+
|
#
variable fossilInfoCommand; # DEFAULT: fossil info ...
if {![info exists fossilInfoCommand]} then {
set fossilInfoCommand {fossil info --chdir {${directory}}}
}
#
# NOTE: The regular expression pattern used when attempting to extract
# the current check-in identifier for the Fossil checkout.
#
variable fossilInfoCheckoutPattern; # DEFAULT: {^checkout:\s+... UTC$}
if {![info exists fossilInfoCheckoutPattern]} then {
set fossilInfoCheckoutPattern \
{^checkout:\s+([0-9a-f]{40}) \d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} UTC$}
}
#
# NOTE: The regular expression pattern used when attempting to extract
# the root directory for the Fossil checkout.
#
variable fossilInfoLocalRootPattern; # DEFAULT: {^local-root:\s+(.*?)$}
if {![info exists fossilInfoLocalRootPattern]} then {
|
︙ | | |
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
|
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
|
return $result
} else {
error [appendArgs \
"failed to submit package metadata: " $data]
}
}
#
# NOTE: This procedure attempts to query the identifier of the Fossil
# checkout. There are no arguments. An empty string is returned if
# the information cannot be determined.
#
proc getCheckoutId {} {
variable fossilInfoCommand
variable fossilInfoCheckoutPattern
variable scriptDirectory
fossilMustBeInstalled
if {[isEagle]} then {
set directory [::PackageRepository::formatExecArgument \
$scriptDirectory]
if {[catch {
eval exec -nocarriagereturns -stdout output -stderr error \
[subst $fossilInfoCommand]
} result] == 0} then {
set result [appendArgs $output $error]
} else {
return ""
}
} else {
set directory $scriptDirectory
if {[catch {
eval exec [subst $fossilInfoCommand]
} result]} then {
return ""
}
}
if {![info exists result] || ![regexp -line -- \
$fossilInfoCheckoutPattern $result dummy match]} then {
return ""
}
return [string trim $match]
}
#
# NOTE: This procedure attempts to query the root directory of the Fossil
# checkout. There are no arguments. An empty string is returned if
# the root directory of the Fossil checkout cannot be determined.
# the information cannot be determined.
#
proc getCheckoutDirectory {} {
variable fossilInfoCommand
variable fossilInfoLocalRootPattern
variable scriptDirectory
fossilMustBeInstalled
|
︙ | | |
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
|
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
|
-
+
-
+
|
eval exec [subst $fossilInfoCommand]
} result]} then {
return ""
}
}
if {![info exists result] || ![regexp -line -- \
$fossilInfoLocalRootPattern $result dummy directory]} then {
$fossilInfoLocalRootPattern $result dummy match]} then {
return ""
}
return [string trim $directory]
return [string trim $match]
}
#
# NOTE: This procedure builds a native path using the specified parts and
# returns it. All arguments are considered to be parts of the path.
#
proc joinPath { args } {
|
︙ | | |
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
|
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
|
-
+
|
fossilMustBeInstalled
verifyCheckoutDirectory
set branch [appendArgs pkg_ $package _ $patchLevel]
set comment [appendArgs \
"Add package " $package " v" $patchLevel " for " $language \
" v" $version .]
" v" $version " using client \[" [getCheckoutId] \].]
if {[isEagle]} then {
set directory [::PackageRepository::formatExecArgument \
$checkoutDirectory]
set branch [::PackageRepository::formatExecArgument $branch]
set comment [::PackageRepository::formatExecArgument $comment]
|
︙ | | |