Skip to content

Commit

Permalink
Revert "helper-cli: Add command to delete entries from postgres scan …
Browse files Browse the repository at this point in the history
…storage"

Remove the command to delete scan storage entries by reverting commit
64bf123 because the command is heavily outdated [1]. This prepares for an
Exposed update.

[1]: #8599 (comment)

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Apr 30, 2024
1 parent 16a8501 commit 974b002
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 229 deletions.
2 changes: 0 additions & 2 deletions helper-cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ dependencies {

implementation(libs.clikt)
implementation(libs.commonsCompress)
implementation(libs.exposed.core)
implementation(libs.hikari)
implementation(libs.jackson.module.kotlin)
implementation(libs.jslt)
implementation(libs.log4j.api)
Expand Down
2 changes: 0 additions & 2 deletions helper-cli/src/main/kotlin/HelperMain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import org.ossreviewtoolkit.helper.commands.packageconfig.PackageConfigurationCo
import org.ossreviewtoolkit.helper.commands.packagecuration.PackageCurationsCommand
import org.ossreviewtoolkit.helper.commands.provenancestorage.ProvenanceStorageCommand
import org.ossreviewtoolkit.helper.commands.repoconfig.RepositoryConfigurationCommand
import org.ossreviewtoolkit.helper.commands.scanstorage.ScanStorageCommand
import org.ossreviewtoolkit.helper.utils.ORTH_NAME
import org.ossreviewtoolkit.utils.common.Os
import org.ossreviewtoolkit.utils.ort.printStackTrace
Expand Down Expand Up @@ -100,7 +99,6 @@ internal class HelperMain : CliktCommand(
PackageCurationsCommand(),
ProvenanceStorageCommand(),
RepositoryConfigurationCommand(),
ScanStorageCommand(),
SetDependencyRepresentationCommand(),
SetLabelsCommand(),
TransformResultCommand(),
Expand Down
175 changes: 0 additions & 175 deletions helper-cli/src/main/kotlin/commands/scanstorage/DeleteCommand.kt

This file was deleted.

This file was deleted.

17 changes: 0 additions & 17 deletions helper-cli/src/main/kotlin/utils/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator

import java.io.File
import java.nio.file.Paths
import java.sql.ResultSet

import kotlin.io.path.createTempDirectory

import org.jetbrains.exposed.sql.transactions.TransactionManager

import org.ossreviewtoolkit.analyzer.PackageManagerFactory
import org.ossreviewtoolkit.downloader.Downloader
import org.ossreviewtoolkit.model.ArtifactProvenance
Expand Down Expand Up @@ -294,20 +291,6 @@ internal fun String.wrapAt(column: Int): String =
}
}.trimEnd()

/**
* Execute the raw SQL statement and map it using [transform].
*/
internal fun <T : Any> String.execAndMap(transform: (ResultSet) -> T): List<T> {
val result = mutableListOf<T>()
TransactionManager.current().exec(this) { resultSet ->
while (resultSet.next()) {
result += transform(resultSet)
}
}

return result
}

/**
* Return a copy of this [OrtResult] with the [Repository.config] with the content of the given
* [repositoryConfigurationFile].
Expand Down

0 comments on commit 974b002

Please sign in to comment.