diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-03-26 17:24:17 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-03-26 17:24:17 +0000 |
commit | 3dc656d58b4359dc8c54069d83ee52582c3fccde (patch) | |
tree | 1511bc563b44c3c10a4a15f783cba62bc39753dc | |
parent | 3c1ffd559e4ce1dbc71b4e6f3ef3975ea2fc5a31 (diff) | |
download | rpmtools-3dc656d58b4359dc8c54069d83ee52582c3fccde.tar rpmtools-3dc656d58b4359dc8c54069d83ee52582c3fccde.tar.gz rpmtools-3dc656d58b4359dc8c54069d83ee52582c3fccde.tar.bz2 rpmtools-3dc656d58b4359dc8c54069d83ee52582c3fccde.tar.xz rpmtools-3dc656d58b4359dc8c54069d83ee52582c3fccde.zip |
no_comment
-rw-r--r-- | ChangeLog | 10 | ||||
-rwxr-xr-x | build_archive | 4 | ||||
-rw-r--r-- | gendepslist2.cc | 26 | ||||
-rw-r--r-- | rpmtools.spec | 6 |
4 files changed, 31 insertions, 15 deletions
@@ -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 |