Subversion Repositories RiscPkg-GenControl.old

Compare Revisions

Ignore whitespace Rev 17 → Rev 18

/branches/0.1.0/RiscPkg/Control
New file
0,0 → 1,11
Source: RiscPkg-GenControl
Section: Programming
Priority: Standard
Licence: Free
Maintainer: Graham Shaw <gdshaw@riscpkg.org>
Standards-Version: 0.0.0
Version: 0.1.0
Build-Depends: LibPkg
Description: A tool for generating RiscPkg binary control files.
 
Package: RiscPkg-GenControl
Property changes:
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/RiscPkg/RiscPkg-GenControl.inc
New file
0,0 → 1,9
RiscPkg.*
SysVars.*
Apps.Programming.!RiscPkg-GenControl.!Boot
Apps.Programming.!RiscPkg-GenControl.!Help
Apps.Programming.!RiscPkg-GenControl.!Run
Apps.Programming.!RiscPkg-GenControl.Copyright
Apps.Programming.!RiscPkg-GenControl.History
Apps.Programming.!RiscPkg-GenControl.README
Apps.Programming.!RiscPkg-GenControl.riscpkg-gencontrol
Property changes:
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/RiscPkg/Copyright
New file
0,0 → 1,10
This is the RISC OS Packaging Project distribution of RiscPkg-GenControl.
 
RiscPkg-GenControl was written by Graham Shaw <gdshaw@riscpkg.org>.
 
The package metadata and build script have been incorporated into the
upstream sources.
 
Distribution and use are subject to the GNU General Public License,
a copy of which may be found in the file "<CommonLicences$Dir>.GPL-2"
or at the URL "http://www.riscpkg.org/licences/GPL-2.txt".
Property changes:
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/RiscPkg/Rules
New file
0,0 → 1,20
PKGNAME = RiscPkg-GenControl
VERSION = 0/0/0
 
pkg:
CDir Temp
Wipe Temp ~CFR~V
CDir Temp
CDir Temp.RiscPkg
Copy RiscPkg.Copyright Temp.RiscPkg.Copyright ~CF~V
CDir Temp.Apps
CDir Temp.Apps.Programming
Copy !RiscPkg-GenControl Temp.Apps.Programming.!RiscPkg-GenControl ~CFR~V
Access Temp.Apps.Programming.!RiscPkg-GenControl.* LR/R
Copy SysVars Temp.SysVars ~CFR~V
 
Dir Temp
riscpkg-gencontrol $(PKGNAME) < ../RiscPkg/Control > RiscPkg/Control
zip -r ^.$(PKGNAME)_$(VERSION) * -i@^.RiscPkg.$(PKGNAME)/inc -x *.CVS.*
Dir ^
Wipe Temp ~CFR~V
Property changes:
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/SysVars/Alias=24riscpkg-gencontrol
New file
0,0 → 1,0
<Packages$Apps>.Programming.!RiscPkg-GenControl.riscpkg-gencontrol %*0
Property changes:
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/!RiscPkg-GenControl/History
New file
0,0 → 1,13
# This file is part of RiscPkg-GenControl.
# Copyright © 2004-2010 Graham Shaw.
# Distribution and use are subject to the GNU General Public License,
# a copy of which may be found in the file "<CommonLicences$Dir>.GPL-2"
# or at the URL "http://www.riscpkg.org/licences/GPL-2.txt".
 
Version 0.1.0 (14 Jun 2010)
 
Created exclusion list, initially for Build-Depends field.
 
Version 0.0.0 (06 Feb 2004)
 
Initial revision.
Property changes:
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/!RiscPkg-GenControl/!Help,feb
New file
0,0 → 1,7
| This file is part of RiscPkg-GenControl.
| Copyright © 2004 Graham Shaw.
| Distribution and use are subject to the GNU General Public License,
| a copy of which may be found in the file "<CommonLicences$Dir>.GPL-2"
| or at the URL "http://www.riscpkg.org/licences/GPL-2.txt".
 
Filer_Run <Obey$Dir>.README
Property changes:
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/!RiscPkg-GenControl/Rules.make
New file
0,0 → 1,25
# This file is part of RiscPkg-GenControl.
# Copyright © 2004 Graham Shaw.
# Distribution and use are subject to the GNU General Public License,
# a copy of which may be found in the file "<CommonLicences$Dir>.GPL-2"
# or at the URL "http://www.riscpkg.org/licences/GPL-2.txt".
 
CXX = gcc
LD = gcc
FIXDEPS = fixdeps
 
CPPFLAGS = -Ilibpkg:
CXXFLAGS = -mthrowback -munixlib -mpoke-function-name -Wall -W -Wno-unused -O2
 
.SUFFIXES: .o .cc .d .dd
 
.cc.o:
$(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
 
.cc.dd:
$(CXX) -MM $(CPPFLAGS) $< > $@
 
.dd.d:
$(FIXDEPS) $* < $< > $@
 
.DELETE_ON_ERROR:
Property changes:
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/!RiscPkg-GenControl/main.cc
New file
0,0 → 1,78
// This file is part of RiscPkg-GenControl.
// Copyright © 2004-2010 Graham Shaw.
// Distribution and use are subject to the GNU General Public License,
// a copy of which may be found in the file "<CommonLicences$Dir>.GPL-2"
// or at the URL "http://www.riscpkg.org/licences/GPL-2.txt".
 
#include <map>
#include <set>
#include <string>
#include <iostream>
 
#include "libpkg/binary_control.h"
 
using std::exception;
using std::map;
using std::string;
using std::cin;
using std::cout;
using std::cerr;
using std::endl;
using std::ws;
using pkg::binary_control;
 
int main(int argc,const char* argv[])
{
// Parse argument list.
if (argc!=2)
{
cerr << "Usage: riscpkg-gencontrol pkgname" << endl;
return 0;
}
string pkgname(argv[1]);
 
try
{
std::set<std::string> exclude;
exclude.insert("Build-Depends");
 
// Read source control record from cin.
binary_control ctrlbase;
cin >> ctrlbase;
cin >> ws;
 
// Create table of binary control records indexed by package name.
map<string,binary_control> ctrltable;
while (cin)
{
// Read binary control record from cin.
binary_control ctrl;
cin >> ctrl;
 
// Merge source and binary control records.
for (binary_control::const_iterator i=ctrlbase.begin();
i!=ctrlbase.end();++i)
{
string key=(*i).first;
string value=(*i).second;
if ((ctrl.find(key)==ctrl.end())&&
(exclude.find(key)==exclude.end()))
ctrl[key]=value;
}
 
// Store record in table.
ctrltable[ctrl.pkgname()]=ctrl;
 
cin >> ws;
}
 
// Select record from table and write to cout.
cout << ctrltable[pkgname];
}
catch (const exception& ex)
{
cout << "Exception: " << ex.what() << endl;
}
 
return 0;
}
Property changes:
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/!RiscPkg-GenControl/!Boot,feb
New file
0,0 → 1,7
| This file is part of RiscPkg-GenControl.
| Copyright © 2004 Graham Shaw.
| Distribution and use are subject to the GNU General Public License,
| a copy of which may be found in the file "<CommonLicences$Dir>.GPL-2"
| or at the URL "http://www.riscpkg.org/licences/GPL-2.txt".
 
If "<Alias$riscpkg-gencontrol>"="" Then Set Alias$riscpkg-gencontrol <Obey$Dir>.riscpkg-gencontrol %*0
Property changes:
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/!RiscPkg-GenControl/Makefile
New file
0,0 → 1,19
# This file is part of RiscPkg-GenControl.
# Copyright © 2004 Graham Shaw.
# Distribution and use are subject to the GNU General Public License,
# a copy of which may be found in the file "<CommonLicences$Dir>.GPL-2"
# or at the URL "http://www.riscpkg.org/licences/GPL-2.txt".
 
include Rules.make
 
OBJ = main.o
 
LIB = -lstdc++ \
-llibpkg:a.libpkg
 
all: riscpkg-gencontrol
 
riscpkg-gencontrol: $(OBJ)
$(LD) -o riscpkg-gencontrol $(OBJ) $(LIB)
 
include $(OBJ:.o=.d)
Property changes:
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/!RiscPkg-GenControl/README
New file
0,0 → 1,68
# This file is part of RiscPkg-GenControl.
# Copyright © 2004-2010 Graham Shaw.
# Distribution and use are subject to the GNU General Public License,
# a copy of which may be found in the file "<CommonLicences$Dir>.GPL-2"
# or at the URL "http://www.riscpkg.org/licences/GPL-2.txt".
 
-----------------------------------------------------------------------
RiscPkg-GenControl
 
Version 0.1.0 (14 Jun 2010)
-----------------------------------------------------------------------
 
Purpose
 
RiscPkg-GenControl is a tool for generating a RiscPkg binary control
files from a source control file.
It is most likely to be used from within a package build script, but
can be executed directly if required.
 
Use
 
Specify the required binary package name on the command line then pipe
the source control file into stdin. Collect the resulting binary
control file from stdout. For example, for the binary package Foo:
 
riscpkg-gencontrol Foo < Source/Control > Binary/Control
 
There must be a binary control record with the specified package name in
the source control file. The source and binary control records are
merged. Fields in the binary control record take precedence over fields
in the source control record. Fields are output in canonical order.
 
For example, given the source control record:
 
Source: FooBar
Section: Programming
Priority: Optional
Version: 1.2.3-0
 
Package: Foo
Version: 2.3.4-0
 
Package: Bar
Priority: Extra
 
the binary control record for the package Foo would be:
 
Package: Foo
Section: Programming
Priority: Optional
Source: FooBar
Version: 2.3.4-0
 
and for Bar:
 
Package: Bar
Section: Programming
Priority: Extra
Source: FooBar
Version: 1.2.3-0
 
Note how Foo has a different version from the source package, whereas
Bar has a different priority.
 
RiscPkg-GenControl is linked against UnixLib, therefore the usual UnixLib
features are available (including indirection and use of '/' as a path
separator).
Property changes:
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
/branches/0.1.0/!RiscPkg-GenControl/!Run,feb
New file
0,0 → 1,7
| This file is part of RiscPkg-GenControl.
| Copyright © 2004 Graham Shaw.
| Distribution and use are subject to the GNU General Public License,
| a copy of which may be found in the file "<CommonLicences$Dir>.GPL-2"
| or at the URL "http://www.riscpkg.org/licences/GPL-2.txt".
 
Set Alias$riscpkg-gencontrol <Obey$Dir>.riscpkg-gencontrol %*0
Property changes:
Added: svn:executable
+ *
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native