Skip to content

Commit

Permalink
Merge pull request #153 from sbt/wip/wrong-symlink-location
Browse files Browse the repository at this point in the history
Wrong symlink location
  • Loading branch information
jsuereth committed Feb 4, 2014
2 parents 6d95423 + fba8a2c commit 1970748
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
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

0 comments on commit 1970748

Please sign in to comment.