From: Marco Atzeri <marco.atzeri@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Is there a way to clone-install Cygwin?
Date: Tue, 21 Jan 2020 04:46:00 -0000 [thread overview]
Message-ID: <1539c3b5-904a-d94a-60ec-a8feb58ec253@gmail.com> (raw)
In-Reply-To: <SN6PR09MB2877F202738BF6B7029538F3A50D0@SN6PR09MB2877.namprd09.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]
Am 21.01.2020 um 01:58 schrieb Lavrentiev, Anton (NIH/NLM/NCBI) [C] via
cygwin:
> Hi List,
>
> I have a question, is there a way to clone-install Cygwin?
>
> Like I have installed whatever packages I selected on some PC, then maintained that installation for a while,
> doing upgrades etc. Now I need to install the exact same set on another PC. Can I pull up a list and use it
> in a sort of a batch install with setup.exe? I want to avoid to dumb-copy the entire C:\cygwin tree from one PC to another,
> rather use a semi-automatic install procedure from scratch, if possible, using the list of packages that I need.
>
> Thanks for all the insights you can provide.
>
> Cheers,
> Anton
>
attached my solution to re-install or duplicate the packages of an
existing installation.
$ ./cyg-reinstall.sh
Usage : cyg-reinstall.sh [ -A | -I | -f filelist ]
create cyg-reinstall-{ARC}.bat from
options
-A : All packages as reported by cygcheck
-I : incomplete packages as reported by cygcheck
-f : packages in filelist (one per row)
$ ./cyg-reinstall.sh -A
and the batch file is ready
$ ls -s cyg-reinstall-x86_64.bat
32K cyg-reinstall-x86_64.bat
$ head -c 100 cyg-reinstall-x86_64.bat
setup-x86_64.exe -P
_autorebase,_autorebase,_update-info-dir,a2ps,adobe-source-code-pro-fonts,adob
Regards
Marco
[-- Attachment #2: cyg-reinstall.sh --]
[-- Type: text/plain, Size: 1502 bytes --]
#!/bin/bash
# Create a batch file to reinstall using setup-{ARCH}.exe
# all packages or the ones reported as incomplete
print_error=1
if [ $# -eq 1 ]
then
if [ $1 == "-I" ]
then
lista=$(mktemp)
cygcheck -c | grep "Incomplete" > $lista
print_error=0
fi
if [ $1 == "-A" ]
then
lista=$(mktemp)
cygcheck -cd | sed -e "1,2d" > $lista
print_error=0
fi
fi
if [ $# -eq 2 ]
then
if [ $1 == "-f" ]
then
lista=$2
print_error=0
fi
fi
# error message if options are incorrect.
if [ $print_error -eq 1 ]
then
echo -n "Usage : " $(basename $0)
echo " [ -A | -I | -f filelist ]"
echo " create cyg-reinstall-{ARC}.bat from"
echo " options"
echo " -A : All packages as reported by cygcheck"
echo " -I : incomplete packages as reported by cygcheck"
echo " -f : packages in filelist (one per row)"
exit 1
fi
if [ $(arch) == "x86_64" ]
then
A="x86_64"
else
A="x86"
fi
# writing header
echo -n -e "setup-${A}.exe " > cyg-reinstall-${A}.bat
# option -x remove and -P install
# for re-install packages we need both
if [ $1 == "-I" ]
then
awk 'BEGIN{printf(" -x ")} NR==1{printf $1}{printf ",%s", $1}' ${lista} >> cyg-reinstall-${A}.bat
fi
awk 'BEGIN{printf(" -P ")} NR==1{printf $1}{printf ",%s", $1} END { printf "\r\n pause "}' ${lista} >> cyg-reinstall-${A}.bat
# execution permission for the script
chmod +x cyg-reinstall-${A}.bat
[-- Attachment #3: Type: text/plain, Size: 219 bytes --]
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
next prev parent reply other threads:[~2020-01-21 4:46 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-21 0:58 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2020-01-21 1:27 ` Brent Epp
2020-01-31 10:25 ` Ulli Horlacher
2020-01-31 11:29 ` Ulli Horlacher
2020-01-31 12:05 ` Ulli Horlacher
2020-01-31 12:54 ` Thomas Wolff
2020-01-31 14:06 ` Ulli Horlacher
2020-02-01 10:05 ` Andrey Repin
2020-02-01 11:21 ` BGINFO4X
2020-02-03 16:40 ` Ulli Horlacher
2020-02-03 17:01 ` BGINFO4X
2020-02-04 17:16 ` Ulli Horlacher
[not found] ` <16fc5b08e80.2780.a1382e26d1292f71ec6ef0cd03d49346@pdc.ca>
2020-01-21 2:33 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2020-01-21 2:55 ` Brent Epp
2020-01-21 4:46 ` Marco Atzeri [this message]
2020-01-21 20:33 ` Achim Gratz
2020-01-28 21:35 ` Andrey Repin
2020-01-28 22:00 ` Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2020-01-21 19:17 Lavrentiev, Anton (NIH/NLM/NCBI) [C] via cygwin
2020-01-31 14:06 KARL BOTTS
2020-01-31 14:13 ` Ulli Horlacher
2020-01-31 19:21 ` Achim Gratz
2020-01-31 20:25 ` Brian Inglis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1539c3b5-904a-d94a-60ec-a8feb58ec253@gmail.com \
--to=marco.atzeri@gmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).