aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rwxr-xr-xbuild_archive4
-rw-r--r--gendepslist2.cc26
-rw-r--r--rpmtools.spec6
4 files changed, 31 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 9fb16a9..3373df8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2000-03-26 Pixel <pixel@mandrakesoft.com>
+
+ * gendepslist2.cc: add ability to handle files (was only
+ hdlist.cz2's), and to output only the package dependencies for
+ some hdlist's/packages (use of "--")
+
+2000-03-25 Pixel <pixel@mandrakesoft.com>
+
+ * build_archive (main): fix for perl < 5.005
+
2000-03-10 François Pons <fpons@mandrakesoft.com>
* genhdlists: added to build multiple hdlist for each installation CD.
diff --git a/build_archive b/build_archive
index e2b21f2..b81eea5 100755
--- a/build_archive
+++ b/build_archive
@@ -103,7 +103,7 @@ sub main {
system "cat @filelist | $compress >tmp.z";
$siz1 = -s "tmp.z";
- $data{$_} = [ 'f', $off1, $siz1, $data{$_}[3], $data{$_}[4] ] foreach @filelist;
+ foreach (@filelist) { $data{$_} = [ 'f', $off1, $siz1, $data{$_}[3], $data{$_}[4] ] }
system "cat tmp.z >>$archivename";
$off1 += $siz1;
@@ -117,7 +117,7 @@ sub main {
system "cat @filelist | $compress >tmp.z";
$siz1 = -s "tmp.z";
- $data{$_} = [ 'f', $off1, $siz1, $data{$_}[3], $data{$_}[4] ] foreach @filelist;
+ foreach (@filelist) { $data{$_} = [ 'f', $off1, $siz1, $data{$_}[3], $data{$_}[4] ] }
system "cat tmp.z >>$archivename";
$off1 += $siz1;
diff --git a/gendepslist2.cc b/gendepslist2.cc
index dc5d840..9709991 100644
--- a/gendepslist2.cc
+++ b/gendepslist2.cc
@@ -149,7 +149,7 @@ map<string, string> name2fullname;
map<string, vector<string> > requires, frequires;
map<string, vector<string> > provided_by, fprovided_by;
-void getRequires(FD_t fd, int) {
+void getRequires(FD_t fd, int current_hdlist) {
set<string> all_requires, all_frequires;
Header header;
@@ -159,6 +159,12 @@ void getRequires(FD_t fd, int) {
string name = s_name + "-" + get_name(header, RPMTAG_VERSION) + "-" + get_name(header, RPMTAG_RELEASE);
vector<string> l = get_info(header, RPMTAG_REQUIRENAME);
+ packages.push_back(name);
+ name2fullname[s_name] = name;
+ hdlist2names[current_hdlist].insert(name);
+ sizes[name] = get_int(header, RPMTAG_SIZE);
+
+ if (in(s_name, provided_by)) provided_by[s_name].push_back(name);
for (ITv p = l.begin(); p != l.end(); p++) {
((*p)[0] == '/' ? frequires : requires)[name].push_back(*p);
((*p)[0] == '/' ? all_frequires : all_requires).insert(*p);
@@ -176,12 +182,6 @@ void getProvides(FD_t fd, int current_hdlist) {
string s_name = get_name(header, RPMTAG_NAME);
string name = s_name + "-" + get_name(header, RPMTAG_VERSION) + "-" + get_name(header, RPMTAG_RELEASE);
- packages.push_back(name);
- name2fullname[s_name] = name;
- hdlist2names[current_hdlist].insert(name);
- sizes[name] = get_int(header, RPMTAG_SIZE);
-
- if (in(s_name, provided_by)) provided_by[s_name].push_back(name);
vector<string> provides = get_info(header, RPMTAG_PROVIDES);
for (ITv p = provides.begin(); p != provides.end(); p++)
@@ -365,13 +365,15 @@ void printDepslist(ofstream *out1, ofstream *out2) {
}
}
-void hdlists(void (*f)(FD_t, int), const char *hdlist, int current_hdlist) {
- FILE *pipe = popen(((string) "bzip2 -d <" + hdlist + " 2>/dev/null").c_str(), "r");
+void hdlists(void (*f)(FD_t, int), const char *file, int current_hdlist) {
+ bool isfile = strlen(file) > 4 && strncmp(file + strlen(file) - 4, ".rpm", 4) == 0;
+ string cmd = isfile ? "rpm2header " : "bzip2 -d <";
+ FILE *pipe = popen((cmd + file + " 2>/dev/null").c_str(), "r");
f(fdDup(fileno(pipe)), current_hdlist);
if (fclose(pipe) != 0) {
- cerr << "bad hdlist " << hdlist << "\n";
+ cerr << "bad hdlist " << file << "\n";
exit(1);
}
}
@@ -393,10 +395,10 @@ int main(int argc, char **argv)
nb_hdlists = argc - 1;
- for (int i = 1; i < argc; i++) hdlists(getRequires, argv[i], i - 1);
+ for (int i = 1; i < argc; i++) if ((string)argv[i] == "--") break; else hdlists(getRequires, argv[i], i - 1);
cerr << "getRequires done\n";
- for (int i = 1; i < argc; i++) hdlists(getProvides, argv[i], i - 1);
+ for (int i = 1; i < argc; i++) if ((string)argv[i] == "--") continue; else hdlists(getProvides, argv[i], i - 1);
cerr << "getProvides done\n";
printDepslist(out1, out2);
diff --git a/rpmtools.spec b/rpmtools.spec
index 8e5ee09..0ca62b4 100644
--- a/rpmtools.spec
+++ b/rpmtools.spec
@@ -1,5 +1,5 @@
%define name rpmtools
-%define release 11mdk
+%define release 12mdk
# do not modify here, see Makefile in the CVS
%define version 1.1
@@ -56,6 +56,10 @@ rm -rf $RPM_BUILD_ROOT
/usr/bin/genhdlists
%changelog
+* Sun Mar 26 2000 Pixel <pixel@mandrakesoft.com> 1.1-12mdk
+- gendepslist2: add ability to handle files (was only hdlist.cz2's), and to
+output only the package dependencies for some hdlist's/packages (use of "--")
+
* Sat Mar 25 2000 Pixel <pixel@mandrakesoft.com> 1.1-11mdk
- new group