Skip to content

Commit

Permalink
Revert "V.1.1 This is a fix for #812 "
Browse files Browse the repository at this point in the history
  • Loading branch information
muuki88 authored Jul 2, 2016
1 parent ff11088 commit 7977c3d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ object JavaServerAppPackaging extends AutoPlugin {
val rpmScripts = Option(scriptDirectory.listFiles) getOrElse Array.empty

// remove all non files and already processed templates
rpmScripts.filter(s => s.isFile && !predefined.contains(s.getName)).foldLeft(predefinedScripts) {
rpmScripts.diff(predefined).filter(_.isFile).foldLeft(predefinedScripts) {
case (scripts, scriptlet) =>
val script = scriptlet.getName
val existingContent = scripts.getOrElse(script, Nil)
Expand Down
15 changes: 0 additions & 15 deletions src/sbt-test/rpm/scriptlets-override-rpm/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,3 @@ TaskKey[Unit]("check-spec-file") <<= (target, streams) map { (target, out) =>
()
}

def countSubstring(str: String, substr: String): Int =
substr.r.findAllMatchIn(str).length

def isUnique(str: String, searchstr: String): Boolean =
countSubstring(str, searchstr) == 1

TaskKey[Unit]("unique-scripts-in-spec-file") <<= (target, streams) map { (target, out) =>
val spec = IO.read(target / "rpm" / "SPECS" / "rpm-test.spec")
assert( isUnique(spec, "echo postinst"), "'echo 'postinst' not unique in \n" + spec)
assert( isUnique(spec, "echo preinst"), "'echo 'preinst' not unique in \n" + spec)
assert( isUnique(spec, "echo postun"), "'echo 'postun' not unique in \n" + spec)
assert( isUnique(spec, "echo preun"), "'echo 'preun' not unique in \n" + spec)
()
}

1 change: 0 additions & 1 deletion src/sbt-test/rpm/scriptlets-override-rpm/test
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ $ exists var/run/rpm-test
> set NativePackagerKeys.rpmBrpJavaRepackJars := true
> check-spec-file

> unique-scripts-in-spec-file
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.1.2"
version in ThisBuild := "1.1.1"

0 comments on commit 7977c3d

Please sign in to comment.