package_repo: Removes dependency to package
* Move StandardErrorOutput to libpackage and into proper namespace to avoid "package_repo" having to reuse the "package" source file. * package_repo: Fix incorrect includes of "package.h".
This commit is contained in:
parent
479ca8169c
commit
0816749e41
29
headers/os/package/hpkg/StandardErrorOutput.h
Normal file
29
headers/os/package/hpkg/StandardErrorOutput.h
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2009-2013, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _PACKAGE__HPKG__STANDARD_ERROR_OUTPUT_H_
|
||||
#define _PACKAGE__HPKG__STANDARD_ERROR_OUTPUT_H_
|
||||
|
||||
|
||||
#include <package/hpkg/ErrorOutput.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
namespace BHPKG {
|
||||
|
||||
|
||||
class BStandardErrorOutput : public BErrorOutput {
|
||||
public:
|
||||
virtual void PrintErrorVarArgs(const char* format,
|
||||
va_list args);
|
||||
};
|
||||
|
||||
|
||||
} // namespace BHPKG
|
||||
|
||||
} // namespace BPackageKit
|
||||
|
||||
|
||||
#endif // _PACKAGE__HPKG__STANDARD_ERROR_OUTPUT_H_
|
@ -11,7 +11,6 @@ BinCommand package :
|
||||
package.cpp
|
||||
PackageWriterListener.cpp
|
||||
PackageWritingUtils.cpp
|
||||
StandardErrorOutput.cpp
|
||||
|
||||
:
|
||||
package be
|
||||
|
@ -1,16 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include "StandardErrorOutput.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
void
|
||||
StandardErrorOutput::PrintErrorVarArgs(const char* format, va_list args)
|
||||
{
|
||||
vfprintf(stderr, format, args);
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef STANDARD_ERROR_OUTPUT_H
|
||||
#define STANDARD_ERROR_OUTPUT_H
|
||||
|
||||
|
||||
#include <package/hpkg/ErrorOutput.h>
|
||||
|
||||
|
||||
using BPackageKit::BHPKG::BErrorOutput;
|
||||
|
||||
|
||||
class StandardErrorOutput : public BErrorOutput {
|
||||
virtual void PrintErrorVarArgs(const char* format,
|
||||
va_list args);
|
||||
};
|
||||
|
||||
|
||||
#endif // STANDARD_ERROR_OUTPUT_H
|
@ -22,7 +22,6 @@
|
||||
#include "package.h"
|
||||
#include "PackageWriterListener.h"
|
||||
#include "PackageWritingUtils.h"
|
||||
#include "StandardErrorOutput.h"
|
||||
|
||||
|
||||
using namespace BPackageKit::BHPKG;
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "package.h"
|
||||
#include "PackageWriterListener.h"
|
||||
#include "PackageWritingUtils.h"
|
||||
#include "StandardErrorOutput.h"
|
||||
|
||||
|
||||
using BPackageKit::BHPKG::BPackageWriterListener;
|
||||
|
@ -17,9 +17,9 @@
|
||||
#include <package/hpkg/PackageEntry.h>
|
||||
#include <package/hpkg/PackageEntryAttribute.h>
|
||||
#include <package/hpkg/PackageReader.h>
|
||||
#include <package/hpkg/StandardErrorOutput.h>
|
||||
|
||||
#include "package.h"
|
||||
#include "StandardErrorOutput.h"
|
||||
|
||||
|
||||
using namespace BPackageKit::BHPKG;
|
||||
@ -182,7 +182,7 @@ command_dump(int argc, const char* const* argv)
|
||||
const char* packageFileName = argv[optind++];
|
||||
|
||||
// open package
|
||||
StandardErrorOutput errorOutput;
|
||||
BStandardErrorOutput errorOutput;
|
||||
BPackageReader packageReader(&errorOutput);
|
||||
status_t error = packageReader.Init(packageFileName);
|
||||
if (error != B_OK)
|
||||
|
@ -30,10 +30,10 @@
|
||||
#include <package/hpkg/PackageEntry.h>
|
||||
#include <package/hpkg/PackageEntryAttribute.h>
|
||||
#include <package/hpkg/PackageReader.h>
|
||||
#include <package/hpkg/StandardErrorOutput.h>
|
||||
#include <package/BlockBufferCacheNoLock.h>
|
||||
|
||||
#include "package.h"
|
||||
#include "StandardErrorOutput.h"
|
||||
|
||||
|
||||
using namespace BPackageKit::BHPKG;
|
||||
@ -688,7 +688,7 @@ command_extract(int argc, const char* const* argv)
|
||||
const char* packageFileName = argv[optind++];
|
||||
|
||||
// open package
|
||||
StandardErrorOutput errorOutput;
|
||||
BStandardErrorOutput errorOutput;
|
||||
BPackageReader packageReader(&errorOutput);
|
||||
status_t error = packageReader.Init(packageFileName);
|
||||
if (error != B_OK)
|
||||
|
@ -17,11 +17,11 @@
|
||||
#include <package/hpkg/PackageEntryAttribute.h>
|
||||
#include <package/hpkg/PackageInfoAttributeValue.h>
|
||||
#include <package/hpkg/PackageReader.h>
|
||||
#include <package/hpkg/StandardErrorOutput.h>
|
||||
|
||||
#include <package/PackageInfo.h>
|
||||
|
||||
#include "package.h"
|
||||
#include "StandardErrorOutput.h"
|
||||
|
||||
|
||||
using namespace BPackageKit::BHPKG;
|
||||
@ -320,7 +320,7 @@ command_list(int argc, const char* const* argv)
|
||||
const char* packageFileName = argv[optind++];
|
||||
|
||||
// open package
|
||||
StandardErrorOutput errorOutput;
|
||||
BStandardErrorOutput errorOutput;
|
||||
BPackageReader packageReader(&errorOutput);
|
||||
status_t error = packageReader.Init(packageFileName);
|
||||
if (error != B_OK)
|
||||
|
@ -5,13 +5,10 @@ UsePrivateHeaders kernel shared ;
|
||||
DEFINES += B_ENABLE_INCOMPLETE_POSIX_AT_SUPPORT ;
|
||||
# TODO: Remove when it is complete!
|
||||
|
||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src bin package ] ;
|
||||
|
||||
BinCommand package_repo :
|
||||
command_create.cpp
|
||||
command_list.cpp
|
||||
package_repo.cpp
|
||||
StandardErrorOutput.cpp
|
||||
:
|
||||
package be
|
||||
$(TARGET_LIBSUPC++)
|
||||
|
@ -19,8 +19,7 @@
|
||||
#include <package/PackageInfo.h>
|
||||
#include <package/RepositoryInfo.h>
|
||||
|
||||
#include "package.h"
|
||||
#include "StandardErrorOutput.h"
|
||||
#include "package_repo.h"
|
||||
|
||||
|
||||
using BPackageKit::BHPKG::BRepositoryWriterListener;
|
||||
|
@ -14,11 +14,11 @@
|
||||
#include <package/hpkg/PackageInfoAttributeValue.h>
|
||||
#include <package/hpkg/RepositoryContentHandler.h>
|
||||
#include <package/hpkg/RepositoryReader.h>
|
||||
#include <package/hpkg/StandardErrorOutput.h>
|
||||
#include <package/PackageInfo.h>
|
||||
#include <package/RepositoryInfo.h>
|
||||
|
||||
#include "package.h"
|
||||
#include "StandardErrorOutput.h"
|
||||
#include "package_repo.h"
|
||||
|
||||
|
||||
using namespace BPackageKit::BHPKG;
|
||||
@ -287,7 +287,7 @@ command_list(int argc, const char* const* argv)
|
||||
const char* repositoryFileName = argv[optind++];
|
||||
|
||||
// open repository
|
||||
StandardErrorOutput errorOutput;
|
||||
BStandardErrorOutput errorOutput;
|
||||
BRepositoryReader repositoryReader(&errorOutput);
|
||||
status_t error = repositoryReader.Init(repositoryFileName);
|
||||
if (error != B_OK)
|
||||
|
@ -71,6 +71,10 @@ SharedLibrary libpackage.so
|
||||
ValidateChecksumJob.cpp
|
||||
|
||||
$(HPKG_SOURCES)
|
||||
|
||||
# hpkg, but only libpackage
|
||||
StandardErrorOutput.cpp
|
||||
|
||||
:
|
||||
libshared.a be z $(TARGET_LIBSTDC++)
|
||||
;
|
||||
|
26
src/kits/package/hpkg/StandardErrorOutput.cpp
Normal file
26
src/kits/package/hpkg/StandardErrorOutput.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Copyright 2009-2013, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
|
||||
#include <package/hpkg/StandardErrorOutput.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
namespace BHPKG {
|
||||
|
||||
|
||||
void
|
||||
BStandardErrorOutput::PrintErrorVarArgs(const char* format, va_list args)
|
||||
{
|
||||
vfprintf(stderr, format, args);
|
||||
}
|
||||
|
||||
|
||||
} // namespace BHPKG
|
||||
|
||||
} // namespace BPackageKit
|
Loading…
x
Reference in New Issue
Block a user