Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong symlink location #153

Merged
merged 2 commits into from
Feb 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ trait GenericPackageSettings
if !file.isDirectory
if name startsWith "bin/"
if !(name endsWith ".bat") // IGNORE windows-y things.
} yield LinuxSymlink("/usr/" + name, installLocation.stripPrefix("/usr/")+"/"+pkg+"/"+name)
} yield LinuxSymlink("/usr/" + name, installLocation+"/"+pkg+"/"+name)
},
// Map configuration files
linuxPackageSymlinks <++= (normalizedName in Universal, mappings in Universal, defaultLinuxInstallLocation) map { (pkg, mappings, installLocation) =>
Expand Down
10 changes: 10 additions & 0 deletions src/sbt-test/debian/upstart-deb/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@ TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) =
()
}

InputKey[Unit]("check-softlink") <<= inputTask { (argTask: TaskKey[Seq[String]]) =>
(argTask) map { (args: Seq[String]) =>
assert(args.size >= 2, "Usage: check-softlink link to target")
val link = args(0)
val target = args(args.size - 1)
val absolutePath = ("readlink -m " + link).!!.trim
assert(link != absolutePath, "Expected symbolic link '" + link + "' does not exist")
assert(target == absolutePath, "Expected symbolic link '" + link + "' to point to '" + target + "', but instead it's '" + absolutePath + "'")
}
}
1 change: 1 addition & 0 deletions src/sbt-test/debian/upstart-deb/test
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ $ exists target/debian-test-0.1.0/DEBIAN/postinst

# Check files for defaults
> check-control-files
> check-softlink target/debian-test-0.1.0/usr/bin/debian-test points to /usr/share/debian-test/bin/debian-test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amusing. THe "points to" is redudantant, but a bit "iffy" in general :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, also if/when this is fixed to be a relative link, I can't get a feeling for whether the test will break....