+/* $Id$
+
+This file is part of builder
+Copyright © 2010 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
+#include <unistd.h>
+#include <msp/fs/utils.h>
+#include <msp/io/print.h>
+#include "builder.h"
+#include "package.h"
+#include "makesymlink.h"
+#include "symlink.h"
+
+using namespace Msp;
+
+MakeSymlink::MakeSymlink(Builder &b, const Symlink &sl):
+ Action(b)
+{
+ FS::Path relpath = FS::relative(sl.get_target().get_path(), FS::dirname(sl.get_path()));
+
+ announce(sl.get_package()->get_name(), "LN", sl.get_path().str());
+ if(builder.get_verbose()>=2)
+ IO::print("%s -> %s\n", sl.get_name(), relpath.str());
+
+ if(!builder.get_dry_run())
+ symlink(relpath.str().c_str(), sl.get_path().str().c_str());
+}
+
+int MakeSymlink::check()
+{
+ signal_done.emit();
+ return 0;
+}