[csw-devel] SF.net SVN: opencsw:[366] gar-wrapper/mgar
skayser at users.sourceforge.net
skayser at users.sourceforge.net
Thu Apr 7 00:10:16 CEST 2011
Revision: 366
http://opencsw.svn.sourceforge.net/opencsw/?rev=366&view=rev
Author: skayser
Date: 2011-04-06 22:10:16 +0000 (Wed, 06 Apr 2011)
Log Message:
-----------
mgar: add detection for obsolete gar/ directory (or symlink)
Modified Paths:
--------------
gar-wrapper/mgar
Modified: gar-wrapper/mgar
===================================================================
--- gar-wrapper/mgar 2011-03-30 16:34:58 UTC (rev 365)
+++ gar-wrapper/mgar 2011-04-06 22:10:16 UTC (rev 366)
@@ -161,6 +161,19 @@
in_pkg_dir || die_not_in_pkg_dir
}
+function die_conflicting_gar_dir_present {
+ cat >&2 <<EOM
+ERROR: There's an obsolete gar/ directory present in this pkg directory which
+fools with mgar's build system handling. Please delete this directory.
+EOM
+ exit 2
+}
+
+function assert_no_conflicting_gar_dir_present {
+ [ ! -d gar ] || die_conflicting_gar_dir_present
+ [ ! -h gar ] || die_conflicting_gar_dir_present
+}
+
# Is this a per-pkg command? Relies on *-cmd markers in the code (c.f. ##main)
function is_per_pkg_command {
local __cmd __global_cmds
@@ -412,6 +425,9 @@
[ $1 == "init" ] && { init_buildtree ${2-$DEF_BUILDTREE}; exit; }
[ $1 == "init-existing" ] && { convert_existing_buildtree ${2}; exit; }
+#assert_config_present # [ -f ~/.garrc ], have you initialized your buildtree?
+#assert_config_complete # check for SPKG_* + BUILDTREE, please complete info!
+
BUILDTREE="`read_config_value BUILDTREE`"; eval BUILDTREE="$BUILDTREE"
assert_multi_buildsys_tree "$BUILDTREE/.buildsys"
@@ -419,6 +435,7 @@
# actually in a pkg directory and that the pkg relevant GAR branch can be found
if is_per_pkg_command $1; then
assert_in_pkg_dir
+ assert_no_conflicting_gar_dir_present
BUILDSYS=`get_pkg_buildsysdir`
assert_buildsys_present "$BUILDSYS"
create_legacy_gar_link "$BUILDSYS"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list