Compare commits

...

11 Commits
v1 ... master

Author SHA1 Message Date
andreika-git 71dc3b8396 curl support 2022-04-08 12:17:33 +03:00
Stephen Jungels 12e9549c00 Create status.md 2017-01-28 16:20:14 -05:00
Stephen Jungels 2cac8244cc Update readme.md
Removed bountysource link
2016-08-15 12:20:25 -04:00
Stephen Jungels 3a40db999b Delete go-cyg.go 2016-03-07 12:39:13 -05:00
Stephen Jungels 5ef3cf48e2 Delete README.md 2016-03-07 12:39:01 -05:00
Stephen Jungels 22a687440f Delete apt-msys2 2016-03-07 12:38:41 -05:00
Stephen Jungels 1d5df19948 Merge pull request #75 from lcorbasson/patch-1
Create a license file (MIT)
2016-03-07 12:32:08 -05:00
Loïc Corbasson 807a91f87a Create a license file (MIT)
MIT license like in the source files
2016-03-07 11:50:40 +01:00
Stephen Jungels 0638b38932 Removed old status update 2016-03-01 15:48:24 -05:00
Stephen Jungels cf0e883858 Update readme.md
Status update
2016-01-24 10:06:46 -05:00
Steven Penny b6076c2900 you guys love wasting my time or: fix #72 2016-01-22 22:31:09 -06:00
7 changed files with 54 additions and 241 deletions

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Stephen Jungels
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

14
apt-cyg
View File

@ -23,6 +23,12 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
if [ ${BASH_VERSINFO}${BASH_VERSINFO[1]} -lt 42 ]
then
echo 'Bash version 4.2+ required'
exit
fi
usage="\
NAME
apt-cyg - package manager utility
@ -116,10 +122,16 @@ function wget {
if command wget -h &>/dev/null
then
command wget "$@"
else
# see https://github.com/transcode-open/apt-cyg/issues/99
elif command lynx -version &>/dev/null
then
warn wget is not installed, using lynx as fallback
set "${*: -1}"
lynx -source "$1" > "${1##*/}"
else
warn wget and lynx are not installed, using curl as fallback
set "${*/\-O/" -o"}"
command curl -L $1
fi
}

145
apt-msys2
View File

@ -1,145 +0,0 @@
#!/bin/bash
# The MIT License (MIT)
#
# Copyright (c) 2014 Steven Penny
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
function usage {
local rw=(
'apt-msys2 [command] [packages]'
''
'Commands:'
' install <packages> install packages'
' listfiles <packages> list files owned by packages'
' search <patterns> search for a filename from all available packages'
)
printf '%s\n' "${rw[@]}"
}
function urlencode {
sed '
s / %2f g
s : %3a g
' <<< "$1"
}
function findworkspace {
mirror=http://downloads.sourceforge.net/project/msys2
repo=REPOS/MINGW/$ARCH
local mirrordir=/var/cache/$(urlencode $mirror)/$repo
mkdir -p $mirrordir
cd $mirrordir
}
function getdb {
[ -e mingw64.files.tar.gz ] && return
wget $mirror/$repo/mingw64.files.tar.gz
tar --no-an -Oxf mingw64.files.tar.gz desc files > mingw64.lst
}
function apt-listfiles {
findworkspace
getdb
local pkg
for pkg in ${packages[*]}
do
awk '
$2 == "%NAME%\n" pkg {
print $NF
}
' pkg=$pkg RS=%FILENAME% FS='\n\n' mingw64.lst
done |
head -c-1
}
function apt-install {
findworkspace
getdb
local pkg file eu oe rw
for pkg in ${packages[*]}
do
file=$(awk '$5 == pkg, $0 = $2' pkg=$pkg RS=%FILENAME% FS='\n' mingw64.lst)
wget -nc $mirror/$repo/$file
tar --str 1 -x -C / -f $file
apt-msys2 listfiles $pkg | grep '\.exe$' | while read eu
do
oe=$(sed 's-^.*/--; s-\.exe$--' <<< $eu)
rw=(
'tg=$(cygpath -m $1)'
'shift'
'cygstart ${0#/usr/local} $tg $*'
)
printf '%s\n' "${rw[@]}" > $oe
install $oe /usr/local/bin
done
echo Package $pkg installed
done
}
function apt-search {
findworkspace
getdb
for pkg in ${packages[*]}
do
awk '
$0 ~ pkg {
print $5
}
' pkg="$pkg" RS=%FILENAME% FS='\n' mingw64.lst
done
}
while (( $# ))
do
case "$1" in
install | listfiles | search)
if [[ $command ]]
then
packages+=($1)
else
command=$1
fi
shift
;;
*)
packages+=($1)
shift
;;
esac
done
if [ $HOSTTYPE = x86_64 ]
then
ARCH=x86_64
else
ARCH=x86
fi
if type -t apt-$command | grep -q function
then
apt-$command
else
usage
fi

View File

@ -1,33 +0,0 @@
# Why Go?
Consider this Python script
~~~py
print("Hello world")
~~~
You can compile it for Windows like this
build_exe --bundle-files 0 --compress --optimize hello.py
upx -9 hello.exe
and it comes out to 4.16 MB. Now consider this Go script
~~~go
package main
import "fmt"
func main() {
fmt.Println("Hello world")
}
~~~
You can compile it like this
go build -ldflags -s hello.go
upx -9 hello.exe
and it comes out to 375 KB. Something else to consider is that Python is built
with Visual C++ 2010. That means that the program you create will not work on
Windows 7 for example unless the user has installed Visual C++ 2010. Go is built
with Visual C++ 6, this means that any programs created with Go will work on
Windows 7 as is.

View File

@ -1,58 +0,0 @@
package main
import (
"compress/bzip2"
"fmt"
"io"
"net/http"
"os"
"strings"
)
func wget(url string) {
tokens := strings.Split(url, "/")
fileName := tokens[len(tokens)-1]
fmt.Println("Downloading", url, "to", fileName)
output, err := os.Create(fileName)
if err != nil {
return
}
response, err := http.Get(url)
if err != nil {
return
}
n, err := io.Copy(output, response.Body)
if err != nil {
return
}
fmt.Println(n, "bytes downloaded.")
}
func bunzip2(alpha string) {
bravo, err := os.Open(alpha)
if err != nil {
return
}
charlie := bzip2.NewReader(bravo)
delta, err := os.Create("setup.ini")
if err != nil {
return
}
io.Copy(delta, charlie)
}
func foxtrot() {
// create release folder
os.MkdirAll("mirror/x86_64/release", 0)
// cd
os.Chdir("mirror/x86_64")
// download
wget("http://cygwin.osuosl.org/x86_64/setup.bz2")
// extract
bunzip2("setup.bz2")
}
func main() {
foxtrot()
// parse ini
// category: Base
}

View File

@ -6,11 +6,7 @@ Cygwin which cooperates with Cygwin Setup and uses the same repository.
[github.com/transcode-open/apt-cyg][1]
[![bountysource][3]][2]
[1]:https://github.com/transcode-open/apt-cyg
[2]:https://www.bountysource.com/teams/svnpenn
[3]:https://api.bountysource.com/badge/team?team_id=114003&style=raised
Operations
----------

20
status.md Normal file
View File

@ -0,0 +1,20 @@
# Note from the developer
I am no longer working on apt-cyg. As far as I know, it works.
However it was written quite a while ago by reverse engineering the files used by Cygwin's setup.exe program. It doesn't
share any code with setup.exe, and if setup.exe is modified in such a way that assumptions made by apt-cyg no longer
apply, apt-cyg will break.
apt-cyg is an infrastructure program and probably belongs in Cygwin rather than here, but as far as I know, RedHat is
no longer paying more than one or two engineers to work on Cygwin and they are unlikely to do anything with apt-cyg or
other, similar programs that are out there.
Because I got dragged into a time-consuming and unpleasant law suit involving apt-cyg, I am very unlikely to put
more time and effort into it anytime soon, even though I won. I write open source software because I enjoy it, not so
I can get involved in meaningless conflicts.
If you would like to contribute to apt-cyg, the best way to do that is to fork it. You don't need my permission to
do that, just follow the license.
--Steve Jungels