X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fparserpmdump.c;fp=src%2Fparserpmdump.c;h=58a76085aec437f25f55da6634732589ddef8927;hb=9c78378bebc1a9f3d400f422df8ede9efea57dea;hp=0000000000000000000000000000000000000000;hpb=faa778968d1a7dfeaebc9fe4b847e691dc62fd15;p=util-vserver.git diff --git a/src/parserpmdump.c b/src/parserpmdump.c new file mode 100644 index 0000000..58a7608 --- /dev/null +++ b/src/parserpmdump.c @@ -0,0 +1,71 @@ +// $Id$ + +// Copyright (C) 2003 Enrico Scholz +// based on parserpmdump.cc by Jacques Gelinas +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2, or (at your option) +// any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/* + Litte utility to extract non config file from + an rpm --dump command. +*/ +#include +#include +#include +#include +#include + + +int main (int argc, char *argv[]) +{ + int *tblen = alloca(argc * sizeof(int)); + int i; + char tmp[1000]; + + for (i=1; i= 0 && tmp[last] == '\n') tmp[last] = '\0'; + + for (i=0; i<8; i++){ + char *pt = start; + while (*pt > ' ') pt++; + if (*pt == ' ') *pt++ = '\0'; + if (i == 4){ + sscanf(start,"%o",&mode); + }else if (i==7){ + type = atoi(start); + } + start = pt; + + } + if (S_ISREG(mode) && type == 0) printf ("%s\n",tmp); + } + } + return 0; +} +