Hi Paolo,

$ gst-package --test package.xml

fails if the package is just being installed. This is because PackageDirectories>>#refreshStarList: is never called. My patch is to flush the PackageLoader state, and then refresh, I am not sure if I break something in regard to svn/git/http packages.

holger
>From 64bc97770bed8015ceaddf9db2d5d331824dc15e Mon Sep 17 00:00:00 2001
From: Holger Hans Peter Freyther <[email protected]>
Date: Thu, 2 Feb 2012 17:41:31 +0100
Subject: [PATCH] package: Scan for new star files after the installation

When installing a new package and trying to run the tests
a PackageNotAvailable exception will be signaled. This is because
the PackageLoader not searchig for new star files. Use the
PackageLoader>>#flush to reset the loadedDate (and root) to force
a full rescan of available packages.
---
 ChangeLog          |    4 ++++
 scripts/Package.st |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5ef795a..1cfa5c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-02-02  Holger Hans Peter Freyther  <[email protected]>
+
+	* scripts/Package.st: Scan for new *.star files.
+
 2011-09-25  Holger Hans Peter Freyther  <[email protected]>
 
 	* kernel/File.st: Add a <category: 'text'> to the class.
diff --git a/scripts/Package.st b/scripts/Package.st
index 009755c..af52f61 100644
--- a/scripts/Package.st
+++ b/scripts/Package.st
@@ -687,6 +687,9 @@ PackageCommand subclass: PkgInstall [
 	[ super run ] ensure: [
 	    tmpDir isNil ifFalse: [ tmpDir all remove ] ].
 
+	PackageLoader
+            flush;
+            refresh.
 	(Command dryRun not and: [ self isOption: 'load' ])
 	    ifTrue: [ ^self loadPackages ].
 
-- 
1.7.9

_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to