[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#327081: ITP: rpmstrap -- bootstrap a basic RPM-based system



On Mon, Sep 12, 2005 at 12:12:31PM -0500, Sam Hart wrote:
> To be completely honest with you, I've not looked much at the
> debootstrap code before now. I have tried to mimic debootstrap's
> interface without a doubt, but have only done so by *using* debootstrap
> rather than snooping in its code. 

It's not "snooping" to look at the code of a free software project.

> For what it's worth, rpmstrap as it is today is actually based on a tool
> developed in house at Progeny. This tool could only bootstrap Fedora
> Core 2 at a specific revision. Looking at that code now and comparing it
> to what I see inside of debootstrap, the only real similarities I see
> are that they both have functions common to /many/ other shell scripts
> (usage(), die(), warn(), trace()).

Looking at rpmstrap-0.1, we see the following code for handling options:

] if [ $# != 0 ] ; then
]     while true ; do
]         case "$1" in
]             --help)
]                 usage
]                 exit 0
]                 ;;
] ...
]         esac
]     done
] else
]     usage_error "You must specify a suite and a target."
] fi

debootstrap uses the exact same code, except to say "usage_err
1 NEEDSUITETARGET" instead of "usage_error" and with two-space
indentation. The usual way to parse arguments is with a `for a in "$@"'
loop, or using getopt -- the above parsing algorithm has the bug that
options can only appear at the beginning of the command line, eg.

rpmstrap-0.1 uses the variable "$JUST_PRINT_RPMS" to track whether to dump
the list of rpms to stdout or not; debootstrap uses "$JUST_PRINT_DEBS".

Compare the usage() functions:

] usage()
] {
]     echo "Usage: $PROGNAME [OPTION]... <suite> <target> [<mirror>]"
]     echo "Bootstrap RPM-based systems."
]     echo
]     cat <<EOF
]       --arch                 set the target architecture (use if no uname)
]                                [ --arch x86_64 ]
]                                
]       --download-only        download packages, but don't perform installation
 
] usage()
] {
]     echo "Usage: ${0##*/} [OPTION]... <suite> <target> [<mirror> [<script>]]"
]     echo "Bootstrap Debian base system."
]     echo
]     cat <<EOF
]       --arch                 set the target architecture (use if no dpkg)
]                                [ --arch powerpc ]
]       --download-only        download packages, but don't perform installation

The code that handles the "You must specify a suite and a target." error
messages looks pretty familiar too, but I've changed it a few times and
I didn't find an exact match at first glance.

> I will have to check the legacy on this tool used internally at Progeny
> to ensure nothing came from debootstrap,

As opposed to use a license that means it could potentially be incorporated
into debootstrap or give credit where it seems like it's due, considering

>         1) Identical command-line options:
>         2) Placing of suite scripts inside of a "scripts/*" directory:
>         3) Making common functions available to suite scripts:

that you did seem to copy quite a bit from debootstrap anyway.

For instance, debootstrap's copyright says:

] It was written from scratch for Debian by Anthony Towns <ajt@debian.org>
] based loosely on the code for constructing base tarballs as part of the
] boot-floppies package.

and I think you'll find, if you care, that debootstrap shares a lot less
with the boot-floppies code than rpmstrap does with it. In comparison:

$ find rpmstrap-0.{1,2,3,4,5} -type f | xargs grep debootstrap | wc -l
0

Even if you hadn't copied any code whatsoever, isn't a little
acknowledgement appropriate? It's not as though debootstrap's license
is particularly onerous.

Cheers,
aj

Attachment: signature.asc
Description: Digital signature


Reply to: