Changeset 2715

Show
Ignore:
Timestamp:
06/05/07 16:52:44 (1 year ago)
Author:
tg
Message:

• 1.0 -> scripts/param.h, paxmirabilis: MFC the new version from trunk
• both 1.0 and trunk: implement “make targz”, “make tarbz2”

(I like the gzip(1)d versions better though)

• 1.0 -> package/config/Makefile: quieten the “clean” target to be consistent

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/freewrt_1_0

    • Property svn:ignore changed from
      .config*
      .prereq_done
      .tmpconfig.h
      bin
      build_*
      dl
      lbin
      make.log
      root_fs*
      staging_dir_*
      toolchain_build_*
      tools_build
      to
      .config*
      .prereq_done
      .tmpconfig.h
      _pax*
      bin
      build_*
      dl
      freewrt.tar.bz2
      freewrt.tar.gz
      lbin
      make.log
      root_fs*
      staging_dir_*
      toolchain_build_*
      tools_build
  • branches/freewrt_1_0/Makefile

    r2383 r2715  
    3434        @echo '                 (default if .config exists)' 
    3535        @echo '  v            - Same as "all" but with logging to make.log enabled' 
     36        @echo '  targz|tarbz2 - Create a distribution tarball (runs distclean)' 
    3637 
    3738 
     
    5758        @${GMAKE_INV} distclean 
    5859        @-rm -rf lbin 
    59         @-rm -f make.log .prereq_done 
     60        @-rm -f make.log .prereq_done _pax* freewrt.tar.* 
    6061 
    6162image_clean: .prereq_done 
     
    162163        @touch $@ 
    163164 
    164 .PHONY: prereq prereq-noerror 
     165_tarball: .prereq_done 
     166        @rm -f _pax* 
     167        @${GMAKE_INV} tools/paxmirabilis-compile 
     168        @install -c -m 555 tools_build/paxmirabilis/pax _pax 
     169        @${GMAKE_INV} distclean 
     170        @-rm -rf lbin 
     171        @-rm -f make.log .prereq_done freewrt.tar.* 
     172        @find . | \ 
     173            grep -v -e '^\.$$' -e '^\./_pax' -e '/\.svn' | \ 
     174            sed -e 's^\./' | \ 
     175            sort >_pax.flst 
     176 
     177targz: _tarball 
     178        @./_pax -w -b 512 -d -M dist -P -t -v -x ustar <_pax.flst | \ 
     179            gzip -n9 >freewrt.tar.gz 
     180        @rm -f _pax* 
     181 
     182tarbgz2: _tarball 
     183        @./_pax -w -b 512 -d -M dist -P -t -v -x ustar <_pax.flst | \ 
     184            bzip2 --best >freewrt.tar.bz2 
     185        @rm -f _pax* 
     186 
     187.PHONY: prereq prereq-noerror _tarball targz tarbz2 
  • branches/freewrt_1_0/mk/build.mk

    r1625 r2715  
    140140        scripts/restore-defaultconf.sh $(RESTORE_PATTERNS) 
    141141 
    142 tools/install-lbin: 
    143         $(MAKE) -C tools install-lbin 
     142tools/%: 
     143        @$(MAKE) -C tools $(patsubst tools/%,%,$@) 
     144 
     145distclean: 
     146        @$(MAKE) -C $(CONFIG) clean 
     147        @rm -rf $(BUILD_DIR) $(BIN_DIR) $(DL_DIR) 
     148        @rm -rf $(TOOLS_BUILD_DIR) $(TOOLCHAIN_BUILD_DIR) $(STAGING_DIR) 
     149        @rm -rf $(STAMP_DIR) $(TOOLS_STAMP_DIR) $(TOOLCHAIN_STAMP_DIR) 
     150        @rm -rf staging_dir_ tools_build 
     151        @rm -f .config* .tmpconfig.h 
    144152 
    145153endif # ifeq ($(strip $(FWRT_HAVE_DOT_CONFIG)),y) 
  • branches/freewrt_1_0/package/config/Makefile

    r1089 r2715  
    114114 
    115115clean: 
    116         rm -f *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \ 
     116        @rm -f *.o *~ core $(TARGETS) $(MCONF_OBJS) $(CONF_OBJS) \ 
    117117                conf mconf zconf.tab.c zconf.tab.h lex.zconf.c lkc_defs.h 
  • branches/freewrt_1_0/scripts/param.h

    r223 r2715  
    11/* $FreeWRT$ */ 
     2 
     3/*- 
     4 * Copyright (c) 2007 
     5 *      Thorsten Glaser <tg@mirbsd.de> 
     6 * 
     7 * Provided that these terms and disclaimer and all copyright notices 
     8 * are retained or reproduced in an accompanying document, permission 
     9 * is granted to deal in this work without restriction, including un- 
     10 * limited rights to use, publicly perform, distribute, sell, modify, 
     11 * merge, give away, or sublicence. 
     12 * 
     13 * This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to 
     14 * the utmost extent permitted by applicable law, neither express nor 
     15 * implied; without malicious intent or gross negligence. In no event 
     16 * may a licensor, author or contributor be held liable for indirect, 
     17 * direct, other damage, loss, or other issues arising in any way out 
     18 * of dealing in the work, even if advised of the possibility of such 
     19 * damage or existence of a defect, except proven that it results out 
     20 * of said person's immediate fault when using the work as intended. 
     21 */ 
    222 
    323#include_next </usr/include/sys/param.h> 
     
    727#endif 
    828 
    9 #ifndef __SCCSID 
    10 #define __SCCSID(x)     static const char __sccsid[] __attribute__((used)) = (x) 
    11 #endif 
    12  
    13 #ifndef __RCSID 
    14 #define __RCSID(x)      static const char __rcsid[] __attribute__((used)) = (x) 
     29#if !defined(__RCSID) || !defined(__SCCSID) || !defined(__COPYRIGHT) 
     30#undef __IDSTRING 
     31#undef __IDSTRING_CONCAT 
     32#undef __IDSTRING_EXPAND 
     33#undef __COPYRIGHT 
     34#undef __RCSID 
     35#undef __SCCSID 
     36#define __IDSTRING_CONCAT(l,p)          __LINTED__ ## l ## _ ## p 
     37#define __IDSTRING_EXPAND(l,p)          __IDSTRING_CONCAT(l,p) 
     38#define __IDSTRING(prefix, string)                              \ 
     39        static const char __IDSTRING_EXPAND(__LINE__,prefix) [] \ 
     40            __attribute__((used)) = "@(""#)" #prefix ": " string 
     41#define __COPYRIGHT(x)  __IDSTRING(copyright,x) 
     42#define __RCSID(x)      __IDSTRING(rcsid,x) 
     43#define __SCCSID(x)     __IDSTRING(sccsid,x) 
    1544#endif 
    1645 
  • branches/freewrt_1_0/tools/paxmirabilis/Makefile

    r533 r2715  
    11# $FreeWRT$ 
     2#- 
     3# This file is part of the FreeWRT project. FreeWRT is copyrighted 
     4# material, please see the LICENCE file in the top-level directory 
     5# or at http://www.freewrt.org/licence for details. 
    26 
    37include $(TOPDIR)/rules.mk 
  • branches/freewrt_1_0/tools/paxmirabilis/src/Makefile

    r225 r2715  
    1 # $MirOS: src/bin/pax/Makefile,v 1.3 2006/07/16 17:55:17 tg Exp $ 
     1# $MirOS: src/bin/pax/Makefile,v 1.4 2006/08/18 18:21:36 tg Exp $ 
    22# $OpenBSD: Makefile,v 1.10 2001/05/26 00:32:20 millert Exp $ 
    33 
     
    2020LINKS=  ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio 
    2121 
    22 .if (${OStype} == "Interix") || (${OStype} == "Linux") 
     22.if (${MACHINE_OS} == "Interix") || (${MACHINE_OS} == "Linux") 
    2323CPPFLAGS+= -DLONG_OFF_T 
    2424.endif 
  • branches/freewrt_1_0/tools/paxmirabilis/src/ar_io.c

    r204 r2715  
    1 /**     $MirOS: src/bin/pax/ar_io.c,v 1.6 2006/06/23 23:03:55 tg Exp $ */ 
     1/**     $MirOS: src/bin/pax/ar_io.c,v 1.8 2007/02/17 04:52:39 tg Exp $ */ 
    22/*      $OpenBSD: ar_io.c,v 1.37 2005/08/04 10:02:44 mpf Exp $  */ 
    33/*      $NetBSD: ar_io.c,v 1.5 1996/03/26 23:54:13 mrg Exp $    */ 
     
    3636 */ 
    3737 
    38 #include <sys/types.h> 
     38#include <sys/param.h> 
    3939#include <sys/time.h> 
    4040#include <sys/stat.h> 
     
    4343#include <sys/mtio.h> 
    4444#endif 
    45 #include <sys/param.h> 
    4645#include <sys/wait.h> 
    4746#include <signal.h> 
     
    5857 
    5958__SCCSID("@(#)ar_io.c   8.2 (Berkeley) 4/18/94"); 
    60 __RCSID("$MirOS: src/bin/pax/ar_io.c,v 1.6 2006/06/23 23:03:55 tg Exp $"); 
     59__RCSID("$MirOS: src/bin/pax/ar_io.c,v 1.8 2007/02/17 04:52:39 tg Exp $"); 
    6160 
    6261/* 
     
    8281static int can_unlnk = 0;               /* do we unlink null archives?  */ 
    8382const char *arcname;                    /* printable name of archive */ 
     83static char *arcname_;                  /* this is so we can free(3) it */ 
    8484const char *gzip_program;               /* name of gzip program */ 
    8585static pid_t zpid = -1;                 /* pid of child process */ 
    8686int force_one_volume;                   /* 1 if we ignore volume changes */ 
    8787 
     88#ifndef __INTERIX 
    8889static int get_phys(void); 
     90#endif 
    8991extern sigset_t s_mask; 
    90 static void ar_start_gzip(int, const char *, int); 
     92static void ar_start_gzip(int, int); 
    9193 
    9294/* 
     
    125127                        syswarn(1, errno, "Failed open to read on %s", name); 
    126128                if (arfd != -1 && gzip_program != NULL) 
    127                         ar_start_gzip(arfd, gzip_program, 0); 
     129                        ar_start_gzip(arfd, 0); 
    128130                break; 
    129131        case ARCHIVE: 
     
    136138                        can_unlnk = 1; 
    137139                if (arfd != -1 && gzip_program != NULL) 
    138                         ar_start_gzip(arfd, gzip_program, 1); 
     140                        ar_start_gzip(arfd, 1); 
    139141                break; 
    140142        case APPND: 
     
    396398                (void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n", 
    397399#       else 
    398                 (void)fprintf(listf, "%s: unknown format, %qu bytes skipped.\n", 
     400                (void)fprintf(listf, "%s: unknown format, %llu bytes skipped.\n", 
    399401#       endif 
    400402                    argv0, rdcnt); 
     
    408410                (void)fprintf(listf, "%lu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120); 
    409411#       else 
    410                 (void)fprintf(listf, "%qu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120); 
     412                (void)fprintf(listf, "%llu blocks\n", (rdcnt ? rdcnt : wrcnt) / 5120); 
    411413#       endif 
    412414        else if (strcmp(NM_TAR, argv0) != 0) 
     
    415417                    "%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n", 
    416418#       else 
    417                     "%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n", 
     419                    "%s: %s vol %d, %lu files, %llu bytes read, %llu bytes written.\n", 
    418420#       endif 
    419421                    argv0, frmt->name, arvol-1, flcnt, rdcnt, wrcnt); 
     
    9981000} 
    9991001 
     1002#ifndef __INTERIX 
    10001003/* 
    10011004 * get_phys() 
     
    10121015get_phys(void) 
    10131016{ 
    1014 #ifndef __INTERIX 
    10151017        int padsz = 0; 
    10161018        int res; 
     
    11111113        } 
    11121114        return(phyblk); 
    1113 #else 
    1114         return 0; 
     1115
    11151116#endif 
    1116 } 
    11171117 
    11181118/* 
     
    12491249                if (ar_open(buf) >= 0) { 
    12501250                        if (freeit) { 
    1251                                 (void)free((char *)arcname); 
     1251                                free(arcname_); 
    12521252                                freeit = 0; 
    12531253                        } 
    1254                         if ((arcname = strdup(buf)) == NULL) { 
     1254                        if ((arcname = arcname_ = strdup(buf)) == NULL) { 
    12551255                                done = 1; 
    12561256                                lstrval = -1; 
     
    12731273 */ 
    12741274void 
    1275 ar_start_gzip(int fd, const char *gzip_program, int wr) 
     1275ar_start_gzip(int fd, int wr) 
    12761276{ 
    12771277        int fds[2]; 
     
    13041304                close(fds[0]); 
    13051305                close(fds[1]); 
    1306                 if (execlp(gzip_program, gzip_program, gzip_flags, (char *)NULL) < 0) 
     1306                if (execlp(gzip_program, gzip_program, gzip_flags, NULL) < 0) 
    13071307                        err(1, "could not exec"); 
    13081308                /* NOTREACHED */ 
  • branches/freewrt_1_0/tools/paxmirabilis/src/ar_subs.c

    r207 r2715  
    1 /**     $MirOS: src/bin/pax/ar_subs.c,v 1.4 2006/07/16 16:14:50 tg Exp $ */ 
     1/**     $MirOS: src/bin/pax/ar_subs.c,v 1.5 2007/02/17 04:52:39 tg Exp $ */ 
    22/*      $OpenBSD: ar_subs.c,v 1.29 2006/01/25 17:42:08 markus Exp $     */ 
    33/*      $NetBSD: ar_subs.c,v 1.5 1995/03/21 09:07:06 cgd Exp $  */ 
     
    5151 
    5252__SCCSID("@(#)ar_subs.c 8.2 (Berkeley) 4/18/94"); 
    53 __RCSID("$MirOS: src/bin/pax/ar_subs.c,v 1.4 2006/07/16 16:14:50 tg Exp $"); 
     53__RCSID("$MirOS: src/bin/pax/ar_subs.c,v 1.5 2007/02/17 04:52:39 tg Exp $"); 
    5454 
    5555static void wr_archive(ARCHD *, int is_app); 
     
    760760        int fddest; 
    761761        char *dest_pt; 
    762         int dlen; 
    763         int drem; 
     762        size_t dlen; 
     763        size_t drem; 
    764764        int fdsrc = -1; 
    765765        struct stat sb; 
  • branches/freewrt_1_0/tools/paxmirabilis/src/buf_subs.c

    r204 r2715  
    3535 */ 
    3636 
    37 #ifndef lint 
    38 #if 0 
    39 static const char sccsid[] = "@(#)buf_subs.c    8.2 (Berkeley) 4/18/94"; 
    40 #else 
    41 static const char rcsid[] = "$OpenBSD: buf_subs.c,v 1.21 2005/11/09 19:59:06 otto Exp $"; 
    42 #endif 
    43 #endif /* not lint */ 
    44  
    45 #include <sys/types.h> 
     37#include <sys/param.h> 
    4638#include <sys/time.h> 
    4739#include <sys/stat.h> 
    48 #include <sys/param.h> 
    4940#include <stdio.h> 
    5041#include <errno.h> 
     
    5445#include "pax.h" 
    5546#include "extern.h" 
     47 
     48__SCCSID("@(#)buf_subs.c        8.2 (Berkeley) 4/18/94"); 
     49__RCSID("$MirOS: src/bin/pax/buf_subs.c,v 1.2 2007/02/17 04:52:40 tg Exp $"); 
    5650 
    5751/* 
  • branches/freewrt_1_0/tools/paxmirabilis/src/cache.c

    r225 r2715  
    1 /**     $MirOS: src/bin/pax/cache.c,v 1.3 2006/07/16 17:55:18 tg Exp $ */ 
     1/**     $MirOS: src/bin/pax/cache.c,v 1.4 2007/02/17 04:52:40 tg Exp $ */ 
    22/*      $OpenBSD: cache.c,v 1.17 2004/03/16 03:28:34 tedu Exp $ */ 
    33/*      $NetBSD: cache.c,v 1.4 1995/03/21 09:07:10 cgd Exp $    */ 
     
    3636 */ 
    3737 
    38 #include <sys/types.h> 
     38#include <sys/param.h> 
    3939#include <sys/time.h> 
    4040#include <sys/stat.h> 
    41 #include <sys/param.h> 
    4241#include <string.h> 
    4342#include <stdio.h> 
     
    5150 
    5251__SCCSID("@(#)cache.c   8.1 (Berkeley) 5/31/93"); 
    53 __RCSID("$MirOS: src/bin/pax/cache.c,v 1.3 2006/07/16 17:55:18 tg Exp $"); 
     52__RCSID("$MirOS: src/bin/pax/cache.c,v 1.4 2007/02/17 04:52:40 tg Exp $"); 
    5453 
    5554/* 
     
    171170 */ 
    172171 
    173 char * 
     172const char * 
    174173name_uid(uid_t uid, int frc) 
    175174{ 
     
    239238 */ 
    240239 
    241 char * 
     240const char * 
    242241name_gid(gid_t gid, int frc) 
    243242{ 
     
    307306 
    308307int 
    309 uid_name(char *name, uid_t *uid) 
     308uid_name(const char *name, uid_t *uid) 
    310309{ 
    311310        struct passwd *pw; 
     
    372371 
    373372int 
    374 gid_name(char *name, gid_t *gid) 
     373gid_name(const char *name, gid_t *gid) 
    375374{ 
    376375        struct group *gr; 
  • branches/freewrt_1_0/tools/paxmirabilis/src/cpio.1

    r204 r2715  
    1 .\"     $MirOS: src/bin/pax/cpio.1,v 1.14 2006/06/23 23:16:55 tg Exp $ 
     1.\"     $MirOS: src/bin/pax/cpio.1,v 1.15 2006/07/21 17:34:59 tg Exp $ 
    22.\"     $OpenBSD: cpio.1,v 1.23 2006/01/03 17:22:47 jmc Exp $ 
    33.\" 
     
    2626.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    2727.\" 
    28 .Dd June 24, 2006 
     28.Dd July 21, 2006 
    2929.Dt CPIO 1 
    30 .Os 
     30.Os MirBSD 
     31.\" for portability 
     32.de Mx 
     33.nr cF \\n(.f 
     34.nr cZ \\n(.s 
     35.ds aa \&\f\\n(cF\s\\n(cZ 
     36.if \\n(aC==0 \{\ 
     37.       ie \\n(.$==0 \&MirOS\\*(aa 
     38.       el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 
     39.\} 
     40.if \\n(aC>\\n(aP \{\ 
     41.       nr aP \\n(aP+1 
     42.       ie \\n(C\\n(aP==2 \{\ 
     43.               as b1 \&MirOS\ #\&\\*(A\\n(aP\\*(aa 
     44.               ie \\n(aC>\\n(aP \{\ 
     45.                       nr aP \\n(aP+1 
     46.                       nR 
     47.               \} 
     48.               el .aZ 
     49.       \} 
     50.       el \{\ 
     51.               as b1 \&MirOS\\*(aa 
     52.               nR 
     53.       \} 
     54.\} 
     55.. 
    3156.Sh NAME 
    3257.Nm cpio 
     
    166191.Pp 
    167192This option is only implemented for the cpio, sv4cpio, 
    168 ustar, and sv4crc file format writing routines. 
     193sv4crc, and ustar file format writing routines. 
    169194For the ustar format, the 
    170195.Ar inodes 
     
    381406The 
    382407.Fl M 
    383 option is a MirOS extensions, available starting with 
     408option is a MirBSD extensions, available starting with 
    384409.Mx 8 . 
    385410Archives written using these options are, however, compatible to 
  • branches/freewrt_1_0/tools/paxmirabilis/src/cpio.c

    r204 r2715  
    1 /**     $MirOS: src/bin/pax/cpio.c,v 1.10 2006/06/19 19:22:08 tg Exp $ */ 
     1/**     $MirOS: src/bin/pax/cpio.c,v 1.12 2007/02/17 05:07:12 tg Exp $ */ 
    22/*      $OpenBSD: cpio.c,v 1.17 2004/04/16 22:50:23 deraadt Exp $       */ 
    33/*      $NetBSD: cpio.c,v 1.5 1995/03/21 09:07:13 cgd Exp $     */ 
     
    5050 
    5151__SCCSID("@(#)cpio.c    8.1 (Berkeley) 5/31/93"); 
    52 __RCSID("$MirOS: src/bin/pax/cpio.c,v 1.10 2006/06/19 19:22:08 tg Exp $"); 
     52__RCSID("$MirOS: src/bin/pax/cpio.c,v 1.12 2007/02/17 05:07:12 tg Exp $"); 
    5353 
    5454static int rd_nm(ARCHD *, int); 
     
    9090 
    9191int 
    92 cpio_trail(ARCHD *arcn, char *notused, int notused2, int *notused3) 
     92cpio_trail(ARCHD *arcn, char *notused __attribute__((unused)), 
     93    int notused2 __attribute__((unused)), 
     94    int *notused3 __attribute__((unused))) 
    9395{ 
    9496        /* 
     
    185187         * do not even try bogus values 
    186188         */ 
    187         if ((nsz == 0) || (nsz > sizeof(arcn->name))) { 
     189        if ((nsz == 0) || ((size_t)nsz > sizeof(arcn->name))) { 
    188190                paxwarn(1, "Cpio file name length %d is out of range", nsz); 
    189191                return(-1); 
     
    216218         */ 
    217219        if ((arcn->sb.st_size == 0) || 
    218             (arcn->sb.st_size >= sizeof(arcn->ln_name))) { 
     220            ((size_t)arcn->sb.st_size >= sizeof(arcn->ln_name))) { 
    219221#               ifdef LONG_OFF_T 
    220222                paxwarn(1, "Cpio link name length is invalid: %lu", 
    221223                    arcn->sb.st_size); 
    222224#               else 
    223                 paxwarn(1, "Cpio link name length is invalid: %qu", 
     225                paxwarn(1, "Cpio link name length is invalid: %llu", 
    224226                    arcn->sb.st_size); 
    225227#               endif 
     
    263265cpio_id(char *blk, int size) 
    264266{ 
    265         if ((size < sizeof(HD_CPIO)) || 
     267        if (((size_t)size < sizeof(HD_CPIO)) || 
    266268            (strncmp(blk, AMAGIC, sizeof(AMAGIC) - 1) != 0)) 
    267269                return(-1); 
     
    418420        t_gid   = (anonarch & ANON_UIDGID) ? 0UL : (u_long)arcn->sb.st_gid; 
    419421        t_mtime = (anonarch & ANON_MTIME) ? 0UL : (u_long)arcn->sb.st_mtime; 
    420         t_ino   = (anonarch & ANON_INODES) ? chk_flnk(arcn) : arcn->sb.st_ino; 
     422        t_ino   = (anonarch & ANON_INODES) ? (ino_t)chk_flnk(arcn) : 
     423            arcn->sb.st_ino; 
    421424        t_dev   = (anonarch & ANON_INODES) ? 0UL : (u_long)arcn->sb.st_dev; 
    422425        if (!cpio_trail(arcn, NULL, 0, NULL)) 
    423426                t_ino = 0UL; 
    424         if (t_ino == -1) { 
     427        if (t_ino == (ino_t)-1) { 
    425428                paxwarn(1, "Invalid inode number for file %s", arcn->org_name); 
    426429                return (1); 
     
    553556vcpio_id(char *blk, int size) 
    554557{ 
    555         if ((size < sizeof(HD_VCPIO)) || 
     558        if (((size_t)size < sizeof(HD_VCPIO)) || 
    556559            (strncmp(blk, AVMAGIC, sizeof(AVMAGIC) - 1) != 0)) 
    557560                return(-1); 
     
    570573crc_id(char *blk, int size) 
    571574{ 
    572         if ((size < sizeof(HD_VCPIO)) || 
     575        if (((size_t)size < sizeof(HD_VCPIO)) || 
    573576            (strncmp(blk, AVCMAGIC, sizeof(AVCMAGIC) - 1) != 0)) 
    574577                return(-1); 
     
    788791        t_gid   = (anonarch & ANON_UIDGID) ? 0UL : (u_long)arcn->sb.st_gid; 
    789792        t_mtime = (anonarch & ANON_MTIME) ? 0UL : (u_long)arcn->sb.st_mtime; 
    790         t_ino   = (anonarch & ANON_INODES) ? chk_flnk(arcn) : arcn->sb.st_ino; 
     793        t_ino   = (anonarch & ANON_INODES) ? (ino_t)chk_flnk(arcn) : 
     794            arcn->sb.st_ino; 
    791795        t_major = (anonarch & ANON_INODES) ? 0UL : (u_long)MAJOR(arcn->sb.st_dev); 
    792796        t_minor = (anonarch & ANON_INODES) ? 0UL : (u_long)MINOR(arcn->sb.st_dev); 
    793797        if (!cpio_trail(arcn, NULL, 0, NULL)) 
    794798                t_ino = 0UL; 
    795         if (t_ino == -1) { 
     799        if (t_ino == (ino_t)-1) { 
    796800                paxwarn(1, "Invalid inode number for file %s", arcn->org_name); 
    797801                return (1); 
     
    939943bcpio_id(char *blk, int size) 
    940944{ 
    941         if (size < sizeof(HD_BCPIO)) 
     945        if ((size_t)size < sizeof(HD_BCPIO)) 
    942946                return(-1); 
    943947 
  • branches/freewrt_1_0/tools/paxmirabilis/src/extern.h

    r2051 r2715  
    1 /**     $MirOS: src/bin/pax/extern.h,v 1.7 2006/07/16 17:56:29 tg Exp $ */ 
     1/**     $MirOS: src/bin/pax/extern.h,v 1.9 2007/02/17 04:52:40 tg Exp $ */ 
    22/*      $OpenBSD: extern.h,v 1.31 2005/04/28 06:58:07 otto Exp $        */ 
    33/*      $NetBSD: extern.h,v 1.5 1996/03/26 23:54:16 mrg Exp $   */ 
     
    4747#endif 
    4848 
    49 /* compatibility hack */ 
    50 #ifndef __GLIBC_PREREQ 
    51 #define __GLIBC_PREREQ(x,y) 0 
    52 #endif 
    53  
    5449/* 
    5550 * ar_io.c 
     
    114109int usrtb_start(void); 
    115110int grptb_start(void); 
    116 char * name_uid(uid_t, int); 
    117 char * name_gid(gid_t, int); 
    118 int uid_name(char *, uid_t *); 
    119 int gid_name(char *, gid_t *); 
     111const char *name_uid(uid_t, int); 
     112const char *name_gid(gid_t, int); 
     113int uid_name(const char *, uid_t *); 
     114int gid_name(const char *, gid_t *); 
    120115 
    121116/* 
     
    251246extern char *dirptr; 
    252247extern char *ltmfrmt; 
    253 extern char *argv0; 
     248extern const char *argv0; 
    254249extern FILE *listf; 
    255250extern char *tempfile; 
     
    257252 
    258253int main(int, char **); 
    259 void sig_cleanup(int); 
    260254 
    261255/* 
     
    289283void add_dir(char *, struct stat *, int); 
    290284void proc_dir(void); 
    291 u_int st_hash(char *, int, int); 
     285u_int st_hash(const char *, int, int); 
    292286int flnk_start(void); 
    293287int chk_flnk(ARCHD *); 
     
    314308 */ 
    315309int tty_init(void); 
    316 void tty_prnt(const char *, ...); 
     310void tty_prnt(const char *, ...) 
     311    __attribute__((format (printf, 1, 2))); 
    317312int tty_read(char *, int); 
    318 void paxwarn(int, const char *, ...); 
    319 void syswarn(int, int, const char *, ...); 
     313void paxwarn(int, const char *, ...) 
     314    __attribute__((format (printf, 2, 3))); 
     315void syswarn(int, int, const char *, ...) 
     316    __attribute__((format (printf, 3, 4))); 
  • branches/freewrt_1_0/tools/paxmirabilis/src/ftree.c

    r204 r2715  
    3535 */ 
    3636 
    37 #ifndef lint 
    38 #if 0 
    39 static const char sccsid[] = "@(#)ftree.c       8.2 (Berkeley) 4/18/94"; 
    40 #else 
    41 static const char rcsid[] = "$OpenBSD: ftree.c,v 1.26 2005/04/21 21:47:18 beck Exp $"; 
    42 #endif 
    43 #endif /* not lint */ 
    44  
    45 #include <sys/types.h> 
     37#include <sys/param.h> 
    4638#include <sys/time.h> 
    4739#include <sys/stat.h> 
    48 #include <sys/param.h> 
    4940#include <unistd.h> 
    5041#include <string.h> 
     
    5647#include "ftree.h" 
    5748#include "extern.h" 
     49 
     50__SCCSID("@(#)ftree.c   8.2 (Berkeley) 4/18/94"); 
     51__RCSID("$MirOS: src/bin/pax/ftree.c,v 1.2 2007/02/17 04:52:40 tg Exp $"); 
    5852 
    5953/* 
     
    495489         */ 
    496490        arcn->nlen = strlcpy(arcn->name, ftent->fts_path, sizeof(arcn->name)); 
    497         if (arcn->nlen >= sizeof(arcn->name)) 
     491        if ((size_t)arcn->nlen >= sizeof(arcn->name)) 
    498492                arcn->nlen = sizeof(arcn->name) - 1; /* XXX truncate? */ 
    499493        arcn->org_name = ftent->fts_path; 
  • branches/freewrt_1_0/tools/paxmirabilis/src/gen_subs.c

    r225 r2715  
    1 /**     $MirOS: src/bin/pax/gen_subs.c,v 1.6 2006/07/16 17:58:08 tg Exp $ */ 
     1/**     $MirOS: src/bin/pax/gen_subs.c,v 1.7 2007/02/17 04:52:40 tg Exp $ */ 
    22/*      $OpenBSD: gen_subs.c,v 1.18 2005/04/28 06:58:07 otto Exp $      */ 
    33/*      $NetBSD: gen_subs.c,v 1.5 1995/03/21 09:07:26 cgd Exp $ */ 
     
    3636 */ 
    3737 
    38 #include <sys/types.h> 
     38#include <sys/param.h> 
    3939#include <sys/time.h> 
    4040#include <sys/stat.h> 
    41 #include <sys/param.h> 
    4241#include <stdio.h> 
    4342#include <tzfile.h> 
     
    5756 
    5857__SCCSID("@(#)gen_subs.c        8.1 (Berkeley) 5/31/93"); 
    59 __RCSID("$MirOS: src/bin/pax/gen_subs.c,v 1.6 2006/07/16 17:58:08 tg Exp $"); 
     58__RCSID("$MirOS: src/bin/pax/gen_subs.c,v 1.7 2007/02/17 04:52:40 tg Exp $"); 
    6059 
    6160#ifdef __GLIBC__ 
     
    144143                (void)fprintf(fp, "%9lu ", sbp->st_size); 
    145144#               else 
    146                 (void)fprintf(fp, "%9qu ", sbp->st_size); 
     145                (void)fprintf(fp, "%9llu ", sbp->st_size); 
    147146#               endif 
    148147        } 
  • branches/freewrt_1_0/tools/paxmirabilis/src/getoldopt.c

    r204 r2715  
    1111 */ 
    1212 
    13 #ifndef lint 
    14 static const char rcsid[] = "$OpenBSD: getoldopt.c,v 1.8 2003/07/02 21:19:33 deraadt Exp $"; 
    15 #endif /* not lint */ 
    16  
    1713#include <sys/types.h> 
    1814#include <sys/stat.h> 
     
    2218#include "pax.h" 
    2319#include "extern.h" 
     20 
     21__RCSID("$MirOS: src/bin/pax/getoldopt.c,v 1.2 2007/02/17 04:52:40 tg Exp $"); 
    2422 
    2523int 
  • branches/freewrt_1_0/tools/paxmirabilis/src/options.c

    r225 r2715  
    1 /**     $MirOS: src/bin/pax/options.c,v 1.19 2006/07/16 17:58:39 tg Exp $ */ 
     1/**     $MirOS: src/bin/pax/options.c,v 1.24 2007/02/17 04:52:41 tg Exp $ */ 
    22/*      $OpenBSD: options.c,v 1.64 2006/04/09 03:35:34 jaredy Exp $     */ 
    33/*      $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $  */ 
    44 
    55/*- 
    6  * Copyright (c) 2005, 2006 Thorsten Glaser <tg@66h.42h.de> 
     6 * Copyright (c) 2005, 2006, 2007 Thorsten Glaser <tg@66h.42h.de> 
    77 * Copyright (c) 1992 Keith Muller. 
    88 * Copyright (c) 1992, 1993 
     
    5858 
    5959__SCCSID("@(#)options.c 8.2 (Berkeley) 4/18/94"); 
    60 __RCSID("$MirOS: src/bin/pax/options.c,v 1.19 2006/07/16 17:58:39 tg Exp $"); 
     60__RCSID("$MirOS: src/bin/pax/options.c,v 1.24 2007/02/17 04:52:41 tg Exp $"); 
    6161 
    6262#ifdef __GLIBC__ 
     
    7878static char *getline(FILE *fp); 
    7979static void pax_options(int, char **); 
    80 static void pax_usage(void); 
     80static void pax_usage(void) __attribute__((noreturn)); 
     81static void tar_set_action(int); 
    8182static void tar_options(int, char **); 
    82 static void tar_usage(void); 
     83static void tar_usage(void) __attribute__((noreturn)); 
     84static void cpio_set_action(int); 
    8385static void cpio_options(int, char **); 
    84 static void cpio_usage(void)
     86static void cpio_usage(void) __attribute__((noreturn))
    8587int mkpath(char *); 
    8688 
     
    214216{ 
    215217        int c; 
    216         int i; 
     218        size_t i; 
    217219        unsigned int flg = 0; 
    218220        unsigned int bflg = 0; 
     
    223225         * process option flags 
    224226         */ 
    225         while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLOPT:U:XYZ0")) 
     227        while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:zB:DE:G:HLM:OPT:U:XYZ0")) 
    226228            != -1) { 
    227229                switch (c) { 
     
    476478                        flg |= CLF; 
    477479                        break; 
     480                case 'M': 
     481                        /* 
     482                         * MirOS extension: archive normaliser 
     483                         */ 
     484                        process_M(optarg, pax_usage); 
     485                        break; 
    478486                case 'O': 
    479487                        /* 
     
    623631 
    624632static void 
     633tar_set_action(int op) 
     634{ 
     635        if (act != ERROR && act != op) 
     636                tar_usage(); 
     637        act = op; 
     638} 
     639 
     640static void 
    625641tar_options(int argc, char **argv) 
    626642{ 
     
    661677                         * create an archive 
    662678                         */ 
    663                         act = ARCHIVE
     679                        tar_set_action(ARCHIVE)
    664680                        break; 
    665681                case 'e': 
     
    721737                         * append to the archive 
    722738                         */ 
    723                         act = APPND
     739                        tar_set_action(APPND)
    724740                        break; 
    725741                case 'R': 
     
    744760                         * list contents of the tape 
    745761                         */ 
    746                         act = LIST
     762                        tar_set_action(LIST)
    747763                        break; 
    748764                case 'v': 
     
    763779                         * and mtime if possible. 
    764780                         */ 
    765                         act = EXTRACT
     781                        tar_set_action(EXTRACT)
    766782                        pmtime = 1; 
    767783                        break; 
     
    852868        argc -= optind; 
    853869        argv += optind; 
     870 
     871        /* Tar requires an action. */ 
     872        if (act == ERROR) 
     873                tar_usage(); 
    854874 
    855875        /* Traditional tar behaviour (pax uses stderr unless in list mode) */ 
     
    10701090        return (0); 
    10711091} 
     1092 
     1093static void 
     1094cpio_set_action(int op) 
     1095{ 
     1096        if ((act == APPND && op == ARCHIVE) || (act == ARCHIVE && op == APPND)) 
     1097                act = APPND; 
     1098        else if ((act == LIST && op == EXTRACT) || (act == EXTRACT && op == LIST)) 
     1099                act = LIST; 
     1100        else if (act != ERROR && act != op) 
     1101                cpio_usage(); 
     1102        else 
     1103                act = op; 
     1104} 
     1105 
    10721106/* 
    10731107 * cpio_options() 
     
    10791113cpio_options(int argc, char **argv) 
    10801114{ 
    1081         int c, i; 
     1115        int c; 
     1116        size_t i; 
    10821117        char *str; 
    10831118        FSUB tmp; 
     
    10901125        arcname = NULL; 
    10911126        dflag = 1; 
    1092         act = -1; 
    10931127        nodirs = 1; 
    10941128        while ((c=getopt(argc,argv,"abcdfiklmoprstuvzABC:E:F:H:I:LM:O:SZ6")) != -1) 
     
    11271161                                 * restore an archive 
    11281162                                 */ 
    1129                                 act = EXTRACT
     1163                                cpio_set_action(EXTRACT)
    11301164                                break; 
    11311165                        case 'k': 
     
    11471181                                 * create an archive 
    11481182                                 */ 
    1149                                 act = ARCHIVE
     1183                                cpio_set_action(ARCHIVE)
    11501184                                frmt = &(fsub[F_CPIO]); 
    11511185                                break; 
     
    11541188